-
Notifications
You must be signed in to change notification settings - Fork 15
/
.eslintrc.js
62 lines (56 loc) · 1.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
const cliStyle = require('@dhis2/cli-style')
const config = {
extends: [cliStyle.config.eslintReact],
globals: {
cy: 'readonly',
Cypress: 'readonly',
},
rules: {
'import/no-webpack-loader-syntax': 'error',
'import/no-useless-path-segments': 'error',
'react/no-unknown-property': ['error', { ignore: ['jsx', 'global'] }],
},
overrides: [
{
files: ['*.stories.js', '*.stories.e2e.js', '**/__stories__/*.js'],
rules: {
'import/no-extraneous-dependencies': 'off',
'react/display-name': 'off',
'react/prop-types': 'off',
},
},
{
files: [
'components/*/src/**/*.js',
'collections/*/src/**/*.js',
'utilities/*/src/**/*.js',
],
excludedFiles: [
'**/features/**/*.js',
'**/__tests__/**/*.js',
'*.test.js',
'*.stories*.js',
'**/__stories__/*.js',
'**/__stories__/**/*.js',
'*.d.ts',
],
rules: {
'import/no-extraneous-dependencies': 'error',
},
},
],
}
// Run cpu intensive checks only on CI
const isCI = !!process.env.CI
if (isCI) {
if (!config.rules) {
config.rules = {}
}
config.rules['import/no-cycle'] = 'error'
config.rules['import/no-self-import'] = 'error'
// for newer versions of import plugin
//config.rules['import/no-internal-modules'] = 'error'
//config.rules['import/no-relative-parent-imports'] = 'error'
//config.rules['import/no-relative-packages'] = 'error'
}
module.exports = config