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

More than triple linter speed #1146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

More than triple linter speed #1146

wants to merge 1 commit into from

Conversation

freeqaz
Copy link
Member

@freeqaz freeqaz commented Mar 1, 2023

This makes linting MUCH faster by doing a few things:

  • Pointing the TypeScript linter at the source files instead of generated files ("main": "src/foo.ts" instead of "main": "build/foo.js")
    • Results in a 50% improvement (28s -> 15s on my machine)
  • Remove the LunaDefend files from the linter type tree
    • Results in another ~50% improvement for me (15s -> 8s)
  • Added --cache to the call to ESLint which makes it MUCH faster on commit.

The slow part of the linting is because of the parser: '@typescript-eslint/parser' bit of the .eslintrc.js.

That relies on Typescript to generate the import graph and... yeah, it's really slow.

There is a fork we could use here: https://github.com/un-es/eslint-plugin-i/

But it was throwing an error when I tried it with one of the rules we use, and even though it was faster, this is now fast enough for me.

This makes linting MUCH faster by doing a few things:
- Pointing the TypeScript linter at the source files instead of generated files (`"main": "src/foo.ts"` instead of `"main": "build/foo.js"`)
  - Results in a 50% improvement (28s -> 15s on my machine)
- Remove the LunaDefend files from the linter type tree
  - Results in another ~50% improvement for me (15s -> 8s)
- Added `--cache` to the call to ESLint which makes it MUCH faster on commit.

The slow part of the linting is because of the `parser: '@typescript-eslint/parser'` bit of the `.eslintrc.js`.

That relies on Typescript to generate the import graph and... yeah, it's really slow.

There is a fork we could use here: https://github.com/un-es/eslint-plugin-i/

But it was throwing an error when I tried it with one of the rules we use, and even though it was faster, this is now fast enough for me.
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.

None yet

2 participants