feat: add ESLint, lint-staged, and update pre-commit hook + CI

- Add ESLint 9 flat config (eslint.config.mjs) with typescript-eslint
  recommended rules and eslint-config-prettier
- Add lint-staged to run eslint+prettier only on staged files
- Update pre-commit hook to use lint-staged instead of full prettier check
- Add `lint` and `format:check` scripts to package.json
- Add Lint step to CI workflow
- Fix resulting lint errors: unused vars (_ctx, _options, catch binding),
  any→unknown in type declarations, stale eslint-disable comments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-21 09:49:20 +02:00
parent e93bbb8d3e
commit 3aea41f862
11 changed files with 1799 additions and 32 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ declare global {
// This is not an ideal solution but works for our example
interface KVNamespace {
get(key: string, options?: { type: "text" }): Promise<string | null>;
get(key: string, options: { type: "json" }): Promise<any | null>;
get(key: string, options: { type: "json" }): Promise<unknown>;
get(
key: string,
options: { type: "arrayBuffer" },
+2 -2
View File
@@ -15,7 +15,7 @@ declare module "rss" {
generator?: string;
categories?: string[];
custom_namespaces?: Record<string, string>;
custom_elements?: any[];
custom_elements?: unknown[];
}
interface RSSItemOptions {
@@ -34,7 +34,7 @@ declare module "rss" {
size?: number;
type?: string;
};
custom_elements?: any[];
custom_elements?: unknown[];
}
interface RSSXMLOptions {