mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
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:
parent
eca1b081d5
commit
cbe2ed771d
1 changed files with 9 additions and 1 deletions
|
|
@ -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: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue