-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
73 lines (67 loc) · 1.78 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
import eslint from "@eslint/js";
import pluginRouter from "@tanstack/eslint-plugin-router";
import importPlugin from "eslint-plugin-import";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...pluginRouter.configs["flat/recommended"],
{
plugins: {
import: importPlugin,
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
},
{ ignores: ["dist", "src/components/ui"] },
{
settings: {
react: { version: "18.3" },
"import/resolver": {
typescript: {},
},
},
rules: {
...importPlugin.flatConfigs.recommended.rules,
...react.configs.flat.recommended.rules,
...react.configs.flat["jsx-runtime"].rules,
"import/order": [
"error",
{
alphabetize: { order: "asc", caseInsensitive: true },
distinctGroup: false,
groups: [
"builtin",
"external",
"internal",
"index",
"sibling",
"parent",
],
"newlines-between": "always",
pathGroups: [
{
group: "external",
pattern: "{react,react-dom/**}",
position: "before",
},
{
group: "internal",
pattern: "@/**",
},
],
pathGroupsExcludedImportTypes: ["builtin"],
},
],
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
);