Skip to content

Commit

Permalink
eslint optimizations
Browse files Browse the repository at this point in the history
Analyze TS files as a single project and do not analyze intermediate models.

Linting goes from 4m 16s to 1m 49s on my laptop.  Hopefully further optimization possible.
  • Loading branch information
lauckhart committed Sep 9, 2024
1 parent 8837c71 commit a67aa1d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 2 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
"parserOptions": {
"ecmaVersion": 2018, // Allows for the parsing of modern ECMAScript features
"sourceType": "module", // Allows for the use of imports
"project": [
"packages/*/{src,test}/tsconfig.json",
"codegen/{src,test}/tsconfig.json",
"models/{src,test}/tsconfig.json",
"chip-testing/{src,test}/tsconfig.json"
]
"project": [ "./tsconfig.eslint.json" ]
},
"extends": [
"eslint:recommended",
Expand All @@ -23,7 +18,7 @@
"env": {
"node": true
},
"ignorePatterns": ["*/dist/**/*", "*/build/**/*", "packages/*/dist/**/*", "packages/*/build/**/*"],
"ignorePatterns": ["*/node_modules/**/*", "*/dist/**/*", "*/build/**/*", "packages/*/dist/**/*", "packages/*/build/**/*", "models/*/**/*"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": [
Expand Down
10 changes: 10 additions & 0 deletions tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// eslint is extremely slow and gets even slower with more packages. This optimized configuration exposes all files as
// a single project for linting purposes
{
"extends": "./packages/tools/tsconfig.base.json",
"include": [
"packages/**/*.ts",
"codegen/**/*.ts",
"chip-testing/**/*.ts",
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"files": [],
"references": [
{ "path": "packages/tools" },
{ "path": "packages/general" },
{ "path": "packages/model" },
{ "path": "packages/matter.js" },
{ "path": "packages/matter.js-react-native"},
{ "path": "packages/matter-node.js" },
{ "path": "packages/matter-node-ble.js" },
{ "path": "packages/matter-node-shell.js" },
{ "path": "packages/matter-node.js-examples" },
Expand Down

0 comments on commit a67aa1d

Please sign in to comment.