-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional eslint config for CLI execution (including CI) (#67689)
The default eslint config `.eslintrc.json` is used by IDEs. It does not use any computation-heavy type-checked rules. This is to ensure maximum responsiveness while writing code. In addition, there is now an additional config that extends from the default one: `.eslintrc.cli.json` has the `project` parser option enabled, and will therefore be able to use type-checked rules. It is used when running `pnpm lint-eslint`, which is also used in the CI. The immediate goal is to enable `@typescript-eslint/no-floating-promises` so that we don't need to rely on authors or reviewers catching unintentional missing `await`s for example.
- Loading branch information
1 parent
bce7736
commit af1b959
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/eslintrc", | ||
"extends": [".eslintrc.json"], | ||
"overrides": [ | ||
{ | ||
// This override adds type-checked rules. | ||
"files": ["**/*.ts", "**/*.tsx"], | ||
// Linting with type-checked rules is very slow and needs a lot of memory, | ||
// so we exclude non-essential files. | ||
"excludedFiles": ["examples/**/*", "test/**/*", "**/*.d.ts"], | ||
"parserOptions": { | ||
"project": true | ||
}, | ||
"rules": { | ||
// TODO: enable in follow-up PR | ||
"@typescript-eslint/no-floating-promises": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters