Skip to content

Commit 4a54b16

Browse files
committed
chore: update eslint more
1 parent c6d5eb9 commit 4a54b16

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.eslintrc.js

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ module.exports = {
2828
],
2929
parser: '@typescript-eslint/parser',
3030
parserOptions: {
31+
// Ensure JSDoc parsing is enabled.
32+
jsDocParsingMode: 'all',
33+
34+
// Speed up ESLint CLI runs. This is opt-out in v8.
35+
// The only known bugs are with project references, which we don't use.
36+
automaticSingleRunInference: true,
37+
3138
// A stable, but experimental, option to speed up linting.
3239
// It's also more feature complete, as it relies on the TypeScript Language Service.
3340
EXPERIMENTAL_useProjectService: true // TODO(@lishaduck) [typescript-eslint@>=8]: Rename to `projectService`.
@@ -72,7 +79,18 @@ module.exports = {
7279
'unicorn/prefer-node-protocol': 'error',
7380
'@typescript-eslint/no-var-requires': 'off',
7481
'@typescript-eslint/no-empty-function': 'off',
75-
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
82+
'@typescript-eslint/no-unused-vars': [
83+
'error',
84+
{
85+
args: 'all',
86+
argsIgnorePattern: '^_',
87+
caughtErrors: 'all',
88+
caughtErrorsIgnorePattern: '^_',
89+
destructuredArrayIgnorePattern: '^_',
90+
varsIgnorePattern: '^_',
91+
ignoreRestSiblings: true
92+
}
93+
],
7694
'@typescript-eslint/switch-exhaustiveness-check': 'error',
7795
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
7896
'default-case': 'off',
@@ -101,15 +119,27 @@ module.exports = {
101119
'unicorn/prevent-abbreviations': 'off',
102120
'unicorn/catch-error-name': ['error', {ignore: [/^err/i]}], // We use "error" for the result of `intoError` as well.
103121
'no-fallthrough': 'off', // TSESLint doesn't provide an alternative, and TS checks for this anyway.
122+
'prefer-promise-reject-errors': 'off', // TSESlint provides an alternative.
123+
124+
// typescript-eslint v8, but now:
125+
'@typescript-eslint/no-array-delete': 'error', // Recommended in v8
126+
'no-loss-of-precision': 'error', // This rule handles numeric separators now
127+
'@typescript-eslint/no-loss-of-precision': 'off', // This rule is redundant
128+
'no-unused-expressions': 'off', // This rule is replaced with the TSESlint version.
129+
'@typescript-eslint/no-unused-expressions': 'error', // Support TS stuff.
130+
'@typescript-eslint/no-throw-literal': 'error', // Recommended in v8 (w/rename to `only-throw-error`)
131+
'@typescript-eslint/prefer-namespace-keyword': 'error', // Recommended in v8
104132

133+
// Unsafe
134+
'@typescript-eslint/no-unsafe-assignment': 'off', // Blocked on typescript-eslint/typescript-eslint#1682.
105135
// TODO(@lishaduck): Once there are no more `any`s, start enforcing these rules.
106-
'@typescript-eslint/no-unsafe-assignment': 'off',
107136
'@typescript-eslint/no-unsafe-argument': 'off',
108137
'@typescript-eslint/no-unsafe-member-access': 'off',
109138

110139
// TODO(@lishaduck): Enable stricter promise rules.
111140
'@typescript-eslint/no-misused-promises': 'off',
112141
'@typescript-eslint/no-floating-promises': 'off',
142+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
113143
'promise/catch-or-return': 'off',
114144
'promise/always-return': 'off',
115145

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"useUnknownInCatchVariables": false,
1818
"noUncheckedSideEffectImports": true,
1919
"noFallthroughCasesInSwitch": true,
20-
"noUnusedParameters": true,
2120
"noUnusedLocals": true,
2221
"forceConsistentCasingInFileNames": true,
2322
"incremental": true,

0 commit comments

Comments
 (0)