-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
87 lines (86 loc) · 2.38 KB
/
Copy patheslint.config.js
File metadata and controls
87 lines (86 loc) · 2.38 KB
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
import eslint from "@eslint/js"
import eslintConfigPrettier from "eslint-config-prettier/flat"
import eslintPluginAstro from "eslint-plugin-astro"
import drizzlePlugin from "eslint-plugin-drizzle"
import eslintPluginReact from "eslint-plugin-react"
import eslintPluginReactCompiler from "eslint-plugin-react-compiler"
import eslintPluginReactHooks from "eslint-plugin-react-hooks"
import eslintPluginReactRefresh from "eslint-plugin-react-refresh"
import { defineConfig } from "eslint/config"
import tseslint from "typescript-eslint"
export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
eslintConfigPrettier,
eslintPluginAstro.configs.recommended,
{
plugins: { drizzle: drizzlePlugin },
rules: {
...drizzlePlugin.configs.recommended.rules,
"drizzle/enforce-delete-with-where": [
"error",
{ drizzleObjectName: ["db"] },
],
},
},
{
files: ["**/*.{ts,tsx}"],
settings: {
react: {
version: "detect",
},
},
rules: {
...eslintPluginReactHooks.configs.recommended.rules,
...eslintPluginReactRefresh.configs.vite.rules,
...eslintPluginReactCompiler.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
plugins: {
"react-hooks": eslintPluginReactHooks,
"react-refresh": eslintPluginReactRefresh,
"react-compiler": eslintPluginReactCompiler,
},
extends: [
eslintPluginReact.configs.flat.recommended,
eslintPluginReact.configs.flat["jsx-runtime"],
],
},
{
files: ["/*.{js,jsx,cjs,mjs,ts,tsx,astro}"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"import/order": "off",
},
},
{
ignores: [
"**/public",
"**/dist",
"**/dist/*",
"**/.astro",
"**/*.gen.ts",
"**/tests/*",
"coverage",
"node_modules/*",
"**/__generated__/*",
".gitignore",
// Eslint reports syntax error, but the code is correct
"src/core/components/molecules/HeaderQuery.astro",
],
}
)