-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
62 lines (61 loc) · 1.87 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const OFF = 0;
const WARN = 1;
const ERROR = 2;
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.lint.json'],
tsconfigRootDir: __dirname,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'airbnb-base',
'airbnb-typescript/base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:unicorn/recommended',
'plugin:security/recommended',
],
settings: {
'import/resolver': {
node: {
// add .tsx to airbnb-typescript/base
extensions: ['.js', '.jsx', '.json', '.ts', '.tsx', '.d.ts'],
},
},
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': ERROR,
'import/no-relative-packages': OFF,
'import/prefer-default-export': OFF,
'no-void': OFF,
'unicorn/filename-case': OFF,
'unicorn/no-abusive-eslint-disable': WARN,
'unicorn/no-array-callback-reference': OFF,
'unicorn/no-null': OFF,
'unicorn/prefer-add-event-listener': OFF,
'unicorn/prefer-dom-node-append': OFF,
'unicorn/prefer-module': OFF,
'unicorn/prefer-query-selector': OFF,
'unicorn/prefer-reflect-apply': OFF,
// not actually faster in v8 - https://jsben.ch/Z5MUv
'unicorn/prefer-set-has': OFF,
'unicorn/prefer-top-level-await': WARN,
'unicorn/prevent-abbreviations': OFF,
'unicorn/switch-case-braces': [ERROR, 'avoid'],
},
overrides: [
{
files: ['packages/*/test/**', '*.test.ts', '*.test.tsx'],
extends: ['plugin:jest/recommended', 'plugin:jest/style'],
rules: {
'@typescript-eslint/unbound-method': OFF, // replaced by jest/unbound-method
'import/no-extraneous-dependencies': OFF,
'jest/unbound-method': ERROR,
},
},
],
};