endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
831 stars 72 forks source link

linting is too slow #2621

Open boneskull opened 3 weeks ago

boneskull commented 3 weeks ago

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.