-
Notifications
You must be signed in to change notification settings - Fork 43
/
.eslintrc.js
89 lines (88 loc) · 2.73 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
80
81
82
83
84
85
86
87
88
89
const a11yLabelRequiredOptions = {
required: {
some: ['nesting', 'id'],
},
};
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended',
'plugin:gatsby/recommended',
'prettier',
'plugin:prettier/recommended',
],
globals: {
adyen: true,
analytics: true,
bootbox: true,
isTestingEnvironment: true,
laravelRegister: true,
PSPDFKit: true,
snackbar: true,
},
ignorePatterns: ['.eslintrc.js'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'unused-imports', 'import'],
rules: {
'gatsby/use-gatsby-link': 'warn',
'import/no-unresolved': [
2,
],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/label-has-associated-control': ['error', a11yLabelRequiredOptions],
'jsx-a11y/label-has-for': ['error', a11yLabelRequiredOptions],
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/tabindex-no-positive': 'warn',
'no-console': 'off',
'no-debugger': 'warn',
'react/display-name': 'off',
'react/jsx-no-target-blank': 'warn',
'react/jsx-no-useless-fragment': 'warn',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'warn',
'sonarjs/cognitive-complexity': 'warn',
'sonarjs/max-switch-cases': 'warn',
'sonarjs/no-collapsible-if': 'warn',
'sonarjs/no-duplicated-branches': 'warn',
'sonarjs/no-duplicate-string': 'warn',
'sonarjs/no-gratuitous-expressions': 'warn',
'sonarjs/no-identical-functions': 'warn',
'sonarjs/no-nested-template-literals': 'off',
'sonarjs/no-small-switch': 'warn',
'no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'react-hooks/exhaustive-deps': ['warn'],
'unused-imports/no-unused-vars': [
'warn',
{ vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' },
],
},
settings: {
react: {
version: require('react/package.json').version,
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
},
},
},
overrides: [],
};