-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
71 lines (65 loc) · 1.62 KB
/
eslint.config.js
File metadata and controls
71 lines (65 loc) · 1.62 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
import eslintPluginAstro from "eslint-plugin-astro";
import jsxA11y from "eslint-plugin-jsx-a11y";
import tseslint from "typescript-eslint";
export default [
// Recommended config for Astro
...eslintPluginAstro.configs.recommended,
jsxA11y.flatConfigs.recommended,
{
files: ["**/*.{js,mjs,cjs,ts,tsx}"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
},
},
{
files: ["**/*.astro"],
languageOptions: {
parser: eslintPluginAstro.parser,
parserOptions: {
parser: tseslint.parser,
extraFileExtensions: [".astro"],
},
},
},
{
files: ["**/*.{js,mjs,cjs,ts,astro}"],
rules: {
// General best practices
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-debugger": "error",
"no-unused-vars": "off", // TypeScript handles this
// Code quality - relaxed for now
"prefer-const": "warn",
"no-var": "error",
"object-shorthand": "warn",
"prefer-template": "off", // Too strict for mixed content
// Astro specific
"astro/no-conflict-set-directives": "error",
"astro/no-unused-define-vars-in-style": "error",
},
},
{
files: ["**/*.astro"],
rules: {
// Astro-specific overrides
"astro/no-set-html-directive": "warn",
// Disable rules that conflict with Astro's frontmatter
"no-undef": "off",
},
},
{
ignores: [
"dist/",
"node_modules/",
".astro/",
"public/",
"*.config.js",
"*.config.mjs",
"*.config.ts",
],
},
];