-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
86 lines (82 loc) · 2.33 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
78
79
80
81
82
83
84
85
86
// @ts-check
import eslintJs from "@eslint/js";
import tanstackRouterPlugin from "@tanstack/eslint-plugin-router";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintReact from "eslint-plugin-react";
import eslintReactCompiler from "eslint-plugin-react-compiler";
import eslintReactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslintJs.configs.recommended,
...tseslint.configs.recommended,
...tanstackRouterPlugin.configs["flat/recommended"],
eslintConfigPrettier,
{
files: ["**.config.{cjs,mjs,ts,js}", "postbuild.cjs"],
languageOptions: {
globals: { ...globals.node },
parserOptions: { tsconfigRootDir: import.meta.dirname },
},
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
{
ignores: [
"dist/**",
"node_modules/**",
"**.config.{cjs,mjs,ts,js}",
"src/**/*.gen.ts",
"*.html",
],
},
{
files: ["src/**/*.{ts,tsx}"],
...eslintReact.configs.flat.recommended,
},
{
languageOptions: {
...eslintReact.configs.flat.recommended.languageOptions,
globals: { ...globals.browser },
parserOptions: {
tsconfigRootDir: import.meta.dirname,
ecmaFeatures: { jsx: true },
},
},
settings: {
react: {
createClass: "createReactClass",
pragma: "React",
fragment: "Fragment",
version: "detect",
},
},
},
// {},
{
plugins: {
"react-compiler": eslintReactCompiler,
// @ts-expect-error
"react-hooks": eslintReactHooks,
},
},
{
rules: {
...eslintReactHooks.configs.recommended.rules,
"react-compiler/react-compiler": "error",
"no-extra-boolean-cast": "off",
"no-case-declarations": "off",
"react/display-name": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-unused-vars": "off",
},
}
);