From 7cc49a2b3985dc699f3ba114910421a88eee7a27 Mon Sep 17 00:00:00 2001 From: J Chris Anderson Date: Wed, 17 Sep 2025 11:45:23 -0700 Subject: [PATCH] upgrade to type-checked eslint rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change upgrades from basic strict/stylistic configs to type-checked configs (strictTypeChecked, stylisticTypeChecked, recommendedTypeChecked). The stricter type-checking rules expose 2,304 lint violations that need to be addressed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- eslint.config.mjs | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7c32d46aa..83c1eabd9 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,32 +5,46 @@ import importPlugin from "eslint-plugin-import"; const opts = tseslint.config( eslint.configs.recommended, // ...tseslint.configs.recommended, - ...tseslint.configs.strict, - ...tseslint.configs.stylistic, + // ...tseslint.configs.strict, + // ...tseslint.configs.stylistic, + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked, + ...tseslint.configs.recommendedTypeChecked, { languageOptions: { - globals: { - queueMicrotask: "readonly", + parserOptions: { + sourceType: "module", + project: "./tsconfig.json", + // projectService: true, + tsconfigRootDir: import.meta.dirname, }, }, }, { ignores: [ "babel.config.cjs", + "prettier.config.js", "jest.config.js", + "setup.*.js", + "to-esm.js", + "vitest.*.ts", + "**/.esm-cache/**", "**/dist/", + "dist/**", "**/pubdir/", "**/node_modules/", "**/scripts/", "**/examples/", "scripts/", + "coverage/", "smoke/react/", "src/missingTypes/lib.deno.d.ts", - "**/.cache/**", - "**/.esm-cache/**", - "**/.wrangler/**", ], }, + { + files: ["**/*.js", "*.mjs"], + extends: [tseslint.configs.disableTypeChecked], + }, { plugins: { import: importPlugin, @@ -53,6 +67,12 @@ const opts = tseslint.config( "no-restricted-globals": ["error", "URL", "TextDecoder", "TextEncoder"], }, }, + { + files: ["**/*.ts", "**/*.tsx"], + rules: { + "@typescript-eslint/prefer-readonly": "error", + }, + }, ); export default opts;