Softwr

Developer Tools · head to head

Prettier vs Stencil

Prettier logo

Prettier

Developer Tools

Opinionated code formatter

From
Free
Free plan
Yes
Stencil logo

Stencil

Web Development

MIT licensed toolchain for building reusable Web Component libraries in TypeScript

From
Free
Free plan
Yes

The short version

  • Prettier is an opinionated code formatter; Stencil is an open source toolchain.
  • Both are free.
  • Where Prettier falls short: inflexible style rules that cannot be customized significantly, forcing teams to accept opinionated defaults.
  • Where Stencil falls short: aimed at component libraries, so routing and data fetching must come from elsewhere.

How do Prettier and Stencil differ?

Prettier and Stencil differ on pricing model (Free against Open-source), platforms and category (Developer Tools against Web Development). Only the attributes on which Prettier and Stencil actually diverge.

Attributes where Prettier and Stencil differ
AttributePrettierStencil
Pricing modelFreeOpen-source
PlatformsAPI, Editor Plugins, Build ToolsWeb, Windows, macOS, Linux
CategoryDeveloper ToolsWeb Development

Identical on both: starting price (Free), free tier (Yes).

Not yet recorded: founded for Stencil.

Which features does each one have?

They share no listed features; 8 only for Stencil. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Prettier

Nothing recorded that Stencil does not also cover.

Only in Stencil

  • Compiles TypeScript and JSX to Web Components
  • Shadow DOM and slots support
  • Output optimised for tree shaking and loading
  • Asynchronous rendering pipeline
  • Documentation generated from JSDoc comments
  • Dev server with hot reloading
  • Unit testing and code generation tooling
  • Integration guides for Angular, React and Vue

What is each one used for?

Prettier is most often brought in for automatically formatting TypeScript files to project style standards; Stencil for publishing a design system as Web Components. The jobs each tool is most often brought in to do.

Prettier

  • Automatically formatting TypeScript files to project style standardsnot Stencil
  • Enforcing consistent HTML indentation across component filesnot Stencil
  • Removing style-related comments from pull request reviewsnot Stencil
  • Formatting GraphQL queries with consistent indentationnot Stencil

Stencil

  • Publishing a design system as Web Componentsnot Prettier
  • Sharing UI components across React, Angular and Vue appsnot Prettier
  • Building framework independent widgetsnot Prettier
  • Generating documentation for component librariesnot Prettier
  • Building progressive web apps with Web Componentsnot Prettier

Where do Prettier and Stencil fall short?

Prettier's most cited limit: inflexible style rules that cannot be customized significantly, forcing teams to accept opinionated defaults. Stencil's: aimed at component libraries, so routing and data fetching must come from elsewhere. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Prettier

  • Inflexible style rules that cannot be customized significantly, forcing teams to accept opinionated defaults
  • Developers must format entire files rather than selective line ranges in some contexts
  • Limited language support compared to some alternatives, though it covers major languages

Stencil

  • Aimed at component libraries, so routing and data fetching must come from elsewhere
  • Requires TypeScript and decorator conventions that differ from other frameworks
  • Web Component styling and form handling can need extra work in some host frameworks
  • Smaller ecosystem of third party components than the largest frameworks

How much do Prettier and Stencil cost?

Prettier is free to use; Stencil is free to use. Plan by plan below, from each vendor's own pricing page.

Prettier

Free
  • Open sourceFree

Stencil

Free

No published plan breakdown. See the Stencil review.

Which should you pick?

Choose Prettier if

  • You want to start without paying.
  • You work on API, Editor Plugins, Build Tools.

Choose Stencil if

  • You need compiles typescript and jsx to web components.
  • You want to start without paying.
  • You work on Web, Windows, macOS, Linux.
  • You also want shadow dom and slots support.

Questions people ask

Is Prettier or Stencil better?
It depends on the job. Prettier fits automatically formatting TypeScript files to project style standards; Stencil fits publishing a design system as Web Components. Prettier starts at Free and Stencil at Free.
Which is cheaper, Prettier or Stencil?
Prettier starts at Free and Stencil at Free.
Does Prettier or Stencil run on more platforms?
Prettier runs on API, Editor Plugins, Build Tools. Stencil runs on Web, Windows, macOS, Linux.
Can I use Prettier for free?
Both have a free tier, so you can try either at no cost before committing.
What is Prettier best used for?
Prettier is most often used for automatically formatting typescript files to project style standards, enforcing consistent html indentation across component files, removing style-related comments from pull request reviews, formatting graphql queries with consistent indentation. Of those, automatically formatting typescript files to project style standards and enforcing consistent html indentation across component files are not what Stencil is typically brought in for.
What can Prettier do that Stencil cannot?
Stencil covers Compiles TypeScript and JSX to Web Components, Shadow DOM and slots support, Output optimised for tree shaking and loading, Asynchronous rendering pipeline.

Answered from the vendors’ own pages

Prettier: Is Prettier free and open source?

Yes, Prettier is completely free and open source, available as an npm package with no licensing costs or subscriptions.

Source
Stencil: What does Stencil produce?

Stencil compiles components written in TypeScript and JSX into standard Web Components. These work in any major framework or without one.

Source
Prettier: Can Prettier be integrated with ESLint?

Yes, Prettier integrates with ESLint by disabling ESLint formatting rules via eslint-config-prettier, allowing both tools to work together with Prettier handling formatting and ESLint handling code quality.

Source
Stencil: Is Stencil free?

Yes. The project is released under the MIT licence according to both its website and its GitHub repository.

Source
Prettier: Does Prettier support configuration customization?

Prettier is intentionally opinionated with limited configuration options to enforce consistency. You can create a .prettierrc file for basic customization, but Prettier does not support extensive rule customization like ESLint.

Source
Stencil: Who builds Stencil?

The README says Stencil is built by the Ionic team. The website describes it as an open source project by Ionic.

Source
Stencil: Does Stencil work with React, Angular and Vue?

Yes. Components are plain Web Components, and the website provides integration guides for Angular, React and Vue.

Source
Share

Related pages

Other head to heads