Skip to content

Commit f2257f7

Browse files
windowsairthegecko
authored andcommitted
Add eslint rule from tslint.json
1 parent 9725622 commit f2257f7

File tree

1 file changed

+212
-0
lines changed

1 file changed

+212
-0
lines changed

.eslintrc.js

+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
module.exports = {
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended",
4+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
5+
],
6+
"parser": "@typescript-eslint/parser",
7+
"parserOptions": {
8+
"project": "tsconfig.json",
9+
"sourceType": "module"
10+
},
11+
"plugins": [
12+
"eslint-plugin-jsdoc",
13+
"@typescript-eslint",
14+
"@stylistic/js",
15+
],
16+
"root": true,
17+
"rules": {
18+
"@stylistic/js/arrow-parens": [
19+
"error",
20+
"as-needed"
21+
],
22+
"@stylistic/js/block-spacing": "error",
23+
"@stylistic/js/brace-style": [
24+
"error",
25+
"1tbs",
26+
{
27+
"allowSingleLine": true
28+
}
29+
],
30+
"@typescript-eslint/adjacent-overload-signatures": "error",
31+
"@typescript-eslint/array-type": [
32+
"error",
33+
{
34+
"default": "array"
35+
}
36+
],
37+
"@typescript-eslint/ban-types": [
38+
"error",
39+
{
40+
"types": {
41+
"Object": {
42+
"message": "Avoid using the `Object` type. Did you mean `object`?"
43+
},
44+
"Function": {
45+
"message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`."
46+
},
47+
"Boolean": {
48+
"message": "Avoid using the `Boolean` type. Did you mean `boolean`?"
49+
},
50+
"Number": {
51+
"message": "Avoid using the `Number` type. Did you mean `number`?"
52+
},
53+
"String": {
54+
"message": "Avoid using the `String` type. Did you mean `string`?"
55+
},
56+
"Symbol": {
57+
"message": "Avoid using the `Symbol` type. Did you mean `symbol`?"
58+
}
59+
}
60+
}
61+
],
62+
"@typescript-eslint/dot-notation": "error",
63+
"@typescript-eslint/explicit-function-return-type": "off",
64+
"@typescript-eslint/explicit-module-boundary-types": "off",
65+
"@typescript-eslint/member-delimiter-style": [
66+
"error",
67+
{
68+
"multiline": {
69+
"delimiter": "semi",
70+
"requireLast": true
71+
},
72+
"singleline": {
73+
"delimiter": "semi",
74+
"requireLast": false
75+
}
76+
}
77+
],
78+
"@typescript-eslint/member-ordering": [
79+
"error",
80+
{ "default": ["static-field", "instance-field", "constructor", "static-method", "instance-method"] }
81+
],
82+
"@typescript-eslint/naming-convention": [
83+
"error",
84+
{
85+
"selector": "variable",
86+
"format": [
87+
"camelCase",
88+
"UPPER_CASE"
89+
],
90+
"leadingUnderscore": "forbid",
91+
"trailingUnderscore": "forbid"
92+
}
93+
],
94+
"@typescript-eslint/no-duplicate-enum-values": "off",
95+
"@typescript-eslint/no-empty-function": "error",
96+
"@typescript-eslint/no-empty-interface": "off",
97+
"@typescript-eslint/no-explicit-any": "off",
98+
"@typescript-eslint/no-floating-promises": "error",
99+
"@typescript-eslint/no-misused-new": "error",
100+
"@typescript-eslint/no-namespace": "error",
101+
"@typescript-eslint/no-parameter-properties": "off",
102+
"@typescript-eslint/no-shadow": [
103+
"error",
104+
{
105+
"hoist": "all"
106+
}
107+
],
108+
"@typescript-eslint/no-unnecessary-type-assertion": "off",
109+
"@typescript-eslint/no-unsafe-argument": "off",
110+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
111+
"@typescript-eslint/no-unused-expressions": "error",
112+
"@typescript-eslint/no-use-before-define": "off",
113+
"@typescript-eslint/no-var-requires": "error",
114+
"@typescript-eslint/prefer-for-of": "error",
115+
"@typescript-eslint/prefer-function-type": "error",
116+
"@typescript-eslint/prefer-namespace-keyword": "error",
117+
"@typescript-eslint/quotes": [
118+
"error",
119+
"single"
120+
],
121+
"@typescript-eslint/require-await": "off",
122+
"@typescript-eslint/semi": [
123+
"error",
124+
"always"
125+
],
126+
"@typescript-eslint/triple-slash-reference": [
127+
"error",
128+
{
129+
"path": "always",
130+
"types": "prefer-import",
131+
"lib": "always"
132+
}
133+
],
134+
"@typescript-eslint/typedef": "off",
135+
"@typescript-eslint/unbound-method": "off",
136+
"@typescript-eslint/unified-signatures": "error",
137+
"camelcase": "error",
138+
"comma-dangle": ["error", "never"],
139+
"complexity": "off",
140+
"constructor-super": "error",
141+
"curly": [
142+
"error",
143+
"multi-line"
144+
],
145+
"dot-notation": "off",
146+
"eol-last": ["error", "always"],
147+
"eqeqeq": [
148+
"error",
149+
"always"
150+
],
151+
"guard-for-in": "error",
152+
"indent": [
153+
"error",
154+
4,
155+
{
156+
"SwitchCase": 1
157+
}
158+
],
159+
"id-denylist": "error",
160+
"id-match": "error",
161+
"jsdoc/check-alignment": "error",
162+
"jsdoc/check-indentation": "error",
163+
"linebreak-style": [
164+
"error",
165+
"unix"
166+
],
167+
"max-classes-per-file": "off",
168+
"max-len": "off",
169+
"new-parens": "error",
170+
"no-bitwise": "off",
171+
"no-caller": "error",
172+
"no-cond-assign": "error",
173+
"no-console": "error",
174+
"no-debugger": "error",
175+
"no-empty": "error",
176+
"no-empty-function": "off",
177+
"no-eval": "error",
178+
"no-fallthrough": "off",
179+
"no-invalid-this": "off",
180+
"no-irregular-whitespace": "error",
181+
"no-new-wrappers": "error",
182+
"no-shadow": "off",
183+
"no-throw-literal": "error",
184+
"no-trailing-spaces": "error",
185+
"no-undef-init": "error",
186+
"no-underscore-dangle": "off",
187+
"no-unsafe-finally": "error",
188+
"no-unused-expressions": "off",
189+
"no-unused-labels": "error",
190+
"no-use-before-define": "off",
191+
"no-var": "error",
192+
"object-shorthand": "off",
193+
"one-var": [
194+
"error",
195+
"never"
196+
],
197+
"prefer-const": "error",
198+
"radix": "error",
199+
"sort-keys": "off",
200+
"spaced-comment": [
201+
"error",
202+
"always",
203+
{
204+
"markers": [
205+
"/"
206+
]
207+
}
208+
],
209+
"use-isnan": "error",
210+
"valid-typeof": "off"
211+
}
212+
};

0 commit comments

Comments
 (0)