forked from ysyx-org/jemu-decoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
153 lines (153 loc) · 6.75 KB
/
.eslintrc.cjs
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
const [NEVER, WARN, ERROR] = Array(3).keys()
const config = {
env: {
node: true,
es2021: true
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
/* ----------------------- Coding practices ------------------------ */
'capitalized-comments': [NEVER],
'dot-notation': [WARN],
'no-cond-assign': [NEVER],
'no-control-regex': [NEVER],
'no-extra-bind': [WARN],
'no-unused-vars': [NEVER, { 'vars': 'all', 'args': 'after-used' }],
'object-shorthand': [WARN],
'prefer-const': [NEVER],
'prefer-destructuring': [WARN],
'prefer-template': [WARN],
'spaced-comment': [WARN],
'yoda': [WARN],
/* ---------------------------- Formats ---------------------------- */
// 🔧 enforce line_breaks after opening and before closing array brackets
'array-bracket-newline': [WARN],
// 🔧 enforce consistent spacing inside array brackets
'array-bracket-spacing': [WARN],
// 🔧 enforce line breaks after each array element
'array-element-newline': [WARN, 'consistent'],
// 🔧 require parentheses around arrow function arguments
'arrow-parens': [WARN, 'as-needed'],
// 🔧 enforce consistent spacing before and after the arrow in arrow functions
'arrow-spacing': [WARN],
// 🔧 disallow or enforce spaces inside of blocks after opening block and before closing block
'block-spacing': [WARN],
// 🔧 enforce consistent brace style for blocks
'brace-style': [WARN, '1tbs', { allowSingleLine: true }],
// 🔧 require or disallow trailing commas
'comma-dangle': [NEVER],
// 🔧 enforce consistent spacing before and after commas
'comma-spacing': [WARN],
// 🔧 enforce consistent comma style
'comma-style': [WARN],
// 🔧 enforce consistent spacing inside computed property brackets
'computed-property-spacing': [WARN],
// 🔧 enforce consistent newlines before and after dots
'dot-location': [WARN, 'property'],
// 🔧 require or disallow newline at the end of files
'eol-last': [WARN],
// 🔧 require or disallow spacing between function identifiers and their invocations
'func-call-spacing': [WARN, 'never'],
// 🔧 enforce line breaks between arguments of a function call
'function-call-argument-newline': [NEVER],
// 🔧 enforce consistent line breaks inside function parentheses
'function-paren-newline': [NEVER],
// 🔧 enforce consistent spacing around `*` operators in generator functions
'generator-star-spacing': [NEVER],
// 🔧 enforce the location of arrow function bodies
'implicit-arrow-linebreak': [NEVER],
// 🔧 enforce consistent indentation
'indent': [WARN, 'tab', { SwitchCase: 1 }],
// 🔧 enforce the consistent use of either double or single quotes in JSX attributes
'jsx-quotes': [NEVER],
// 🔧 enforce consistent spacing between keys and values in object literal properties
'key-spacing': [WARN],
// 🔧 enforce consistent spacing before and after keywords
'keyword-spacing': [WARN],
// - enforce position of line comments
'line-comment-position': [NEVER],
// 🔧 enforce consistent linebreak style
'linebreak-style': [ERROR, 'unix'],
// 🔧 require empty lines around comments
'lines-around-comment': [NEVER],
// 🔧 require or disallow an empty line between class members
'lines-between-class-members': [NEVER],
// - enforce a maximum line length
'max-len': [NEVER],
// - enforce a maximum number of statements allowed per line
'max-statements-per-line': [NEVER],
// 🔧 enforce newlines between operands of ternary expressions
'multiline-ternary': [NEVER],
// 🔧 enforce or disallow parentheses when invoking a constructor with no arguments
'new-parens': [WARN, 'never'],
// 🔧 require a newline after each call in a method chain
'newline-per-chained-call': [NEVER],
// 🔧 disallow unnecessary parentheses
'no-extra-parens': [WARN],
// 🔧 disallow multiple spaces
'no-multi-spaces': [WARN],
// 🔧 disallow multiple empty lines
'no-multiple-empty-lines': [WARN],
// - disallow all tabs
'no-tabs': [NEVER],
// 🔧 disallow trailing whitespace at the end of lines
'no-trailing-spaces': [WARN],
// 🔧 disallow whitespace before properties
'no-whitespace-before-property': [WARN],
// 🔧 enforce the location of single_line statements
'nonblock-statement-body-position': [WARN],
// 🔧 enforce consistent line breaks after opening and before closing braces
'object-curly-newline': [WARN, { 'multiline': true, 'consistent': true }],
// 🔧 enforce consistent spacing inside braces
'object-curly-spacing': [WARN, 'always'],
// 🔧 enforce placing object properties on separate lines
'object-property-newline': [WARN, { allowAllPropertiesOnSameLine: true }],
// 🔧 enforce consistent linebreak style for operators
'operator-linebreak': [WARN, 'before'],
// 🔧 require or disallow padding within blocks
'padded-blocks': [NEVER],
// 🔧 require or disallow padding lines between statements
'padding-line-between-statements': [NEVER],
// 🔧 enforce the consistent use of either backticks, double, or single quotes
'quotes': [WARN, 'single'],
// 🔧 enforce spacing between rest and spread operators and their expressions
'rest-spread-spacing': [WARN],
// 🔧 require or disallow semicolons instead of ASI
'semi': [WARN, 'never'],
// 🔧 enforce consistent spacing before and after semicolons
'semi-spacing': [NEVER],
// 🔧 enforce location of semicolons
'semi-style': [NEVER],
// 🔧 enforce consistent spacing before blocks
'space-before-blocks': [NEVER],
// 🔧 enforce consistent spacing before `function` definition opening parenthesis
'space-before-function-paren': [WARN, { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
// 🔧 enforce consistent spacing inside parentheses
'space-in-parens': [WARN],
// 🔧 require spacing around infix operators
'space-infix-ops': [WARN],
// 🔧 enforce consistent spacing before or after unary operators
'space-unary-ops': [WARN],
// 🔧 enforce spacing around colons of switch statements
'switch-colon-spacing': [WARN],
// 🔧 require or disallow spacing around embedded expressions of template strings
'template-curly-spacing': [WARN],
// 🔧 require or disallow spacing between template tags and their literals
'template-tag-spacing': [WARN],
// 🔧 require or disallow Unicode byte order mark (BOM)
'unicode-bom': [NEVER],
// 🔧 require parentheses around immediate `function` invocations
'wrap-iife': [WARN, 'inside'],
// 🔧 require parenthesis around regex literals
'wrap-regex': [NEVER],
// 🔧 require or disallow spacing around the `*` in `yield*` expressions
'yield-star-spacing': [WARN],
'vue/no-multiple-template-root': [NEVER]
}
}
// Export the config
module.exports = config