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

Bring in more rule configurations from @foxglove/studio #24

Merged
merged 4 commits into from
Jul 7, 2021

Conversation

jtbandes
Copy link
Member

@jtbandes jtbandes commented Jul 7, 2021

Graduate these changes to the shared config.

@jtbandes jtbandes requested a review from amacneil July 7, 2021 06:59
@@ -29,8 +29,11 @@ module.exports = {
},
],

"filenames/match-exported": "error",
Copy link
Contributor

Choose a reason for hiding this comment

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

I tested this rule out in the website repo, there are a couple of places we will need to ignore it (e.g. next.js requires files named _app.tsx and 404.tsx which aren't valid function export names). But other than that seems fine.

I assume you checked the perf implications of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, didn't see it in the timing output of any lint runs in studio

Copy link
Member Author

Choose a reason for hiding this comment

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

promise-function-async is the slowest in studio. I can still run yarn lint in 50 sec.

Rule                                          | Time (ms) | Relative
:---------------------------------------------|----------:|--------:
@typescript-eslint/promise-function-async     |  6097.230 |    35.6%
import/order                                  |  2961.612 |    17.3%
@typescript-eslint/no-floating-promises       |  2115.628 |    12.3%
@typescript-eslint/no-unused-vars             |   660.667 |     3.9%
@typescript-eslint/unbound-method             |   563.162 |     3.3%
@typescript-eslint/strict-boolean-expressions |   491.951 |     2.9%
react/no-deprecated                           |   430.047 |     2.5%
react/no-unused-prop-types                    |   356.396 |     2.1%
react/no-direct-mutation-state                |   345.526 |     2.0%
✔ Lint done...
yarn lint  50.11s user 3.10s system 145% cpu 36.662 total

Copy link
Member Author

@jtbandes jtbandes Jul 7, 2021

Choose a reason for hiding this comment

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

btw, ESLint still doesn't run rules in parallel although that is an active area of research: eslint/rfcs#42

Copy link
Contributor

Choose a reason for hiding this comment

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

sweet

@jtbandes jtbandes merged commit 47e4c12 into main Jul 7, 2021
@jtbandes jtbandes deleted the jacob/upstream-rules branch July 7, 2021 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants