-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
58 lines (53 loc) · 1.18 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
'use strict';
const config = {
'env': {
'browser': true,
'es6': true,
'mocha': true,
'node': true
},
'parserOptions': {
'ecmaVersion': 2020,
'sourceType': 'module'
},
'rules': {
'eqeqeq': 2,
'guard-for-in': 2,
'new-cap': 0,
'no-caller': 2,
'no-console': 2,
'no-extend-native': 2,
'no-irregular-whitespace': 0,
'no-loop-func': 2,
'no-multi-spaces': 0,
'no-undef': 2,
'no-underscore-dangle': 0,
'no-unused-vars': 2,
'no-var': 2,
'one-var': [2, 'never'],
'quotes': [2, 'single'],
'space-before-function-paren': [0, 'never'],
'wrap-iife': 2
},
'globals': {
'fetch': true,
'requireText': true
},
'plugins': [],
'extends': []
};
const packageJson = require('./package.json');
if (
(packageJson.dependencies && (packageJson.dependencies.react || packageJson.dependencies.preact)) ||
(packageJson.devDependencies && (packageJson.devDependencies.react || packageJson.devDependencies.preact))
) {
config.plugins.push('react');
config.extends.push('plugin:react/recommended');
Object.assign(config.rules, {
'react/display-name': 0,
'react/prop-types': 0,
'react/no-danger': 0,
'react/no-render-return-value': 0
});
}
module.exports = config;