-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
79 lines (76 loc) · 2.02 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
71
72
73
74
75
76
77
78
79
module.exports = {
extends: [
'@guardian/eslint-config-typescript',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'prettier',
'plugin:jsx-a11y/recommended',
'plugin:functional/no-mutations',
'plugin:react-hooks/recommended',
'plugin:storybook/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
project: [
'./tsconfig.json',
'./cypress/tsconfig.json',
'./scripts/okta/tsconfig.json',
],
},
plugins: ['functional'],
rules: {
// React Rules
'react/prop-types': 0,
'react/no-unknown-property': ['error', { ignore: ['css'] }],
// Functional rules
'functional/immutable-data': [
'error',
{
ignoreImmediateMutation: true,
},
],
'functional/prefer-immutable-types': 0,
'functional/type-declaration-immutability': 0,
// eslint rules
'no-var': 'error',
'no-param-reassign': 'error',
'no-sequences': 'error',
'no-console': 'error',
'prefer-const': 'error',
// disabled @guardian/eslint-config-typescript rules
'import/order': 0, // 1045
'@typescript-eslint/consistent-type-imports': 0, // 446
'@typescript-eslint/no-unsafe-assignment': 0, // 148
'eslint-comments/require-description': 0, // 112
'import/no-default-export': 0, // 104
'@typescript-eslint/no-unnecessary-condition': 0, // 89
'sort-imports': 0, // 85
'@typescript-eslint/naming-convention': 0, // 84
'@typescript-eslint/no-unsafe-member-access': 0, // 84
'@typescript-eslint/no-unsafe-argument': 0, // 54
'@typescript-eslint/prefer-nullish-coalescing': 0, // 46
'@typescript-eslint/no-unsafe-call': 0, // 45
'@typescript-eslint/no-unsafe-return': 0, // 26
'import/no-named-as-default': 0, // 25
'@typescript-eslint/no-unsafe-enum-comparison': 0, // 23
'import/no-named-as-default-member': 0, // 19
'import/no-cycle': 0, // 7
},
overrides: [
{
files: ['*.stories.tsx'],
rules: {
'functional/immutable-data': 0,
},
},
],
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['cdk/'],
};