Skip to content

feat: remove prettier#15

Open
danieloprado wants to merge 5 commits intomasterfrom
feature/performance
Open

feat: remove prettier#15
danieloprado wants to merge 5 commits intomasterfrom
feature/performance

Conversation

@danieloprado
Copy link
Member

@danieloprado danieloprado commented Feb 20, 2026

What?

Remoção do prettier. Tentei diminuir o máximo de impacto nas mudanças para ter o mesmo comportamento do prettier sem grandes alterações, o único caso que não consegui manter igual é a indentação de types.

Não será necessário mudar nada nos projeto que for implementado. apenas remover os arquivos do prettier que agora serão desnecessários.

Beta para testar: 3.0.0-beta.1

Why?

Em projetos grandes o prettier tem se mostrado muito lento, com essa alteração consegui ter o mesmo comportamento do prettier com um ganho de 20~50% de performance;

# antes: 
pnpm lint  20.82s user 5.23s system 134% cpu 19.321 total
# depois: 
pnpm lint  10.77s user 1.02s system 154% cpu 7.649 total

Before:

Rule Time (ms) Relative
prettier/prettier 11267.978 81.5%
import/no-duplicates 582.690 4.2%
import/order 346.081 2.5%
@typescript-eslint/naming-convention 316.534 2.3%
react/no-direct-mutation-state 266.190 1.9%
padding-line-between-statements 97.740 0.7%
react-hooks/rules-of-hooks 79.406 0.6%
react-hooks/exhaustive-deps 77.823 0.6%
react/require-render-return 77.532 0.6%
unused-imports/no-unused-imports 60.327 0.4%
react-native/no-inline-styles 58.056 0.4%
@typescript-eslint/consistent-type-imports 52.453 0.4%
react/no-deprecated 50.691 0.4%
object-shorthand 36.779 0.3%
import/export 36.451 0.3%
react-native/no-unused-styles 35.436 0.3%
no-trailing-spaces 34.077 0.2%
react/no-unknown-property 29.230 0.2%
react/jsx-no-target-blank 27.583 0.2%
@typescript-eslint/member-ordering 26.929 0.2%
import/first 26.604 0.2%
@typescript-eslint/no-unused-vars 21.537 0.2%
react/jsx-key 18.864 0.1%
react/jsx-no-comment-textnodes 14.920 0.1%
@typescript-eslint/triple-slash-reference 14.269 0.1%
@typescript-eslint/adjacent-overload-signatures 14.142 0.1%
no-multiple-empty-lines 13.263 0.1%
@typescript-eslint/ban-ts-comment 12.400 0.1%
react/no-render-return-value 12.228 0.1%
react/jsx-no-duplicate-props 10.570 0.1%
react/no-string-refs 9.431 0.1%
quotes 9.294 0.1%
@typescript-eslint/no-unnecessary-type-constraint 7.007 0.1%
react/jsx-no-undef 6.897 0.0%
@typescript-eslint/explicit-member-accessibility 6.133 0.0%
react/no-danger-with-children 6.058 0.0%
react/no-children-prop 5.479 0.0%
prefer-spread 4.900 0.0%
react/jsx-uses-vars 4.351 0.0%
@typescript-eslint/no-array-constructor 4.208 0.0%
max-lines 3.836 0.0%
@typescript-eslint/no-namespace 3.641 0.0%
prefer-const 3.593 0.0%
@typescript-eslint/no-this-alias 3.536 0.0%
@typescript-eslint/prefer-as-const 3.317 0.0%
@typescript-eslint/no-wrapper-object-types 3.099 0.0%
@typescript-eslint/no-unsafe-declaration-merging 2.998 0.0%
no-restricted-syntax 2.855 0.0%
react/no-find-dom-node 2.626 0.0%
@typescript-eslint/no-unsafe-function-type 2.558 0.0%
@typescript-eslint/no-useless-constructor 2.342 0.0%
no-unused-vars 2.209 0.0%
no-restricted-globals 2.028 0.0%
react/no-is-mounted 1.817 0.0%
prefer-rest-params 1.708 0.0%
@typescript-eslint/no-duplicate-enum-values 1.607 0.0%
@typescript-eslint/prefer-namespace-keyword 1.475 0.0%
no-var 1.464 0.0%
@typescript-eslint/no-non-null-asserted-optional-chain 1.242 0.0%
@typescript-eslint/no-extra-non-null-assertion 1.225 0.0%
@typescript-eslint/no-misused-new 1.118 0.0%
no-extra-semi 0.987 0.0%

After:

Rule Time (ms) Relative
import/no-duplicates 531.843 15.5%
@stylistic/indent 496.780 14.5%
tailwindcss/classnames-order 386.758 11.3%
import/order 345.992 10.1%
@typescript-eslint/naming-convention 275.507 8.0%
react/no-direct-mutation-state 230.195 6.7%
@stylistic/object-curly-spacing 96.782 2.8%
react/require-render-return 71.576 2.1%
padding-line-between-statements 61.836 1.8%
react-hooks/rules-of-hooks 60.834 1.8%
@stylistic/max-len 59.933 1.7%
react-native/no-inline-styles 51.814 1.5%
react-hooks/exhaustive-deps 50.338 1.5%
unused-imports/no-unused-imports 46.563 1.4%
@stylistic/comma-dangle 46.215 1.3%
react/no-deprecated 42.976 1.3%
@typescript-eslint/consistent-type-imports 40.258 1.2%
react-native/no-unused-styles 33.822 1.0%
import/export 32.392 0.9%
react/no-unknown-property 26.782 0.8%
import/first 26.464 0.8%
object-shorthand 24.462 0.7%
@typescript-eslint/no-unused-vars 24.174 0.7%
@stylistic/semi 23.969 0.7%
react/jsx-no-target-blank 23.868 0.7%
@typescript-eslint/member-ordering 19.787 0.6%
@stylistic/jsx-closing-bracket-location 18.092 0.5%
@stylistic/no-trailing-spaces 17.388 0.5%
@stylistic/quote-props 16.954 0.5%
react/jsx-key 16.488 0.5%
no-trailing-spaces 15.886 0.5%
react/no-danger-with-children 14.741 0.4%
react/jsx-no-comment-textnodes 14.468 0.4%
@stylistic/quotes 11.833 0.3%
@typescript-eslint/no-array-constructor 11.752 0.3%
react/no-render-return-value 11.629 0.3%
no-multiple-empty-lines 11.620 0.3%
@typescript-eslint/ban-ts-comment 10.637 0.3%
react/jsx-no-duplicate-props 10.556 0.3%
quotes 9.200 0.3%
@typescript-eslint/adjacent-overload-signatures 9.019 0.3%
react/no-string-refs 8.808 0.3%
@typescript-eslint/triple-slash-reference 7.761 0.2%
react/jsx-no-undef 7.249 0.2%
@stylistic/arrow-parens 5.971 0.2%
@typescript-eslint/explicit-member-accessibility 5.330 0.2%
@typescript-eslint/no-unnecessary-type-constraint 5.300 0.2%
react/no-children-prop 5.000 0.1%
prefer-spread 4.554 0.1%
react/jsx-uses-vars 4.401 0.1%
no-restricted-syntax 3.127 0.1%
prefer-const 3.076 0.1%
max-lines 3.055 0.1%
@stylistic/jsx-quotes 3.015 0.1%
@typescript-eslint/no-namespace 2.741 0.1%
@stylistic/jsx-first-prop-new-line 2.644 0.1%
@stylistic/eol-last 2.576 0.1%
@typescript-eslint/prefer-as-const 2.463 0.1%
@typescript-eslint/no-this-alias 2.400 0.1%
react/no-find-dom-node 2.385 0.1%
@typescript-eslint/no-wrapper-object-types 2.371 0.1%
@typescript-eslint/no-unsafe-declaration-merging 2.234 0.1%
@typescript-eslint/no-unsafe-function-type 2.161 0.1%
no-unused-vars 2.115 0.1%
@typescript-eslint/no-useless-constructor 1.871 0.1%
@typescript-eslint/no-duplicate-enum-values 1.719 0.1%
no-restricted-globals 1.683 0.0%
react/no-is-mounted 1.574 0.0%
prefer-rest-params 1.484 0.0%
no-var 1.226 0.0%
@typescript-eslint/no-misused-new 1.148 0.0%
@typescript-eslint/prefer-namespace-keyword 1.062 0.0%
@typescript-eslint/no-extra-non-null-assertion 0.981 0.0%
@typescript-eslint/no-non-null-asserted-optional-chain 0.955 0.0%
no-extra-semi 0.714 0.0%

@danieloprado danieloprado requested a review from a team as a code owner February 20, 2026 15:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes Prettier as a dependency and replaces it with ESLint's @stylistic/eslint-plugin to achieve the same formatting behavior with significantly better performance (20-50% faster based on the benchmarks provided). The change is a major version bump from 2.5.6 to 3.0.0, indicating a breaking change since projects using this config will need to remove their Prettier configuration files.

Changes:

  • Replaced Prettier with @stylistic/eslint-plugin for code formatting, mapping all Prettier rules to equivalent ESLint stylistic rules
  • Added eslint-plugin-tailwindcss to handle Tailwind CSS class ordering directly in ESLint instead of through prettier-plugin-tailwindcss
  • Removed all Prettier-related dependencies and configuration files

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Updated version to 3.0.0, replaced prettier dependencies with @stylistic/eslint-plugin and eslint-plugin-tailwindcss
yarn.lock Added new stylistic and tailwind plugin dependencies, removed all prettier-related packages
configs/default.js Replaced prettier plugin with @stylistic plugin and added all formatting rules to match previous prettier behavior
configs/react-tailwind.js New configuration file for Tailwind CSS class ordering with graceful fallback if plugin not found
react.js Added react-tailwind configuration to React preset
prettierrc.js Removed file - no longer needed without Prettier
.prettierrc.js Removed file - no longer needed without Prettier
.gitignore Removed exception for .prettierrc.js since it no longer exists
README.md Removed .prettierrc.js setup instructions from installation section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,22 @@

try {
const tailwind = require('eslint-plugin-tailwindcss');
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two spaces after the equals sign. This should be a single space for consistency with the rest of the codebase.

Suggested change
const tailwind = require('eslint-plugin-tailwindcss');
const tailwind = require('eslint-plugin-tailwindcss');

Copilot uses AI. Check for mistakes.
'tailwindcss': tailwind
},
rules: {
'tailwindcss/classnames-order': ['error', { callees : ['classnames', 'tw', 'clsx', 'ctl', 'cva', 'tv', 'cn', 'cx'] }]
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's extra space after 'callees' before the colon. This should be removed for consistency.

Suggested change
'tailwindcss/classnames-order': ['error', { callees : ['classnames', 'tw', 'clsx', 'ctl', 'cva', 'tv', 'cn', 'cx'] }]
'tailwindcss/classnames-order': ['error', { callees: ['classnames', 'tw', 'clsx', 'ctl', 'cva', 'tv', 'cn', 'cx'] }]

Copilot uses AI. Check for mistakes.
'@stylistic/comma-dangle': ['error', 'never'],
'@stylistic/arrow-parens': ['error', 'as-needed'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/indent': ['error', 2, { 'VariableDeclarator': 'first', 'outerIIFEBody': 1, 'MemberExpression': 1, 'ArrayExpression': 1, 'flatTernaryExpressions': true, 'offsetTernaryExpressions': true }],
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a double space after 'first', before the comma. This should be a single space.

Suggested change
'@stylistic/indent': ['error', 2, { 'VariableDeclarator': 'first', 'outerIIFEBody': 1, 'MemberExpression': 1, 'ArrayExpression': 1, 'flatTernaryExpressions': true, 'offsetTernaryExpressions': true }],
'@stylistic/indent': ['error', 2, { 'VariableDeclarator': 'first', 'outerIIFEBody': 1, 'MemberExpression': 1, 'ArrayExpression': 1, 'flatTernaryExpressions': true, 'offsetTernaryExpressions': true }],

Copilot uses AI. Check for mistakes.
```
2. `.prettierrc.js`

`eslint.config.js` se for "type": "module" no package.json:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

é o mesmo nome do arquivo para os dois mesmo?

Suggested change
`eslint.config.js` se for "type": "module" no package.json:
`eslint.config.mjs` se for "type": "module" no package.json:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants