Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: split lint and format #15534

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fisker
Copy link
Contributor

@fisker fisker commented Mar 6, 2025

Summary

It's bad to run Prettier as ESLint plugin, it's super slow.

Run eslint with TIMING=1

Before

yarn eslint .
Rule                             | Time (ms) | Relative
:--------------------------------|----------:|--------:
prettier/prettier                | 22804.028 |    36.2%
import/default                   |  3602.487 |     5.7%
import/no-duplicates             |  3150.643 |     5.0%
unicorn/no-unnecessary-polyfills |  2926.342 |     4.6%
unicorn/expiring-todo-comments   |  2317.099 |     3.7%
import/namespace                 |  2275.440 |     3.6%
jsdoc/check-alignment            |  1874.229 |     3.0%
unicorn/no-thenable              |  1396.356 |     2.2%
import/order                     |   855.491 |     1.4%
unicorn/new-for-builtins         |   727.296 |     1.2%

After

yarn eslint .
Rule                              | Time (ms) | Relative
:---------------------------------|----------:|--------:
import/default                    |  3129.741 |     8.6%
import/no-duplicates              |  2724.314 |     7.5%
unicorn/no-unnecessary-polyfills  |  2723.796 |     7.5%
unicorn/expiring-todo-comments    |  2009.008 |     5.5%
import/namespace                  |  1967.862 |     5.4%
jsdoc/check-alignment             |  1823.156 |     5.0%
unicorn/no-thenable               |  1150.524 |     3.2%
import/order                      |   794.733 |     2.2%
import/no-extraneous-dependencies |   658.272 |     1.8%
unicorn/prefer-array-flat         |   650.011 |     1.8%

Whole lint and format

Before

$ time yarn lint

real    1m39.628s
user    2m30.322s
sys     0m7.407s

$ time yarn lint:prettier . -w > /dev/null

real    0m27.648s
user    0m31.158s
sys     0m2.721s

After

$ time yarn lint

real    0m6.488s
user    0m6.935s
sys     0m1.005s

$ time yarn lint:prettier > /dev/null

real    0m14.757s
user    0m13.220s
sys     0m2.986s

Test plan

N/A

Copy link

netlify bot commented Mar 6, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 23abaea
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/67c981de9a58140008fffc9c
😎 Deploy Preview https://deploy-preview-15534--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fisker fisker marked this pull request as ready for review March 6, 2025 11:18
@fisker
Copy link
Contributor Author

fisker commented Mar 6, 2025

CI seems also fails on main branch, but passed in #15531

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.

1 participant