chore: centralize type declarations and standardize tooling config

- Update types/globals.d.ts with centralized type declarations
- Add .prettierignore, update .eslintrc.json with triple-slash-reference override
- Remove duplicate scripts.d.ts/styles.d.ts if present
This commit is contained in:
saberzero1 2026-03-16 18:55:26 +01:00
parent 928e4d9eb9
commit fea5484f17
No known key found for this signature in database
5 changed files with 49 additions and 4 deletions

View file

@ -22,5 +22,13 @@
"caughtErrorsIgnorePattern": "^_"
}
]
}
},
"overrides": [
{
"files": ["types/**/*.d.ts"],
"rules": {
"@typescript-eslint/triple-slash-reference": "off"
}
}
]
}

1
.prettierignore Normal file
View file

@ -0,0 +1 @@
dist

View file

@ -59,9 +59,9 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"prettier": "^3.6.2",
"vitest": "^2.1.9",
"tsup": "^8.5.0",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "^2.1.9"
},
"quartz": {
"name": "remove-draft",

View file

@ -19,6 +19,6 @@
"types": ["vitest/globals", "node"],
"verbatimModuleSyntax": true
},
"include": ["src", "tsup.config.ts", "vitest.config.ts"],
"include": ["src", "tsup.config.ts", "vitest.config.ts", "types"],
"exclude": ["dist", "node_modules"]
}

36
types/globals.d.ts vendored Normal file
View file

@ -0,0 +1,36 @@
declare module "*.scss" {
const content: string;
export default content;
}
declare module "*.inline.ts" {
const content: string;
export default content;
}
interface CustomEventMap {
nav: CustomEvent<{ url: string }>;
prenav: CustomEvent<undefined>;
themechange: CustomEvent<{ theme: "light" | "dark" }>;
readermodechange: CustomEvent<{ mode: "on" | "off" }>;
render: CustomEvent<object>;
}
interface Document {
addEventListener<K extends keyof CustomEventMap>(
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void;
removeEventListener<K extends keyof CustomEventMap>(
type: K,
listener: (this: Document, ev: CustomEventMap[K]) => void,
): void;
dispatchEvent<K extends keyof CustomEventMap>(ev: CustomEventMap[K] | UIEvent): void;
}
interface Window {
addCleanup(fn: (...args: unknown[]) => void): void;
spaNavigate?(url: URL, isBack: boolean): Promise<void>;
}
declare const fetchData: Promise<Record<string, unknown>>;