-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
95 lines (85 loc) · 1.96 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
87
88
89
90
91
92
93
94
95
import js from "@eslint/js"
import ts from "typescript-eslint"
import pluginAstro from "eslint-plugin-astro"
import pluginReact from "eslint-plugin-react"
import pluginReactHooks from "eslint-plugin-react-hooks"
import pluginVue from "eslint-plugin-vue"
import pluginSvelte from "eslint-plugin-svelte"
import svelteConfig from "./svelte.config.js"
import pluginSolid from "eslint-plugin-solid"
import configPrettier from "eslint-config-prettier"
/** @type {import('eslint').Linter.Config[]} */
export default [
// javascript
js.configs.recommended,
// typescript
...ts.configs.recommended,
// astro
...pluginAstro.configs.recommended,
// react
{
name: "react/recommended",
files: ["*.{ts,tsx}", "**/*.{ts,tsx}"],
ignores: ["*.solid.{ts,tsx}", "**/*.solid.{ts,tsx}"],
...pluginReact.configs.flat.recommended,
...pluginReact.configs.flat["jsx-runtime"],
},
{
name: "react/hooks",
files: ["*.{ts,tsx}", "**/*.{ts,tsx}"],
ignores: ["*.solid.{ts,tsx}", "**/*.solid.{ts,tsx}"],
plugins: {
"react-hooks": pluginReactHooks,
},
rules: pluginReactHooks.configs.recommended.rules,
},
// vue
...pluginVue.configs["flat/recommended"],
{
name: "vue/parser",
files: ["*.vue", "**/*.vue"],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
// svelte
...pluginSvelte.configs["flat/recommended"],
...pluginSvelte.configs["flat/prettier"],
{
name: "svelte:parser",
files: ["*.svelte", "**/*.svelte", "*.svelte.ts", "**/*.svelte.ts"],
languageOptions: {
parserOptions: {
parser: ts.parser,
svelteConfig,
},
},
},
// solid
{
name: "solid/recommended",
files: ["*.solid.{ts,tsx}", "**/*.solid.{ts,tsx}"],
...pluginSolid.configs["flat/recommended"],
},
// custom
{
name: "custom",
rules: {
"no-restricted-imports": [
"error",
{
patterns: ["@/features/*/*"],
},
],
},
},
// ignore
{
name: "ignore",
ignores: [".astro/", "dist/"],
},
// should be last
configPrettier,
]