-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
43 lines (41 loc) · 941 Bytes
/
.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
const pkg = require('./package.json');
const reactVersion = () => {
if (pkg.dependencies && pkg.dependencies.react) {
return { version: pkg.dependencies.react.replace(/[^0-9.]/g, '') };
}
if (pkg.devDependencies && pkg.devDependencies.react) {
return { version: pkg.devDependencies.react.replace(/[^0-9.]/g, '') };
}
};
module.exports = {
parser: 'babel-eslint',
plugins: ['react', 'jest', 'prettier', 'import'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:jest/recommended',
'plugin:import/recommended',
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': 'error',
'import/order': 'error',
'no-console': 'off',
},
env: {
jest: true,
browser: true,
node: true,
es6: true,
},
globals: {
document: true,
window: true,
localStorage: true,
},
settings: {
react: {
...reactVersion(),
},
},
};