-
Notifications
You must be signed in to change notification settings - Fork 21
/
.eslintrc.cjs
44 lines (43 loc) · 1.23 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* eslint-env node */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/stylistic-type-checked',
'prettier',
],
overrides: [
// TypeScript
{
files: ['**/*.ts'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
rules: {
// Only disabling this because this code is very old but also battle-tested,
// and coming up with clever typings may break for consumers.
'@typescript-eslint/no-explicit-any': 'off',
// We use `require` for loading the `package.json` file.
'@typescript-eslint/no-var-requires': [
'error',
{ allow: ['/package\\.json$'] },
],
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
},
},
// Tests
{
files: ['**/__tests__/*.test.ts'],
rules: {
// Unused vars are used for dependency resolution.
'@typescript-eslint/no-unused-vars': 'off',
// Some types are useful for testing.
'@typescript-eslint/ban-types': 'off',
},
},
],
}