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 b0aae4dcd8
commit 8e014e00c8
No known key found for this signature in database
6 changed files with 29 additions and 11 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

@ -72,9 +72,9 @@
"preact": "^10.28.2",
"prettier": "^3.6.2",
"sass": "^1.97.3",
"vitest": "^2.1.9",
"tsup": "^8.5.0",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "^2.1.9"
},
"engines": {
"node": ">=22",

View file

@ -1,4 +0,0 @@
declare module "*.inline.ts" {
const content: string;
export default content;
}

View file

@ -1,4 +0,0 @@
declare module "*.scss" {
const content: string;
export default content;
}

17
types/globals.d.ts vendored
View file

@ -1,5 +1,19 @@
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 {
@ -16,4 +30,7 @@ interface Document {
interface Window {
addCleanup(fn: (...args: unknown[]) => void): void;
spaNavigate?(url: URL, isBack: boolean): Promise<void>;
}
declare const fetchData: Promise<Record<string, unknown>>;