chore(lint): remove Phase 8 ESLint overrides + add D-08-extension (DIR-01/09/10 acceptance)

Deletes the contiguous Phase-8 override block from eslint.config.mjs
(lines 73-113 — the `// Phase 8 — DIR-01 / DIR-09 / DIR-10` headers
and both sub-blocks).

Adds the D-08-extension override (a `src/**/*.ts no-unsafe-*: off`
block) that mirrors the existing `**/*.d.ts no-explicit-any: off`
exclusion's strategy: silence the typed-linting cascade from
ical.js's untyped APIs at the consumption sites, since the root-
cause fix (hand-typing ical.js) is deferred to FRAG-02. The new
override is NOT tied to a scorecard finding — `no-unsafe-*` is
not a DIR-NN rule.

Closes scorecard findings DIR-01, DIR-09, DIR-10 at the acceptance
level: `npm run lint` now passes clean. Remaining narrow overrides:
- Phase-5 tightening (no-unused-vars: error, no-restricted-syntax
  for document.createElement)
- `**/*.d.ts` no-explicit-any: off (Plan 02 — ical.d.ts shim)
- `src/**/*.ts` no-unsafe-*: off (this commit — ical.js cascade)
- globalIgnores (node_modules, main.js, build scripts)

See 08-04-CHECKPOINT.md for the Rule-4 architectural escalation
that surfaced this design (Option B was chosen).
This commit is contained in:
formax68 2026-05-17 10:12:27 +03:00
parent c9b7dbef4f
commit 9d042ebe89

View file

@ -70,45 +70,23 @@ export default tseslint.config(
rules: { "@typescript-eslint/no-explicit-any": "off" },
},
// ---------------------------------------------------------------------------
// Phase 8 — DIR-01 / DIR-09 / DIR-10 will remove these when type-hygiene
// and console-discipline land.
// ---------------------------------------------------------------------------
// D-08-extension — `no-unsafe-*` typed-linting cascade from ical.js's
// untyped APIs (`parse`, `getFirstPropertyValue`, `getFirstValue`,
// constructor, `fromData`). Same root cause as the existing
// `**/*.d.ts` `no-explicit-any: off` exclusion: ical.js is
// fundamentally untyped, hand-typing is deferred to FRAG-02. This
// silences the consumption-site cascade at the call sites in
// CalendarService, IcsImportService, NoteService, CalendarView,
// and main.ts. NOT tied to a scorecard finding — `no-unsafe-*`
// is not a DIR-NN rule.
{
files: ["src/**/*.ts"],
rules: {
// Recommended config gates no-console via obsidianmd/rule-custom-message
// and ALLOWS console.warn/.error/.debug. DIR-01 wants ALL console.*
// either removed or gated. Override `rule-custom-message` to no-op,
// then enforce no-console: "error".
"obsidianmd/rule-custom-message": "off",
"no-console": "off", // Re-tightened in Phase 8 to "error"
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"no-case-declarations": "off",
"no-useless-escape": "off",
},
},
// Phase 8 — DIR-01 will remove these when type-hygiene lands. Narrow `files`
// list (not `src/**/*.ts`) so any NEW unused-var introduced outside this
// closed set fails the gate — preserves DOC-01 acceptance for new code.
{
files: [
"src/services/CalendarService.ts",
"src/services/IcsImportService.ts",
"src/settings/SettingsTab.ts",
"src/settings/types.ts",
"src/utils/viewRenderers.ts",
"src/views/CalendarView.ts",
"src/views/EmbeddedCalendarView.ts",
],
rules: {
"@typescript-eslint/no-unused-vars": "off",
},
},