-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy patheslint.config.mjs
More file actions
76 lines (67 loc) · 1.98 KB
/
Copy patheslint.config.mjs
File metadata and controls
76 lines (67 loc) · 1.98 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
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import astroPlugin from "eslint-plugin-astro";
import sveltePlugin from "eslint-plugin-svelte";
export default [
// Base recommended rules
js.configs.recommended,
...tseslint.configs.recommended,
...astroPlugin.configs.recommended,
...sveltePlugin.configs["flat/recommended"],
// Global overrides for this codebase
{
rules: {
"no-undef": "off",
"no-var": "warn",
"no-empty": "warn",
"no-useless-escape": "warn",
"no-useless-assignment": "warn",
// Warnings for issues that don't break functionality
"no-redeclare": "warn",
"prefer-const": "warn",
"preserve-caught-error": "warn",
// The codebase uses `any` extensively for dynamic API data
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-empty-object-type": "warn",
// Allow common patterns in this codebase
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/ban-ts-comment": "off",
// Astro-specific: CSS-defined vars may not be used in JS
"astro/no-unused-define-vars-in-style": "off",
// Unused vars: warn instead of error, allow `_` prefix
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
},
},
// Astro-specific
{
files: ["**/*.astro"],
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
},
},
// Svelte-specific
{
files: ["**/*.svelte"],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
// Svelte each blocks without keys — warn instead of error
"svelte/require-each-key": "warn",
},
},
// Ignored directories
{
ignores: ["dist/", ".astro/", "node_modules/"],
},
];