-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mts
108 lines (107 loc) · 2.66 KB
/
eslint.config.mts
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import js from "@eslint/js";
import type { Linter } from "eslint";
export default [
js.configs.recommended,
{
name: "discoverypilot/base",
ignores: ["./build/**"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
globals: {
// Cloudflare Workers globals
caches: true,
crypto: true,
Response: true,
Request: true,
Headers: true,
// Vite dev globals
process: true,
__dirname: true,
// Browser globals
document: true,
window: true
},
parserOptions: {
ecmaFeatures: {
jsx: true
}
}
},
linterOptions: {
reportUnusedDisableDirectives: "warn"
},
settings: {
react: {
version: "detect"
},
formComponents: ["Form"],
linkComponents: [
{ name: "Link", linkAttribute: "to" },
{ name: "NavLink", linkAttribute: "to" }
],
"import/resolver": {
typescript: {}
},
"import/internal-regex": "^~/",
"remix/routes-path": "./app/routes"
}
},
{
name: "discoverypilot/react",
files: ["**/*.{js,jsx,ts,tsx}"],
ignores: ["./build/**"],
plugins: {
react: require("eslint-plugin-react"),
"jsx-a11y": require("eslint-plugin-jsx-a11y"),
"react-hooks": require("eslint-plugin-react-hooks"),
remix: require("eslint-plugin-remix")
},
rules: {
...js.configs.recommended.rules,
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
}
},
{
name: "discoverypilot/typescript",
files: ["**/*.{ts,tsx}"],
ignores: ["./build/**"],
plugins: {
"@typescript-eslint": require("@typescript-eslint/eslint-plugin"),
import: require("eslint-plugin-import")
},
languageOptions: {
parser: require("@typescript-eslint/parser")
},
settings: {
"import/internal-regex": "^~/",
"import/resolver": {
node: {
extensions: [".ts", ".tsx"]
},
typescript: {
alwaysTryTypes: true
}
}
},
rules: {
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/consistent-type-imports": [
"warn",
{ prefer: "type-imports" }
],
"import/order": ["warn", {
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"pathGroups": [
{
"pattern": "~/**",
"group": "internal"
}
]
}]
}
}
] satisfies Linter.Config[];