chore(eslint): enable no-restricted-imports; replace moment with luxon (#2422)

Removes the `no-restricted-imports: off` override so the obsidianmd recommended
rule applies (bans axios/node-fetch/moment/etc.). Replaces the two `moment(...)`
call sites in `src/utils.ts` with `luxon`'s `DateTime` (already a dep) and adds
unit tests covering local/UTC formatting, zero-padding, immutability, and the
invalid-input fallback. Integration tests get a per-file override since they
need `node-fetch` to polyfill jsdom fetch. `no-restricted-globals` stays
disabled — banning the global `app` will land in a separate PR.
This commit is contained in:
Zero Liu 2026-05-13 02:13:27 -07:00 committed by GitHub
parent eca1b081d5
commit cbe2ed771d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,7 +109,6 @@ export default [
"@typescript-eslint/no-deprecated": "off",
// SDL / import / no-unsanitized / depend: defer — review separately
"no-restricted-imports": "off",
"no-restricted-globals": "off",
},
},
@ -128,6 +127,15 @@ export default [
},
},
// Integration tests bootstrap jsdom fetch via `node-fetch` polyfill —
// allow the otherwise-banned import here only.
{
files: ["src/integration_tests/**"],
rules: {
"no-restricted-imports": "off",
},
},
// Node-context files (build configs, scripts)
{
files: [