-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy patheslint.config.js
More file actions
88 lines (81 loc) · 2.48 KB
/
Copy patheslint.config.js
File metadata and controls
88 lines (81 loc) · 2.48 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
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import astro from "eslint-plugin-astro";
import globals from "globals";
export default [
// Ignore generated output and the MCP worker (separate package with its own
// toolchain — lint it from inside mcp/, not from the repo root). Vendored
// agent skills (.github/skills, mirrored into the git-ignored .claude/) are
// owned upstream and not ours to lint — same exclusion as .prettierignore.
{
ignores: [
"dist/",
".astro/",
"node_modules/",
"public/pagefind/",
"public/vendor/",
"public/js/",
"mcp/",
".github/skills/",
".claude/",
],
},
js.configs.recommended,
...tseslint.configs.recommended,
...astro.configs.recommended,
// Astro frontmatter + the bundled components run in a Node-ish build context.
{
files: ["**/*.{js,ts,astro}"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-explicit-any": "warn",
},
},
// Browser scripts shipped from public/ — no bundler, classic <script> globals.
{
files: ["public/**/*.js"],
languageOptions: {
sourceType: "script",
globals: { ...globals.browser, PagefindUI: "readonly" },
},
},
// Build + maintenance scripts run under Node as ES modules. Includes the
// root-level Astro integration that packages the OKF bundle at build time.
{
files: [
"scripts/**/*.{js,mjs}",
"*.config.{js,mjs,ts}",
"astro-okf-tarball.mjs",
],
languageOptions: {
sourceType: "module",
globals: globals.node,
},
},
// Cloudflare Pages Functions run on the Workers runtime (fetch, Response,
// Request, crypto, etc.) — excluded from the root tsconfig.
{
files: ["functions/**/*.ts"],
languageOptions: {
globals: { ...globals.serviceworker, ...globals.node },
},
},
// The pre-paint theme-init <script is:inline> in BaseLayout.astro is byte-frozen:
// its sha256 is pinned in the CSP (public/_headers), so it must stay minified
// exactly as written. Don't lint its legacy var/empty-catch idioms.
{
files: [
"src/layouts/BaseLayout.astro",
"src/layouts/BaseLayout.astro/*.{js,ts}",
],
rules: {
"no-var": "off",
"no-empty": "off",
"no-unused-vars": ["error", { caughtErrors: "none" }],
"@typescript-eslint/no-unused-vars": ["error", { caughtErrors: "none" }],
},
},
];