-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
107 lines (97 loc) · 2.82 KB
/
eslint.config.js
File metadata and controls
107 lines (97 loc) · 2.82 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import js from "@eslint/js";
import typescript from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import prettierConfig from "eslint-config-prettier";
import perfectionist from "eslint-plugin-perfectionist";
import prettier from "eslint-plugin-prettier";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import { defineConfig, globalIgnores } from "eslint/config";
import globals from "globals";
export default defineConfig([
// Base ESLint recommended config
js.configs.recommended,
// Global ignores
globalIgnores([
"**/dist/",
"**/vendor/",
"**/deps/",
"**/priv/",
"**/.elixir_ls",
"**/_build",
"site/docs/api/**",
"components/react/src/routeTree.gen.ts",
"packages/core/src/schema.d.ts",
]),
// Configuration for all JavaScript/TypeScript files
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
...globals.node,
},
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": typescript,
prettier,
},
rules: {
// TypeScript ESLint recommended rules
...typescript.configs.recommended.rules,
// Prettier rules (run Prettier as an ESLint rule)
"prettier/prettier": "error",
// Add any custom rules here
// You can uncomment and customize these as needed:
// "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
// "@typescript-eslint/explicit-module-boundary-types": "off",
// "@typescript-eslint/no-explicit-any": "warn",
},
},
// React-specific configuration for components/react
{
files: ["components/react/**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: {
...globals.browser,
},
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: "module",
},
},
plugins: {
"@typescript-eslint": typescript,
prettier,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
// TypeScript ESLint recommended rules
...typescript.configs.recommended.rules,
// React Hooks rules
...reactHooks.configs.recommended.rules,
// Prettier rules
"prettier/prettier": "error",
// React Refresh rules (for HMR)
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
},
perfectionist.configs["recommended-alphabetical"],
// Prettier config should be last to override other formatting rules
prettierConfig,
]);