Skip to content

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.

2 participants