-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstylistic.js
157 lines (154 loc) · 7.74 KB
/
stylistic.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
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
154
155
156
157
import stylistic from "@stylistic/eslint-plugin";
import ignores from "./ignores.js";
/** @type {import("eslint").Linter.Config[]} */
export default [
{
name: "hzmi/stylistic",
ignores: ignores[0].ignores,
plugins: {
stylistic
},
rules: {
// Disable legacy rules
...stylistic.configs["disable-legacy"].rules,
// Stylistic rules
"stylistic/array-bracket-newline": ["warn", "consistent"],
"stylistic/array-bracket-spacing": ["warn", "never", { singleValue: false, objectsInArrays: false, arraysInArrays: false }],
"stylistic/array-element-newline": ["warn", "consistent", { multiline: true, minItems: 6 }],
"stylistic/arrow-parens": ["warn", "as-needed", { requireForBlockBody: false }],
"stylistic/arrow-spacing": ["warn", { before: true, after: true }],
"stylistic/block-spacing": ["warn", "always"],
"stylistic/brace-style": ["warn", "1tbs", { allowSingleLine: true }],
"stylistic/comma-dangle": ["warn", "never"],
"stylistic/comma-spacing": ["warn", { before: false, after: true }],
"stylistic/comma-style": ["warn", "last"],
"stylistic/computed-property-spacing": ["warn", "never"],
"stylistic/curly-newline": ["warn", { multiline: true, minElements: 3, consistent: true }],
"stylistic/dot-location": ["warn", "property"],
"stylistic/eol-last": ["warn", "always"],
"stylistic/function-call-argument-newline": ["warn", "consistent"],
"stylistic/function-call-spacing": ["warn", "never"],
"stylistic/function-paren-newline": ["warn", "consistent"],
"stylistic/generator-star-spacing": ["warn", "both"],
"stylistic/implicit-arrow-linebreak": ["warn", "beside"],
"stylistic/indent": ["error", 4, { SwitchCase: 1 }],
"stylistic/indent-binary-ops": ["error", 4],
"stylistic/key-spacing": ["warn", { beforeColon: false, afterColon: true, mode: "strict" }],
"stylistic/keyword-spacing": ["warn", { before: true, after: true }],
"stylistic/linebreak-style": ["error", "unix"],
"stylistic/lines-between-class-members": ["warn", "always", { exceptAfterSingleLine: true }],
"stylistic/max-len": [
"warn",
{
code: 180,
tabWidth: 4,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true
}
],
"stylistic/max-statements-per-line": ["warn", { max: 3 }],
"stylistic/member-delimiter-style": [
"warn",
{
multiline: {
requireLast: true
},
singleline: {
requireLast: true
}
}
],
"stylistic/multiline-ternary": ["warn", "always-multiline"],
"stylistic/new-parens": "warn",
"stylistic/newline-per-chained-call": ["warn", { ignoreChainWithDepth: 3 }],
"stylistic/no-confusing-arrow": ["warn", { onlyOneSimpleParam: true }],
"stylistic/no-extra-parens": [
"warn",
"all",
{
nestedBinaryExpressions: false,
enforceForArrowConditionals: false,
enforceForNewInMemberExpressions: false
}
],
"stylistic/no-extra-semi": "warn",
"stylistic/no-floating-decimal": "error",
"stylistic/no-mixed-operators": "error",
"stylistic/no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
"stylistic/no-multi-spaces": ["error", { ignoreEOLComments: true }],
"stylistic/no-multiple-empty-lines": ["warn", { max: 1, maxEOF: 1, maxBOF: 0 }],
"stylistic/no-trailing-spaces": "warn",
"stylistic/no-whitespace-before-property": "error",
"stylistic/nonblock-statement-body-position": ["warn", "beside"],
"stylistic/object-curly-newline": ["warn", { multiline: true, consistent: true }],
"stylistic/object-curly-spacing": ["error", "always"],
"stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
"stylistic/operator-linebreak": ["warn", "after", {
overrides: {
"?": "before",
":": "before"
}
}],
"stylistic/padded-blocks": ["warn", "never"],
"stylistic/padding-line-between-statements": "warn",
"stylistic/quote-props": ["warn", "as-needed"],
"stylistic/quotes": ["warn", "double", { avoidEscape: true, allowTemplateLiterals: false }],
"stylistic/rest-spread-spacing": ["error", "never"],
"stylistic/semi": ["error", "always", { omitLastInOneLineBlock: false }],
"stylistic/semi-spacing": ["error", { before: false, after: true }],
"stylistic/semi-style": ["error", "last"],
"stylistic/space-before-blocks": ["warn", "always"],
"stylistic/space-before-function-paren": ["warn", { anonymous: "always", named: "never", asyncArrow: "always" }],
"stylistic/space-in-parens": ["warn", "never"],
"stylistic/space-infix-ops": ["warn", { int32Hint: true }],
"stylistic/space-unary-ops": ["warn", { words: true, nonwords: false }],
"stylistic/spaced-comment": ["warn", "always"],
"stylistic/switch-colon-spacing": ["error", { after: true, before: false }],
"stylistic/template-curly-spacing": ["warn", "never"],
"stylistic/template-tag-spacing": ["warn", "never"],
"stylistic/type-annotation-spacing": [
"warn",
{
before: false,
after: true,
overrides:
{
arrow: {
before: true,
after: true
}
}
}
],
"stylistic/type-generic-spacing": "warn",
"stylistic/type-named-tuple-spacing": "warn",
"stylistic/wrap-iife": ["warn", "inside"],
"stylistic/wrap-regex": "warn",
"stylistic/yield-star-spacing": ["warn", "both"],
// JSX
"stylistic/jsx-child-element-spacing": "warn",
"stylistic/jsx-closing-bracket-location": "warn",
"stylistic/jsx-closing-tag-location": "warn",
"stylistic/jsx-curly-brace-presence": "warn",
"stylistic/jsx-curly-newline": ["warn", "consistent"],
"stylistic/jsx-curly-spacing": ["warn", "never"],
"stylistic/jsx-equals-spacing": ["warn", "never"],
"stylistic/jsx-first-prop-new-line": "warn",
"stylistic/jsx-function-call-newline": "warn",
"stylistic/jsx-indent": ["error", 4],
"stylistic/jsx-indent-props": ["error", 4],
"stylistic/jsx-max-props-per-line": "warn",
"stylistic/jsx-newline": "warn",
"stylistic/jsx-one-expression-per-line": "warn",
"stylistic/jsx-props-no-multi-spaces": "warn",
"stylistic/jsx-pascal-case": "warn",
"stylistic/jsx-quotes": ["warn", "prefer-double"],
"stylistic/jsx-self-closing-comp": "warn",
"stylistic/jsx-sort-props": "warn",
"stylistic/jsx-tag-spacing": "warn",
"stylistic/jsx-wrap-multilines": "warn"
}
}
];