-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.js
70 lines (70 loc) · 2.08 KB
/
.eslintrc.js
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
63
64
65
66
67
68
69
70
module.exports = {
parserOptions: {
ecmaVersion: 2020,
},
extends: [
'@guardian/eslint-config-typescript',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:jest/recommended',
],
plugins: ['react', 'jest'],
settings: {
react: {
version: 'detect',
},
},
overrides: [
{
files: ['client/__tests__/**'],
rules: {
'@typescript-eslint/ban-ts-comment': ['off'],
},
},
{
files: ['client/**/*.stories.tsx'],
rules: {
'import/no-default-export': 'off',
},
},
],
rules: {
// Overrides for rules from `@guardian/eslint-config-typescript`.
// There are a number of these due to applying the config to an existing
// codebase. We should progressively fix these and remove the overrides.
'@typescript-eslint/no-floating-promises': ['off'],
'@typescript-eslint/no-misused-promises': ['off'],
'@typescript-eslint/no-unnecessary-condition': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/prefer-nullish-coalescing': ['off'],
'@typescript-eslint/prefer-optional-chain': ['off'],
'@typescript-eslint/prefer-reduce-type-parameter': ['off'],
'@typescript-eslint/require-await': ['off'],
'@typescript-eslint/restrict-template-expressions': ['off'],
'import/no-cycle': ['off'],
// Overrides carried over from old ESLint config.
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': 'allow-with-description',
minimumDescriptionLength: 10,
},
],
'@typescript-eslint/ban-types': ['off'],
'@typescript-eslint/no-inferrable-types': ['off'],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '_' },
],
'no-prototype-builtins': ['off'],
'react/display-name': ['off'],
'react/no-unescaped-entities': ['off'],
},
};