Skip to content

Commit 9a22e60

Browse files
committed
perf: optimize ESLint for large monorepo
Disable expensive rules that provide limited value: - prettier/prettier (~30% savings) - Prettier runs separately via lint:misc - import-x/namespace (~22% savings) - Very expensive with limited benefit Add NODE_OPTIONS=--max-semi-space-size=256 to CI lint step as recommended by typescript-eslint for better memory management. See: https://typescript-eslint.io/troubleshooting/typed-linting/performance
1 parent 4d217ba commit 9a22e60

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/lint-build-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
is-high-risk-environment: false
4040
node-version: ${{ matrix.node-version }}
4141
- run: yarn lint
42+
env:
43+
# Optimize Node.js memory for ESLint performance in large monorepos
44+
# See: https://typescript-eslint.io/troubleshooting/typed-linting/performance
45+
NODE_OPTIONS: '--max-semi-space-size=256'
4246
- name: Require clean working directory
4347
shell: bash
4448
run: |

eslint.config.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ const config = createConfig([
2828
// Enabling it with error suppression breaks `--fix`, because the autofixer for this rule
2929
// does not work very well.
3030
'jsdoc/require-jsdoc': 'off',
31+
32+
// Performance optimizations for large monorepos
33+
// See: https://typescript-eslint.io/troubleshooting/typed-linting/performance
34+
// Prettier runs separately via `yarn lint:misc`, no need to run through ESLint (~30% savings)
35+
'prettier/prettier': 'off',
36+
// This rule is very expensive (~22% of lint time) and provides limited value
37+
'import-x/namespace': 'off',
3138
},
3239
settings: {
3340
jsdoc: {

0 commit comments

Comments
 (0)