-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
83 lines (75 loc) · 2.54 KB
/
Copy patheslint.config.mjs
File metadata and controls
83 lines (75 loc) · 2.54 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
// @ts-check
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import vue from "eslint-plugin-vue";
import svelte from "eslint-plugin-svelte";
import oxlint from "eslint-plugin-oxlint";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default tseslint.config(
{
ignores: [
"**/dist/**",
"**/coverage/**",
"**/*.d.ts",
"**/*.timestamp-*.mjs",
"**/node_modules/**",
"docs/.vitepress/cache/**",
"docs/.vitepress/dist/**",
],
},
// Base JS + TS for all package source
{
files: ["packages/**/*.{js,mjs,cjs,ts,tsx,vue,svelte}"],
extends: [js.configs.recommended, ...tseslint.configs.recommended],
languageOptions: {
globals: { ...globals.browser, ...globals.node },
},
},
// React / React Native / Preact adapters → rules-of-hooks + exhaustive-deps
// (eslint-plugin-react itself is omitted: 7.37 is incompatible with ESLint 10
// and its prop-types/stylistic rules add little for a TS codebase.)
{
files: ["packages/{react,react-native,preact}/**/*.{ts,tsx}"],
extends: [reactHooks.configs.flat.recommended],
rules: {
// Advisory React-Compiler readiness rule; keep rules-of-hooks + exhaustive-deps.
"react-hooks/refs": "off",
},
},
// Vue SFCs (vue-eslint-parser owns .vue; TS parser for <script lang="ts">)
{
files: ["packages/vue/**/*.vue"],
extends: [...vue.configs["flat/recommended"]],
languageOptions: { parserOptions: { parser: tseslint.parser } },
rules: {
// Optional props without defaults are intentional in this TS API.
"vue/require-default-prop": "off",
},
},
// Svelte SFCs
{
files: ["packages/svelte/**/*.svelte"],
extends: [...svelte.configs.recommended],
languageOptions: { parserOptions: { parser: tseslint.parser } },
rules: {
// Svelte 5 runes: `let { ... } = $props()` must use `let`; generics/snippets
// referenced only in markup aren't seen as used by the TS rules.
"prefer-const": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
// Tests: relax a few rules
{
files: ["**/*.{test,spec}.{ts,tsx}", "**/__tests__/**", "**/__test__/**"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
// Turn OFF rules oxlint already runs (avoids double-reporting)
...oxlint.configs["flat/recommended"],
// Disable formatting rules — Prettier owns formatting (must be last)
prettier
);