@appium/eslint-config-appium-ts 0.3.3 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -10
- package/index.mjs +228 -0
- package/package.json +12 -11
- package/index.js +0 -120
package/README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
# @appium/eslint-config-appium-ts
|
|
2
2
|
|
|
3
|
-
> Provides a reusable [ESLint](http://eslint.org/) [shared configuration](http://eslint.org/docs/developer-guide/shareable-configs) for [Appium](https://github.com/appium/appium) and Appium-adjacent projects
|
|
3
|
+
> Provides a reusable [ESLint](http://eslint.org/) [shared configuration](http://eslint.org/docs/developer-guide/shareable-configs) for [Appium](https://github.com/appium/appium) and Appium-adjacent projects.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**If your package has no TypeScript sources, you don't need this.** However, if your package _does_ have TypeScript sources, you can't lint those files without this.
|
|
5
|
+
[](https://npmjs.org/package/@appium/eslint-config-appium-ts)
|
|
6
|
+
[](https://npmjs.org/package/@appium/eslint-config-appium-ts)
|
|
8
7
|
|
|
9
8
|
## Usage
|
|
10
9
|
|
|
@@ -14,12 +13,15 @@ Install the package with **`npm` v8 or newer**:
|
|
|
14
13
|
npm install @appium/eslint-config-appium-ts --save-dev
|
|
15
14
|
```
|
|
16
15
|
|
|
17
|
-
And then, in your
|
|
16
|
+
And then, in your `eslint.config.mjs` file, extend the configuration:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import appiumConfig from '@appium/eslint-config-appium-ts';
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
export default [
|
|
22
|
+
...appiumConfig,
|
|
23
|
+
// add any other config changes
|
|
24
|
+
];
|
|
23
25
|
```
|
|
24
26
|
|
|
25
27
|
## Peer Dependencies
|
|
@@ -31,7 +33,6 @@ This config requires the following packages be installed (as peer dependencies)
|
|
|
31
33
|
- [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
|
|
32
34
|
- [eslint-plugin-mocha](https://www.npmjs.com/package/eslint-plugin-mocha)
|
|
33
35
|
- [eslint-plugin-promise](https://www.npmjs.com/package/eslint-plugin-promise)
|
|
34
|
-
- [@appium/eslint-config-appium](https://www.npmjs.com/package/@appium/eslint-config-appium)
|
|
35
36
|
- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
36
37
|
- [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser)
|
|
37
38
|
|
package/index.mjs
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
|
|
4
|
+
import {includeIgnoreFile} from '@eslint/compat';
|
|
5
|
+
import js from '@eslint/js';
|
|
6
|
+
import eslintConfigPrettier from 'eslint-config-prettier';
|
|
7
|
+
import globals from 'globals';
|
|
8
|
+
import pluginPromise from 'eslint-plugin-promise';
|
|
9
|
+
import importPlugin from 'eslint-plugin-import';
|
|
10
|
+
import mochaPlugin from 'eslint-plugin-mocha';
|
|
11
|
+
import {configs as tsConfigs, parser as tsParser, plugin as tsPlugin} from 'typescript-eslint';
|
|
12
|
+
|
|
13
|
+
const gitignorePath = path.resolve(process.cwd(), '.gitignore');
|
|
14
|
+
|
|
15
|
+
export default [
|
|
16
|
+
js.configs.recommended,
|
|
17
|
+
eslintConfigPrettier,
|
|
18
|
+
pluginPromise.configs['flat/recommended'],
|
|
19
|
+
importPlugin.flatConfigs.recommended,
|
|
20
|
+
...tsConfigs.recommended,
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
name: 'Script Files',
|
|
24
|
+
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
ecmaVersion: 2022,
|
|
27
|
+
sourceType: 'module',
|
|
28
|
+
parser: tsParser,
|
|
29
|
+
globals: {
|
|
30
|
+
...globals.node,
|
|
31
|
+
NodeJS: 'readonly',
|
|
32
|
+
BufferEncoding: 'readonly',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
plugins: {
|
|
36
|
+
'@typescript-eslint': tsPlugin,
|
|
37
|
+
},
|
|
38
|
+
settings: {
|
|
39
|
+
/**
|
|
40
|
+
* This stuff enables `eslint-plugin-import` to resolve TS modules.
|
|
41
|
+
*/
|
|
42
|
+
'import/parsers': {
|
|
43
|
+
'@typescript-eslint/parser': ['.ts', '.tsx', '.mtsx'],
|
|
44
|
+
},
|
|
45
|
+
'import/resolver': {
|
|
46
|
+
typescript: {
|
|
47
|
+
project: ['tsconfig.json', './packages/*/tsconfig.json'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
rules: {
|
|
52
|
+
/**
|
|
53
|
+
* This rule is configured to warn if a `@ts-ignore` or `@ts-expect-error` directive is used
|
|
54
|
+
* without explanation.
|
|
55
|
+
* @remarks It's good practice to explain why things break!
|
|
56
|
+
*/
|
|
57
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
58
|
+
'warn',
|
|
59
|
+
{
|
|
60
|
+
'ts-expect-error': 'allow-with-description',
|
|
61
|
+
'ts-ignore': 'allow-with-description',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
/**
|
|
65
|
+
* Empty functions are allowed.
|
|
66
|
+
* @remarks This is disabled because I need someone to explain to me why empty functions are bad. I suppose they _could_ be bugs, but so could literally any line of code.
|
|
67
|
+
*/
|
|
68
|
+
'@typescript-eslint/no-empty-function': 'off',
|
|
69
|
+
/**
|
|
70
|
+
* Empty interfaces are allowed.
|
|
71
|
+
* @remarks This is because empty interfaces have a use case in declaration merging. Otherwise,
|
|
72
|
+
* an empty interface can be a type alias, e.g., `type Foo = Bar` where `Bar` is an interface.
|
|
73
|
+
*/
|
|
74
|
+
'@typescript-eslint/no-empty-interface': 'off',
|
|
75
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
76
|
+
/**
|
|
77
|
+
* Explicit `any` types are allowed.
|
|
78
|
+
* @remarks Eventually this should be a warning, and finally an error, as we fully type the codebases.
|
|
79
|
+
*/
|
|
80
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
81
|
+
/**
|
|
82
|
+
* Warns if a non-null assertion (`!`) is used.
|
|
83
|
+
* @remarks Generally, a non-null assertion should be replaced by a proper type guard or
|
|
84
|
+
* type-safe function, if possible. For example, `Set.prototype.has(x)` is not type-safe, and
|
|
85
|
+
* does not imply that `Set.prototype.get(x)` is not `undefined` (I do not know why this is, but
|
|
86
|
+
* I'm sure there's a good reason for it). In this case, a non-null assertion is appropriate.
|
|
87
|
+
* Often a simple `typeof x === 'y'` conditional is sufficient to narrow the type and avoid the
|
|
88
|
+
* non-null assertion.
|
|
89
|
+
*/
|
|
90
|
+
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
91
|
+
'@typescript-eslint/no-require-imports': 'off',
|
|
92
|
+
/**
|
|
93
|
+
* Sometimes we want unused variables to be present in base class method declarations.
|
|
94
|
+
*/
|
|
95
|
+
'@typescript-eslint/no-unused-vars': 'warn',
|
|
96
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
97
|
+
|
|
98
|
+
'import/export': 2,
|
|
99
|
+
'import/named': 'warn',
|
|
100
|
+
'import/no-duplicates': 2,
|
|
101
|
+
'import/no-unresolved': 2,
|
|
102
|
+
|
|
103
|
+
'promise/catch-or-return': 1,
|
|
104
|
+
/**
|
|
105
|
+
* Allow native `Promise`s.
|
|
106
|
+
* @remarks Originally, this was so that we could use [bluebird](https://npm.im/bluebird)
|
|
107
|
+
* everywhere, but this is not strictly necessary.
|
|
108
|
+
*/
|
|
109
|
+
'promise/no-native': 'off',
|
|
110
|
+
'promise/no-return-wrap': 1,
|
|
111
|
+
'promise/prefer-await-to-callbacks': 1,
|
|
112
|
+
'promise/prefer-await-to-then': 1,
|
|
113
|
+
'promise/param-names': 1,
|
|
114
|
+
|
|
115
|
+
'array-bracket-spacing': 2,
|
|
116
|
+
'arrow-body-style': [1, 'as-needed'],
|
|
117
|
+
'arrow-parens': [1, 'always'],
|
|
118
|
+
'arrow-spacing': 2,
|
|
119
|
+
/**
|
|
120
|
+
* Disables the `brace-style` rule.
|
|
121
|
+
* @remarks Due to the way `prettier` sometimes formats extremely verbose types, sometimes it is necessary
|
|
122
|
+
* to indent in a way that is not allowed by the default `brace-style` rule.
|
|
123
|
+
*/
|
|
124
|
+
'brace-style': 'off',
|
|
125
|
+
'comma-dangle': 0,
|
|
126
|
+
'comma-spacing': [
|
|
127
|
+
2,
|
|
128
|
+
{
|
|
129
|
+
before: false,
|
|
130
|
+
after: true,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
'curly': [2, 'all'],
|
|
134
|
+
'dot-notation': 2,
|
|
135
|
+
'eqeqeq': [2, 'smart'],
|
|
136
|
+
'key-spacing': [
|
|
137
|
+
2,
|
|
138
|
+
{
|
|
139
|
+
mode: 'strict',
|
|
140
|
+
beforeColon: false,
|
|
141
|
+
afterColon: true,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
'keyword-spacing': 2,
|
|
145
|
+
'no-buffer-constructor': 1,
|
|
146
|
+
'no-console': 2,
|
|
147
|
+
'no-dupe-class-members': 'off',
|
|
148
|
+
'no-empty': 0,
|
|
149
|
+
'no-multi-spaces': 2,
|
|
150
|
+
'no-prototype-builtins': 1,
|
|
151
|
+
'no-redeclare': 'off',
|
|
152
|
+
'no-trailing-spaces': 2,
|
|
153
|
+
'no-var': 2,
|
|
154
|
+
'no-whitespace-before-property': 2,
|
|
155
|
+
'object-shorthand': 2,
|
|
156
|
+
'quotes': [
|
|
157
|
+
2,
|
|
158
|
+
'single',
|
|
159
|
+
{
|
|
160
|
+
avoidEscape: true,
|
|
161
|
+
allowTemplateLiterals: true,
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
'radix': [2, 'always'],
|
|
165
|
+
'require-atomic-updates': 0,
|
|
166
|
+
/**
|
|
167
|
+
* Allow `async` functions without `await`.
|
|
168
|
+
* @remarks Originally, this was to be more clear about the return value of a function, but with
|
|
169
|
+
* the addition of types, this is no longer necessary. Further, both `return somePromise` and
|
|
170
|
+
* `return await somePromise` have their own use-cases.
|
|
171
|
+
*/
|
|
172
|
+
'require-await': 'off',
|
|
173
|
+
'semi': [2, 'always'],
|
|
174
|
+
'space-before-blocks': [2, 'always'],
|
|
175
|
+
'space-in-parens': [2, 'never'],
|
|
176
|
+
'space-infix-ops': 2,
|
|
177
|
+
'space-unary-ops': [
|
|
178
|
+
2,
|
|
179
|
+
{
|
|
180
|
+
words: true,
|
|
181
|
+
nonwords: false,
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
{
|
|
188
|
+
...mochaPlugin.configs.flat.recommended,
|
|
189
|
+
name: 'Test Files',
|
|
190
|
+
files: ['**/test/**', '*.spec.*js', '-specs.*js', '*.spec.ts'],
|
|
191
|
+
rules: {
|
|
192
|
+
...mochaPlugin.configs.flat.recommended.rules,
|
|
193
|
+
/**
|
|
194
|
+
* Both `@ts-expect-error` and `@ts-ignore` are allowed to be used with impunity in tests.
|
|
195
|
+
* @remarks We often test things which explicitly violate types.
|
|
196
|
+
*/
|
|
197
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
198
|
+
/**
|
|
199
|
+
* Allow non-null assertions in tests; do not even warn.
|
|
200
|
+
* @remarks The idea is that the assertions themselves will be written in such a way that if
|
|
201
|
+
* the non-null assertion was invalid, the assertion would fail.
|
|
202
|
+
*/
|
|
203
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
204
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
205
|
+
'import/no-named-as-default-member': 'off',
|
|
206
|
+
'mocha/consistent-spacing-between-blocks': 'off',
|
|
207
|
+
'mocha/max-top-level-suites': 'off',
|
|
208
|
+
'mocha/no-exclusive-tests': 2,
|
|
209
|
+
'mocha/no-exports': 'off',
|
|
210
|
+
'mocha/no-mocha-arrows': 2,
|
|
211
|
+
'mocha/no-setup-in-describe': 'off',
|
|
212
|
+
'mocha/no-skipped-tests': 'off',
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
|
|
216
|
+
{
|
|
217
|
+
name: 'Ignores',
|
|
218
|
+
ignores: [
|
|
219
|
+
...(fs.existsSync(gitignorePath) ? includeIgnoreFile(gitignorePath).ignores : []),
|
|
220
|
+
'**/.*',
|
|
221
|
+
'**/*-d.ts',
|
|
222
|
+
'**/*.min.js',
|
|
223
|
+
'**/build/**',
|
|
224
|
+
'**/coverage/**',
|
|
225
|
+
],
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appium/eslint-config-appium-ts",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.2",
|
|
4
5
|
"description": "Shared ESLint config for Appium projects (TypeScript version)",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"eslint",
|
|
@@ -20,23 +21,23 @@
|
|
|
20
21
|
},
|
|
21
22
|
"license": "Apache-2.0",
|
|
22
23
|
"author": "https://github.com/appium",
|
|
23
|
-
"
|
|
24
|
+
"exports": "./index.mjs",
|
|
24
25
|
"files": [
|
|
25
|
-
"index.
|
|
26
|
+
"index.mjs"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
29
|
"test:smoke": "exit 0"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@
|
|
33
|
-
"
|
|
34
|
-
"eslint": "^8.56.0",
|
|
32
|
+
"@eslint/compat": "^1.1.0",
|
|
33
|
+
"@eslint/js": "^9.0.0",
|
|
34
|
+
"eslint": "^9.0.0",
|
|
35
35
|
"eslint-config-prettier": "^9.0.0",
|
|
36
36
|
"eslint-import-resolver-typescript": "^3.5.0",
|
|
37
|
-
"eslint-plugin-import": "^2.
|
|
38
|
-
"eslint-plugin-mocha": "^10.
|
|
39
|
-
"eslint-plugin-promise": "^
|
|
37
|
+
"eslint-plugin-import": "^2.30.0",
|
|
38
|
+
"eslint-plugin-mocha": "^10.4.0",
|
|
39
|
+
"eslint-plugin-promise": "^7.0.0",
|
|
40
|
+
"typescript-eslint": "^8.0.0"
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
43
|
"node": "^14.17.0 || ^16.13.0 || >=18.0.0",
|
|
@@ -45,5 +46,5 @@
|
|
|
45
46
|
"publishConfig": {
|
|
46
47
|
"access": "public"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "a7ce83e169e101ae497bab11204a73703fd54e99"
|
|
49
50
|
}
|
package/index.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@appium/eslint-config-appium-ts` is a configuration for ESLint which extends
|
|
3
|
-
* `@appium/eslint-config-appium` and adds TypeScript support.
|
|
4
|
-
*
|
|
5
|
-
* It is **not** a _replacement for_ `@appium/eslint-config-appium`.
|
|
6
|
-
*
|
|
7
|
-
* It can be used _without any `.ts` sources_, as long as a `tsconfig.json` exists in the project
|
|
8
|
-
* root. In that case, it will run on `.js` files which are enabled for checking; this includes the
|
|
9
|
-
* `checkJs` setting and any `// @ts-check` directive in source files.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
$schema: 'http://json.schemastore.org/eslintrc',
|
|
14
|
-
parser: '@typescript-eslint/parser',
|
|
15
|
-
extends: ['@appium/eslint-config-appium', 'plugin:@typescript-eslint/recommended'],
|
|
16
|
-
rules: {
|
|
17
|
-
/**
|
|
18
|
-
* This rule is configured to warn if a `@ts-ignore` or `@ts-expect-error` directive is used
|
|
19
|
-
* without explanation.
|
|
20
|
-
* @remarks It's good practice to explain why things break!
|
|
21
|
-
*/
|
|
22
|
-
'@typescript-eslint/ban-ts-comment': [
|
|
23
|
-
'warn',
|
|
24
|
-
{
|
|
25
|
-
'ts-expect-error': 'allow-with-description',
|
|
26
|
-
'ts-ignore': 'allow-with-description',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
/**
|
|
30
|
-
* Empty functions are allowed.
|
|
31
|
-
* @remarks This is disabled because I need someone to explain to me why empty functions are bad. I suppose they _could_ be bugs, but so could literally any line of code.
|
|
32
|
-
*/
|
|
33
|
-
'@typescript-eslint/no-empty-function': 'off',
|
|
34
|
-
/**
|
|
35
|
-
* Empty interfaces are allowed.
|
|
36
|
-
* @remarks This is because empty interfaces have a use case in declaration merging. Otherwise,
|
|
37
|
-
* an empty interface can be a type alias, e.g., `type Foo = Bar` where `Bar` is an interface.
|
|
38
|
-
*/
|
|
39
|
-
'@typescript-eslint/no-empty-interface': 'off',
|
|
40
|
-
/**
|
|
41
|
-
* Explicit `any` types are allowed.
|
|
42
|
-
* @remarks Eventually this should be a warning, and finally an error, as we fully type the codebases.
|
|
43
|
-
*/
|
|
44
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
45
|
-
/**
|
|
46
|
-
* Warns if a non-null assertion (`!`) is used.
|
|
47
|
-
* @remarks Generally, a non-null assertion should be replaced by a proper type guard or
|
|
48
|
-
* type-safe function, if possible. For example, `Set.prototype.has(x)` is not type-safe, and
|
|
49
|
-
* does not imply that `Set.prototype.get(x)` is not `undefined` (I do not know why this is, but
|
|
50
|
-
* I'm sure there's a good reason for it). In this case, a non-null assertion is appropriate.
|
|
51
|
-
* Often a simple `typeof x === 'y'` conditional is sufficient to narrow the type and avoid the
|
|
52
|
-
* non-null assertion.
|
|
53
|
-
*/
|
|
54
|
-
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
55
|
-
/**
|
|
56
|
-
* This disallows use of `require()`.
|
|
57
|
-
* @remarks We _do_ use `require()` fairly often to load files on-the-fly; however, these may
|
|
58
|
-
* want to be replaced with `import()` (I am not sure if there's a rule about that?). **If this check fails**, disable the rule for the particular line.
|
|
59
|
-
*/
|
|
60
|
-
'@typescript-eslint/no-var-requires': 'error',
|
|
61
|
-
/**
|
|
62
|
-
* Sometimes we want unused variables to be present in base class method declarations.
|
|
63
|
-
*/
|
|
64
|
-
'@typescript-eslint/no-unused-vars': 'warn',
|
|
65
|
-
/**
|
|
66
|
-
* Allow native `Promise`s. **This overrides `@appium/eslint-config-appium`.**
|
|
67
|
-
* @remarks Originally, this was so that we could use [bluebird](https://npm.im/bluebird)
|
|
68
|
-
* everywhere, but this is not strictly necessary.
|
|
69
|
-
*/
|
|
70
|
-
'promise/no-native': 'off',
|
|
71
|
-
/**
|
|
72
|
-
* Allow `async` functions without `await`. **This overrides `@appium/eslint-config-appium`.**
|
|
73
|
-
* @remarks Originally, this was to be more clear about the return value of a function, but with
|
|
74
|
-
* the addition of types, this is no longer necessary. Further, both `return somePromise` and
|
|
75
|
-
* `return await somePromise` have their own use-cases.
|
|
76
|
-
*/
|
|
77
|
-
'require-await': 'off',
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Disables the `brace-style` rule.
|
|
81
|
-
* @remarks Due to the way `prettier` sometimes formats extremely verbose types, sometimes it is necessary
|
|
82
|
-
* to indent in a way that is not allowed by the default `brace-style` rule.
|
|
83
|
-
*/
|
|
84
|
-
'brace-style': 'off',
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* This stuff enables `eslint-plugin-import` to resolve TS modules.
|
|
88
|
-
*/
|
|
89
|
-
settings: {
|
|
90
|
-
'import/parsers': {
|
|
91
|
-
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
|
92
|
-
},
|
|
93
|
-
'import/resolver': {
|
|
94
|
-
typescript: {
|
|
95
|
-
project: ['tsconfig.json', './packages/*/tsconfig.json'],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
overrides: [
|
|
100
|
-
/**
|
|
101
|
-
* Overrides for tests.
|
|
102
|
-
*/
|
|
103
|
-
{
|
|
104
|
-
files: ['**/test/**', '*.spec.js', '-specs.js', '*.spec.ts'],
|
|
105
|
-
rules: {
|
|
106
|
-
/**
|
|
107
|
-
* Both `@ts-expect-error` and `@ts-ignore` are allowed to be used with impunity in tests.
|
|
108
|
-
* @remarks We often test things which explicitly violate types.
|
|
109
|
-
*/
|
|
110
|
-
'@typescript-eslint/ban-ts-comment': 'off',
|
|
111
|
-
/**
|
|
112
|
-
* Allow non-null assertions in tests; do not even warn.
|
|
113
|
-
* @remarks The idea is that the assertions themselves will be written in such a way that if
|
|
114
|
-
* the non-null assertion was invalid, the assertion would fail.
|
|
115
|
-
*/
|
|
116
|
-
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
};
|