diff --git a/.oxlintrc.json b/.oxlintrc.json index 10d30061..ee705b44 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", "plugins": ["typescript", "unicorn", "oxc", "import"], - "jsPlugins": ["eslint-plugin-obsidianmd"], + "jsPlugins": ["eslint-plugin-obsidianmd", "svelte-policy/oxlint"], "categories": { "correctness": "error" }, @@ -43,6 +43,7 @@ "obsidianmd/no-global-this": "error", "obsidianmd/settings-tab/no-manual-html-headings": "error", "obsidianmd/commands/no-plugin-name-in-command-name": "error", + "svelte-policy/no-svelte-internal": "error", "no-restricted-globals": [ "error", { diff --git a/AGENTS.md b/AGENTS.md index 748ce79c..06b91672 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ root symlinks for local Obsidian loading. - `npm ci`: install the locked dependencies for local development. - `npm run dev`: watch-mode development build via Vite. - `npm run typecheck`: run TypeScript 7's native `tsc --noEmit` for source and test projects. -- `npm run lint`: run oxlint against TypeScript sources and tooling scripts (includes the obsidianmd guideline rules via jsPlugins). +- `npm run lint`: run oxlint against TypeScript sources and tooling scripts (includes the obsidianmd guideline rules and the `svelte-policy` internals guard via jsPlugins), then the `svelte-policy` component checker, configured by `svelte-policy.json`. - `npm run format:check`: run the configured oxfmt check (`npm run format` to write). - `npm run check:a11y`: patch svelte-check if needed, run `lint:tsconfig`, then run `svelte-check --tsgo-experimental-api --fail-on-warnings` for source and test projects. - `npm run lint:tsconfig`: fail with TS18003 when `tsconfig.json` or `tsconfig.test.json` matches no files, using the native compiler without type checking. diff --git a/package-lock.json b/package-lock.json index 2a445f3c..fa1e6feb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,6 +24,7 @@ "postcss": "^8.5.29", "svelte": "^5.57.1", "svelte-check": "4.7.6", + "svelte-policy": "^0.1.0", "typescript": "6.0.3", "vite": "^8.3.2", "vitest": "^5.0.3", @@ -5901,9 +5902,9 @@ } }, "node_modules/esquery": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", - "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -8960,6 +8961,26 @@ } } }, + "node_modules/svelte-policy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/svelte-policy/-/svelte-policy-0.1.0.tgz", + "integrity": "sha512-3BP+Gm91/eQCElMzm0vNBzhaKVQHWWvlY1r/tWDcqrAkl79i3pi1P+zpucSfVrKffKFKUzec2QdzWXwt0okD6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "esquery": "^1.7.0", + "zimmerframe": "^1.1.5" + }, + "bin": { + "svelte-policy": "dist/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "svelte": "^5.57.0" + } + }, "node_modules/svelte/node_modules/aria-query": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", @@ -10836,9 +10857,9 @@ } }, "node_modules/zimmerframe": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", - "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.5.tgz", + "integrity": "sha512-msJxIvYDYcoNL+PJsu+7qmpDWsYmAxTY+2TNYXXF0hzBzBk0BMecOqDOG/EckUoKCuKwObfbugIl8QpqHDXeFA==", "dev": true, "license": "MIT" } diff --git a/package.json b/package.json index 5b0851d6..54338ec8 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "size:data": "node scripts/persistence-size.mjs", "count:writes": "node scripts/write-counts.mjs", "typecheck": "node node_modules/@typescript/native/bin/tsc --project tsconfig.json --noEmit && node node_modules/@typescript/native/bin/tsc --project tsconfig.test.json --noEmit", - "lint": "oxlint --deny-warnings src tests/e2e tests/tooling scripts patches .claude/skills/verify", + "lint": "oxlint --deny-warnings src tests/e2e tests/tooling scripts patches .claude/skills/verify && svelte-policy", "lint:tsconfig": "node node_modules/@typescript/native/bin/tsc --project tsconfig.json --noEmit --noCheck && node node_modules/@typescript/native/bin/tsc --project tsconfig.test.json --noEmit --noCheck", "format:check": "npm run format -- --check", "test": "npm run check:a11y && vitest --configLoader bundle", @@ -40,7 +40,7 @@ "check:a11y": "node patches/svelte-check.mjs && npm run lint:tsconfig && svelte-check --tsconfig ./tsconfig.json --tsgo-experimental-api --fail-on-warnings && svelte-check --tsconfig ./tsconfig.test.json --tsgo-experimental-api --fail-on-warnings", "docs:build": "npm ci --prefix docs && npm run build --prefix docs", "docs:deploy": "npm run docs:build && wrangler pages deploy docs/dist --project-name podnotes --branch master", - "format": "oxfmt src tests scripts patches .claude/skills/verify .github package.json manifest.json versions.json tsconfig.base.json tsconfig.json tsconfig.test.json .oxlintrc.json .oxfmtrc.json vite.config.ts vitest.config.ts vitest.e2e.config.ts vitest.setup.ts vitest.setup.dom.ts obsidian-e2e.config.mjs docs/wrangler.jsonc docs/astro.config.mjs docs/package.json docs/src/content.config.ts docs/src/markdown.ts docs/src/site.mjs docs/src/pages docs/scripts docs/legacy-fragments.json docs/tsconfig.json", + "format": "oxfmt src tests scripts patches .claude/skills/verify .github package.json manifest.json versions.json tsconfig.base.json tsconfig.json tsconfig.test.json .oxlintrc.json .oxfmtrc.json svelte-policy.json vite.config.ts vitest.config.ts vitest.e2e.config.ts vitest.setup.ts vitest.setup.dom.ts obsidian-e2e.config.mjs docs/wrangler.jsonc docs/astro.config.mjs docs/package.json docs/src/content.config.ts docs/src/markdown.ts docs/src/site.mjs docs/src/pages docs/scripts docs/legacy-fragments.json docs/tsconfig.json", "test:tooling": "vitest run --config tests/tooling/vitest.config.ts" }, "devDependencies": { @@ -58,6 +58,7 @@ "postcss": "^8.5.29", "svelte": "^5.57.1", "svelte-check": "4.7.6", + "svelte-policy": "^0.1.0", "typescript": "6.0.3", "vite": "^8.3.2", "vitest": "^5.0.3", diff --git a/src/ui/PodcastView/ChapterList.svelte b/src/ui/PodcastView/ChapterList.svelte index 2e2296fe..bc5ca39f 100644 --- a/src/ui/PodcastView/ChapterList.svelte +++ b/src/ui/PodcastView/ChapterList.svelte @@ -49,7 +49,7 @@ {#if isExpanded}