generated from bradgarropy/eslint-config-bradgarropy
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
86 lines (83 loc) · 2.59 KB
/
eslint.config.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
import js from "@eslint/js"
import vitest from "@vitest/eslint-plugin"
import jsxA11y from "eslint-plugin-jsx-a11y"
import react from "eslint-plugin-react"
import reactHooks from "eslint-plugin-react-hooks"
import simpleImportSort from "eslint-plugin-simple-import-sort"
import globals from "globals"
import ts from "typescript-eslint"
const config = ts.config([
{
ignores: ["build", "coverage", "node_modules"],
},
js.configs.recommended,
ts.configs.recommended,
react.configs.flat.recommended,
react.configs.flat["jsx-runtime"],
jsxA11y.flatConfigs.recommended,
{
files: [
"**/*.js",
"**/*.cjs",
"**/*.mjs",
"**/*.jsx",
"**/*.ts",
"**/*.cts",
"**/*.mts",
"**/*.tsx",
],
languageOptions: {
globals: {
...globals.browser,
...globals.es2025,
...globals.jest,
...globals.node,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"simple-import-sort": simpleImportSort,
"react-hooks": reactHooks,
"vitest": vitest,
},
settings: {
react: {
version: "19",
},
},
rules: {
...reactHooks.configs.recommended.rules,
...vitest.configs.recommended.rules,
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
disallowTypeAnnotations: true,
fixStyle: "separate-type-imports",
},
],
"@typescript-eslint/consistent-type-exports": ["error"],
"@typescript-eslint/no-import-type-side-effects": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{
ignoreRestSiblings: true,
},
],
"eqeqeq": ["error", "always"],
"function-paren-newline": ["off"],
"indent": ["off"],
"jsx-a11y/accessible-emoji": ["off"],
"no-console": ["off"],
"prefer-const": ["error"],
"react-hooks/rules-of-hooks": ["error"],
"react-hooks/exhaustive-deps": ["error"],
"simple-import-sort/imports": ["error"],
"simple-import-sort/exports": ["error"],
},
},
])
export default config