endo icon indicating copy to clipboard operation
endo copied to clipboard

linting is too slow

Open boneskull opened this issue 1 year ago • 3 comments

The output of the lint job for my latest PR:

Run yarn lint
  yarn lint
  shell: /usr/bin/bash -e {0}
Checking formatting...
All matched files use Prettier code style!
Done in 8m 11s

This is far too slow. My suggested solution(s):

  1. For packages using typescript-eslint, do not run tsc; tseslint invokes tsc anyway and it is redundant.
  2. Do not run eslint individually for each package. Run it once, in the workspace root.
  3. One of: a. Run the prettier check once in the workspace root b. (Controversial) Omit the prettier check entirely. Use lint-staged and husky as a pre-commit hook to run prettier --write on the staged files (also eslint --fix). c. Do a., but also add the pre-commit hook.
  4. Ensure we're on the latest versions of tseslint and ESLint and follow its best practices for performant linting.
  5. If we must lint in workspaces individually (why?), then parallelize them. This might not help CI as much as it would in a dev environment.

boneskull avatar Oct 31 '24 00:10 boneskull