-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
72 lines (70 loc) · 2.2 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
/* eslint-disable import/no-unused-modules */
const { config } = require('@dhis2/cli-style')
module.exports = {
root: true,
plugins: ['react-hooks', 'i18next'],
extends: [
config.eslintReact,
'plugin:jsx-a11y/recommended',
'plugin:compat/recommended',
],
globals: {
cy: 'readonly',
},
rules: {
'compat/compat': 'warn',
'i18next/no-literal-string': [
'error',
{ markupOnly: true, onlyAttribute: ['label'] },
],
'import/export': 'error',
'import/extensions': ['error', 'never'],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-cycle': 'error',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'error',
'import/no-named-as-default-member': 'error',
'import/no-named-default': 'error',
'import/no-self-import': 'error',
'import/no-unassigned-import': ['error', { allow: ['**/*.css'] }],
'import/no-unused-modules': [
'error',
{
unusedExports: true,
missingExports: true,
},
],
'import/no-useless-path-segments': 'error',
'import/order': ['error', { 'newlines-between': 'never' }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
overrides: [
{
files: ['*.test.js', '**/__tests__/*.js'],
rules: {
'i18next/no-literal-string': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'import/no-unused-modules': 'off',
'jsx-a11y/anchor-has-content': 'off',
},
},
{
files: ['**/Temporary/**'],
rules: {
'import/extensions': 'off',
'import/no-internal-modules': 'off',
'import/no-unused-modules': 'off',
},
},
{
files: ['cypress/**/*.js'],
rules: {
'import/no-unassigned-import': 'off',
'import/no-unused-modules': 'off',
},
},
],
}