-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.eslintrc.js
110 lines (108 loc) · 3.76 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Taken from https://github.com/DataBiosphere/terra-ui/blob/6ee212abfc572d75ba6e22b788cf11730219dbff/.eslintrc.js#L4
module.exports = {
'env': {
'browser': true,
'es6': true
},
'extends': [
'eslint:recommended',
'prettier',
'plugin:react/recommended',
'google',
"plugin:jest/recommended"
],
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly',
'$': 'readonly',
'jQuery': 'readonly',
'd3': 'readonly',
'Spinner': 'readonly',
'morpheus': 'readonly',
'ga': 'readonly',
'tracks': 'readonly',
'process': 'readonly'
},
'parser': 'babel-eslint',
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'ecmaVersion': 2018,
'sourceType': 'module'
},
'plugins': [
'react',
'jsx-a11y',
'import',
"jest"
],
'rules': {
'array-bracket-newline': ['warn', 'consistent'],
'array-bracket-spacing': 'warn',
'block-spacing': 'warn',
'brace-style': ['warn', '1tbs', { 'allowSingleLine': true }],
'camelcase': 'warn',
'comma-dangle': ['error', 'never'],
'comma-spacing': 'warn',
'comma-style': 'warn',
'computed-property-spacing': 'warn',
'curly': ['warn', 'all'],
'eol-last': 'warn',
'func-call-spacing': 'warn',
// 'implicit-arrow-linebreak': 'warn',
'indent': ['warn', 2, { 'SwitchCase': 1, 'CallExpression': { 'arguments': 1 },
"ignoredNodes": ["TemplateLiteral"]
}],
'key-spacing': 'warn',
'keyword-spacing': 'warn',
'lines-between-class-members': 'warn',
'max-len': ['error', { 'code': 120 }],
'multiline-comment-style': 'off',
'no-lonely-if': 'off',
'no-multi-assign': 'warn',
'no-multiple-empty-lines': 'warn',
'no-trailing-spaces': 'warn',
'no-unneeded-ternary': 'warn',
'no-whitespace-before-property': 'warn',
'nonblock-statement-body-position': 'warn',
'object-curly-newline': ['warn', { 'multiline': true, 'consistent': true }],
'object-curly-spacing': ['warn', 'always'],
'one-var': ['warn', 'never'],
'padded-blocks': ['warn', 'never'],
'quotes': ['warn', 'single', { 'allowTemplateLiterals': true }],
'require-jsdoc': 'warn',
'semi': ['warn', 'never'],
'space-before-blocks': 'warn',
'space-before-function-paren': ['warn', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
'space-in-parens': 'warn',
'valid-jsdoc': 'off',
// ES6
'arrow-parens': ['warn', 'as-needed'],
'arrow-spacing': 'warn',
'no-duplicate-imports': 'warn',
'no-useless-rename': 'warn',
'no-var': 'warn',
'object-shorthand': 'warn',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
'prefer-template': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'rest-spread-spacing': 'warn',
'template-curly-spacing': 'off',
// React
'react/prop-types': 'off',
'react/jsx-key': 'off',
'react/jsx-curly-spacing': ['error', {'when': 'never'}],
'react/jsx-no-target-blank': 'off',
//Jest
"jest/no-disabled-tests": "warn",
// remove .only from your tests whenever you are using the exclusivity feature
// so test can be executed on build system
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
//Reminds should be used upon asserting expectations on object's length property
"jest/prefer-to-have-length": "warn",
}
};