PageSourceSearch

https://prettier-prettier-preview-prod.vercel.app/assets/js/a02fc01d.c4cf4295.js

js prettier-prettier-preview-prod.vercel.app collected 2026-10-03 07:33:34 UTC 3,592 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[5142],{8431(e,t,s){s.r(t),s.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>h,frontMatter:()=>i,metadata:()=>r,toc:()=>a});const r=JSON.parse('{"id":"comparison","title":"Prettier vs. Linters","description":"How does it compare to ESLint/TSLint/stylelint, etc.?","source":"@site/versioned_docs/version-stable/comparison.md","sourceDirName":".","slug":"/comparison","permalink":"/docs/comparison","draft":false,"unlisted":false,"editUrl":"https://github.com/prettier/prettier/edit/main/docs/comparison.md","tags":[],"version":"stable","frontMatter":{"id":"comparison","title":"Prettier vs. Linters"},"sidebar":"docs","previous":{"title":"Why Prettier?","permalink":"/docs/why-prettier"},"next":{"title":"Option Philosophy","permalink":"/docs/option-philosophy"}}');var o=s(4848),n=s(8453);const i={id:"comparison",title:"Prettier vs. Linters"},l=void 0,c={},a=[{value:"How does it compare to ESLint/TSLint/stylelint, etc.?",id:"how-does-it-compare-to-eslinttslintstylelint-etc",level:2}];function d(e){const t={a:"a",h2:"h2",p:"p",strong:"strong",...(0,n.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h2,{id:"how-does-it-compare-to-eslinttslintstylelint-etc",children:"How does it compare to ESLint/TSLint/stylelint, etc.?"}),"\n",(0,o.jsx)(t.p,{children:"Linters have two categories of rules:"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Formatting rules"}),": eg: ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/max-len",children:"max-len"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/no-mixed-spaces-and-tabs",children:"no-mixed-spaces-and-tabs"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/keyword-spacing",children:"keyword-spacing"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/comma-style",children:"comma-style"}),"\u2026"]}),"\n",(0,o.jsx)(t.p,{children:"Prettier alleviates the need for this whole category of rules! Prettier is going to reprint the entire program from scratch in a consistent way, so it\u2019s not possible for the programmer to make a mistake there anymore :)"}),"\n",(0,o.jsxs)(t.p,{children:[(0,o.jsx)(t.strong,{children:"Code-quality rules"}),": eg ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/no-unused-vars",children:"no-unused-vars"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/no-extra-bind",children:"no-extra-bind"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/no-implicit-globals",children:"no-implicit-globals"}),", ",(0,o.jsx)(t.a,{href:"https://eslint.org/docs/rules/prefer-promise-reject-errors",children:"prefer-promise-reject-errors"}),"\u2026"]}),"\n",(0,o.jsx)(t.p,{children:"Prettier does nothing to help with those kind of rules. They are also the most important ones provided by linters as they are likely to catch real bugs with your code!"}),"\n",(0,o.jsxs)(t.p,{children:["In other words, use ",(0,o.jsx)(t.strong,{children:"Prettier for formatting"})," and ",(0,o.jsx)(t.strong,{children:"linters for catching bugs!"})]})]})}function h(e={}){const{wrapper:t}={...(0,n.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},8453(e,t,s){s.d(t,{R:()=>i,x:()=>l});var r=s(6540);const o={},n=r.createContext(o);function i(e){const t=r.useContext(n);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),r.createElement(n.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.