Skip to content

Commit a588e9a

Browse files
authored
eslint config upgrade (#1224)
* eslint config upgrade * update package.json * eslint upgrade and fixes where possible * prettier
1 parent b59818b commit a588e9a

File tree

15 files changed

+517
-1040
lines changed

15 files changed

+517
-1040
lines changed

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 193 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import typescriptParser from "@typescript-eslint/parser";
6+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
7+
8+
9+
export default tseslint.config(
10+
{
11+
files: ["src/**/*.ts"],
12+
ignores: ['node_modules/**'],
13+
plugins: {
14+
"@typescript-eslint": typescriptEslint,
15+
},
16+
languageOptions: {
17+
parser: typescriptParser,
18+
parserOptions: {
19+
project: ['./tsconfig.eslint.json'],
20+
sourceType: 'module',
21+
tsconfigRootDir: import.meta.dirname,
22+
},
23+
},
24+
rules: {
25+
26+
"@typescript-eslint/adjacent-overload-signatures": "error",
27+
"@typescript-eslint/array-type": "off",
28+
"@typescript-eslint/await-thenable": "off",
29+
"@typescript-eslint/ban-types": "off",
30+
"@typescript-eslint/consistent-type-assertions": "error",
31+
"@typescript-eslint/dot-notation": "error",
32+
"@typescript-eslint/indent": "off",
33+
//"deprecation/deprecation": "error",
34+
"@typescript-eslint/member-delimiter-style": [
35+
"off",
36+
{
37+
"multiline": {
38+
"delimiter": "none",
39+
"requireLast": "error",
40+
},
41+
"singleline": {
42+
"delimiter": "semi",
43+
"requireLast": "off",
44+
},
45+
},
46+
],
47+
"@typescript-eslint/member-ordering": "off",
48+
"@typescript-eslint/naming-convention": [
49+
"error",
50+
{
51+
"selector": "variable",
52+
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
53+
"leadingUnderscore": "allow",
54+
},
55+
],
56+
"@typescript-eslint/no-empty-function": "error",
57+
"@typescript-eslint/no-empty-interface": "error",
58+
"@typescript-eslint/no-explicit-any": "off",
59+
"@typescript-eslint/no-floating-promises": "error",
60+
"@typescript-eslint/no-misused-new": "error",
61+
"@typescript-eslint/no-namespace": "off",
62+
"@typescript-eslint/no-parameter-properties": "off",
63+
"@typescript-eslint/no-this-alias": "error",
64+
"@typescript-eslint/no-unnecessary-qualifier": "error",
65+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
66+
"@typescript-eslint/no-unused-expressions": "off",
67+
"@typescript-eslint/no-use-before-define": "off",
68+
"@typescript-eslint/no-var-requires": "off",
69+
"@typescript-eslint/prefer-for-of": "error",
70+
"@typescript-eslint/prefer-function-type": "error",
71+
"@typescript-eslint/prefer-namespace-keyword": "error",
72+
"@typescript-eslint/quotes": "off",
73+
"@typescript-eslint/semi": ["off", null],
74+
"@typescript-eslint/triple-slash-reference": [
75+
"error",
76+
{
77+
"path": "always",
78+
"types": "prefer-import",
79+
"lib": "always",
80+
},
81+
],
82+
"@typescript-eslint/type-annotation-spacing": "off",
83+
"@typescript-eslint/unified-signatures": "error",
84+
"arrow-parens": ["off", "always"],
85+
"brace-style": ["off", "off"],
86+
"comma-dangle": "off",
87+
"complexity": "off",
88+
"constructor-super": "error",
89+
"curly": "error",
90+
"default-case": "error",
91+
"eol-last": "off",
92+
"eqeqeq": ["error", "smart"],
93+
"guard-for-in": "error",
94+
"id-blacklist": "off",
95+
"id-match": "error",
96+
// "import/no-deprecated": "error",
97+
// "import/no-extraneous-dependencies": "off",
98+
// "import/no-internal-modules": "off",
99+
// "jsdoc/check-alignment": "error",
100+
// "jsdoc/check-indentation": "off",
101+
// "jsdoc/newline-after-description": "off",
102+
"linebreak-style": "off",
103+
"max-classes-per-file": "off",
104+
"max-len": "off",
105+
"new-parens": "off",
106+
"newline-per-chained-call": "off",
107+
"no-bitwise": "error",
108+
"no-caller": "error",
109+
"no-cond-assign": "error",
110+
"no-console": "off",
111+
"no-constant-condition": "off",
112+
"no-control-regex": "error",
113+
"no-debugger": "error",
114+
"no-duplicate-case": "error",
115+
"no-duplicate-imports": "error",
116+
"no-empty": ["warn"],
117+
"no-eval": "error",
118+
"no-extra-bind": "error",
119+
"no-extra-semi": "off",
120+
"no-fallthrough": "error",
121+
"no-invalid-regexp": "error",
122+
"no-invalid-this": "off",
123+
"no-irregular-whitespace": "off",
124+
"no-multiple-empty-lines": "off",
125+
"no-new-func": "error",
126+
"no-new-wrappers": "error",
127+
"no-redeclare": "off",
128+
"no-regex-spaces": "error",
129+
"no-return-await": "error",
130+
"no-sequences": "error",
131+
"no-shadow": [
132+
"off",
133+
{
134+
"hoist": "all",
135+
},
136+
],
137+
"no-sparse-arrays": "error",
138+
"no-template-curly-in-string": "error",
139+
"no-throw-literal": "error",
140+
"no-trailing-spaces": "off",
141+
"no-undef-init": "error",
142+
"no-underscore-dangle": "off",
143+
"no-unsafe-finally": "error",
144+
"no-unused-labels": "error",
145+
"no-var": "error",
146+
"object-shorthand": "error",
147+
"one-var": ["error", "never"],
148+
"prefer-arrow/prefer-arrow-functions": "off",
149+
"prefer-const": "error",
150+
"prefer-object-spread": "error",
151+
"quote-props": "off",
152+
"radix": "error",
153+
"react/jsx-curly-spacing": "off",
154+
"react/jsx-equals-spacing": "off",
155+
"react/jsx-wrap-multilines": "off",
156+
"space-before-function-paren": "off",
157+
"space-in-parens": ["off", "never"],
158+
"spaced-comment": [
159+
"error",
160+
"always",
161+
{
162+
"markers": ["/"],
163+
},
164+
],
165+
"unicorn/filename-case": "off",
166+
"use-isnan": "error",
167+
"valid-typeof": "off",
168+
"align": "off",
169+
"ban": "off",
170+
"eofline": "off",
171+
"indent": "off",
172+
"interface-name": "off",
173+
"jsx-no-lambda": "off",
174+
"jsx-no-multiline-js": "off",
175+
"max-line-length": "off",
176+
"member-ordering": "off",
177+
"no-consecutive-blank-lines": "off",
178+
"no-implicit-dependencies": "off",
179+
"no-namespace": "off",
180+
"no-submodule-imports": "off",
181+
"no-trailing-whitespace": "off",
182+
"no-unused-expression": "off",
183+
"no-use-before-declare": "off",
184+
"one-line": "off",
185+
"prefer-conditional-expression": "off",
186+
"quotemark": "off",
187+
"semicolon": "off",
188+
"trailing-comma": "off",
189+
"typedef-whitespace": "off",
190+
"whitespace": "off",
191+
}
192+
}
193+
);

0 commit comments

Comments
 (0)