-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
69 lines (67 loc) · 2.41 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
/*
module.exports = {
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react/recommended', // 'React' is defined but never used
],
env: {
es6: true, // 'Promise' is not defined.
browser: true, // 'document' is not defined
commonjs: true, // 'require' is not defined
node: true, // 'process' is not defined
},
settings: {
'react': {
version: '16.9', // Warning: React version not specified in eslint-plugin-react settings
},
'import/resolver': {
webpack: {
env: 'development',
},
},
},
// if using ES proposals is essential:
parser: 'babel-eslint', // Unexpected token
parserOptions: {
ecmaVersion: 2018, // Parsing error: Unexpected token ...
sourceType: 'module', // Parsing error: The keyword 'import' is reserved
},
rules: {
// Added rules (fixable -> warn)
'quotes': ['warn', 'single'],
'object-curly-spacing': ['warn', 'always'],
'semi': ['warn', 'never'],
'eol-last': ['warn', 'always'],
'linebreak-style': ['warn', 'unix'],
'no-trailing-spaces': ['warn'],
'arrow-parens': ['warn', 'as-needed'],
'react/jsx-closing-bracket-location': ['warn', 'tag-aligned'],
'react/self-closing-comp': ['warn'],
'react/jsx-tag-spacing': ['warn'],
'quote-props': ['warn', 'consistent-as-needed'],
'indent': ['warn', 2],
'space-before-function-paren': ['warn', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always' }],
'comma-dangle': ['warn', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline' }],
// Added rules (non-fixable -> error)
'no-duplicate-imports': ['error'],
'no-implicit-globals': ['error'],
'no-restricted-globals': ['error',
'closed', 'frames', 'history', 'length', 'location', 'name', 'navigator', 'opener', 'parent', 'screen', 'status', 'top'],
'no-unused-vars': ['error', {
argsIgnorePattern: '^_' }],
// Disabled rules
'no-console': ['off'],
'react/prop-types': ['off'],
},
}
*/