-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.ts
57 lines (56 loc) · 1.61 KB
/
eslint.config.ts
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
import pluginJs from "@eslint/js";
import pluginReact from "eslint-plugin-react";
import tseslint from "typescript-eslint";
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment -- will be upgraded to typescript soon
const pluginReactHooks = require("eslint-plugin-react-hooks");
// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment -- will be upgraded to typescript soon
const pluginReactCompiler = require("eslint-plugin-react-compiler");
export default tseslint.config(
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{
"settings": {
"react": {
"version": "detect",
},
},
},
pluginJs.configs.recommended,
...tseslint.configs.strictTypeChecked,
pluginReact.configs.flat.recommended,
pluginReact.configs.flat["jsx-runtime"],
{
plugins: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
"react-hooks": pluginReactHooks,
},
rules: {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
extends: [
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
pluginReactCompiler.configs.recommended,
],
},
{
languageOptions: {
parserOptions: {
projectService: true,
},
},
},
{
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
},
],
"curly": ["error", "multi-line"], // prevents confusion on which statements are conditional
},
},
);