-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy patheslint.config.mjs
More file actions
105 lines (98 loc) · 2.42 KB
/
eslint.config.mjs
File metadata and controls
105 lines (98 loc) · 2.42 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
import js from "@eslint/js";
import globals from "globals";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
export default [
// Ignore patterns
{
ignores: [
"**/node_modules/**",
"**/_site/**",
"**/.cache/**",
"**/dist/**",
"**/.yarn/**",
"**/.devcontainer/**",
],
},
// ES Module files (eslint.config.mjs, etc)
{
files: ["**/*.mjs"],
plugins: { js },
...js.configs.recommended,
languageOptions: {
globals: {
...globals.node,
},
sourceType: "module",
},
},
// JavaScript files
{
files: ["**/*.{js,cjs}"],
plugins: { js },
...js.configs.recommended,
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
sourceType: "commonjs",
},
rules: {
// Warn about unused vars but don't break builds
"no-unused-vars": ["warn", {
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_"
}],
"no-undef": "error",
},
},
// Test files with Jest globals
{
files: ["tests/**/*.js", "**/*.test.js", "**/*.spec.js"],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest, // Already includes describe, test, it, expect, etc.
},
},
},
// JSON files
{
files: ["**/*.json"],
plugins: { json },
language: "json/json",
...json.configs.recommended,
},
// Markdown files - disable all rules for now to allow progressive fixing
{
files: ["**/*.md"],
plugins: { markdown },
language: "markdown/commonmark",
rules: {
// Disable all markdown rules - will enable progressively
"markdown/fenced-code-language": "off",
"markdown/no-missing-label-refs": "off",
"markdown/no-invalid-label-refs": "off",
"markdown/no-duplicate-headings": "off",
"markdown/no-empty-links": "off",
},
},
// CSS files - disable all rules for now to allow progressive fixing
{
files: ["**/*.css"],
plugins: { css },
language: "css/css",
rules: {
// Disable all CSS rules - will enable progressively
"css/no-invalid-properties": "off",
"css/no-important": "off",
"css/use-baseline": "off",
"css/no-duplicate-properties": "off",
"css/no-shorthand-property-overrides": "off",
},
},
];