Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (79 loc) · 2.04 KB
/
Copy patheslint.config.js
File metadata and controls
84 lines (79 loc) · 2.04 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
import eslintPluginAstro from "eslint-plugin-astro";
import eslintPluginSvelte from "eslint-plugin-svelte";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import svelteParser from "svelte-eslint-parser";
import eslintConfigPrettier from "eslint-config-prettier";
export default [
// Ignore patterns
{
ignores: [
"dist/**",
"node_modules/**",
".astro/**",
".wrangler/**",
"bun.lock",
"*.config.js",
"*.config.mjs",
"*.config.ts",
"worker-configuration.d.ts",
],
},
// Base TypeScript configuration
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: "./tsconfig.json",
},
},
plugins: {
"@typescript-eslint": typescriptEslint,
},
rules: {
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
},
},
// Astro configuration
...eslintPluginAstro.configs.recommended,
{
files: ["**/*.astro"],
rules: {
// Astro-specific rules
"astro/no-set-html-directive": "error",
"astro/no-unused-css-selector": "warn",
},
},
// Svelte configuration
...eslintPluginSvelte.configs["flat/recommended"],
{
files: ["**/*.svelte"],
languageOptions: {
parser: svelteParser,
parserOptions: {
parser: typescriptParser,
extraFileExtensions: [".svelte"],
},
},
rules: {
// Svelte-specific rules
"svelte/no-at-html-tags": "warn",
"svelte/no-unused-svelte-ignore": "warn",
"svelte/valid-compile": "error",
},
},
// Prettier compatibility (must be last)
eslintConfigPrettier,
];