-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
67 lines (58 loc) · 1.49 KB
/
javascript.js
File metadata and controls
67 lines (58 loc) · 1.49 KB
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
// This is the ESlint config for Javascript only projects
const WARN = 'warn'
const ERROR = 'error'
const NEVER = 'never'
const ALWAYS = 'always'
const ALWAYS_MULTILINE = 'always-multiline'
const OFF = 'off'
const config = {
extends: [
'eslint:recommended'
],
env: {
es2022: true
},
rules: {
semi: [WARN, NEVER],
'jsx-quotes': [WARN, 'prefer-single'],
quotes: [WARN, 'single'],
'max-len': [
WARN, 100, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreTemplateLiterals: true,
ignoreStrings: true
}
],
indent: [WARN, 2, { SwitchCase: 1, flatTernaryExpressions: true }],
// Empty blocks
'no-empty-function': OFF,
// Spaces
'func-call-spacing': [WARN, NEVER],
'no-multi-spaces': WARN,
'arrow-spacing': WARN,
'comma-spacing': WARN,
'key-spacing': WARN,
'object-curly-spacing': [WARN, ALWAYS],
'no-trailing-spaces': WARN,
'block-spacing': WARN,
// Smells
'no-param-reassign': ERROR,
'no-eval': ERROR,
'no-extend-native': ERROR,
'no-duplicate-imports': ERROR,
'no-new-wrappers': ERROR,
'no-underscore-dangle': ERROR,
'no-var': ERROR,
'no-unreachable': ERROR,
'no-fallthrough': ERROR,
'one-var': [ERROR, NEVER],
'no-whitespace-before-property': ERROR,
// Trailing commas
'comma-dangle': [WARN, ALWAYS_MULTILINE],
// Rules unneeded by us
'no-prototype-builtins': OFF
}
}
module.exports = config