-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.mjs
77 lines (64 loc) · 1.8 KB
/
eslint.config.mjs
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
import reactPlugin from 'eslint-plugin-react'
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import reactHooks from "eslint-plugin-react-hooks";
import tsParser from "@typescript-eslint/parser";
import globals from "globals";
export default tseslint.config({
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
],
plugins: {
"@typescript-eslint": typescriptEslint,
"react-hooks": reactHooks,
},
languageOptions: {
parser: tsParser,
...reactPlugin.configs.flat.recommended.languageOptions,
globals: {
...globals.browser,
},
},
settings: {
react: {
version: 'detect',
},
},
rules: {
"comma-dangle": ["warn", {
arrays: "always-multiline",
objects: "always-multiline",
imports: "always-multiline",
exports: "always-multiline",
functions: "always-multiline",
}],
"keyword-spacing": ["error"],
"no-console": ["warn", {
allow: ["error"],
}],
"no-multiple-empty-lines": ["error", {
max: 2,
maxEOF: 2,
}],
"no-undef": "off",
semi: ["error", "never"],
"space-before-function-paren": ["error", {
anonymous: "never",
named: "never",
asyncArrow: "always",
}],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"react/jsx-closing-bracket-location": ["error", "line-aligned"],
"react/jsx-closing-tag-location": "off",
"react/jsx-curly-newline": "off",
"react/jsx-no-undef": "off",
"react/no-did-update-set-state": "warn",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
},
});