From 5ce778a17c7567c2193f1dd4ca4d3e47073333b0 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 31 Mar 2026 22:47:30 -0700 Subject: [PATCH] =?UTF-8?q?style(guide):=20=F0=9F=8E=A8=20Add=20ESLint=20r?= =?UTF-8?q?ules=20for=20unused=20variables=20and=20type=20safety=20enforce?= =?UTF-8?q?ment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- games/age-of-dwarves/guide/eslint.config.js | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 games/age-of-dwarves/guide/eslint.config.js diff --git a/games/age-of-dwarves/guide/eslint.config.js b/games/age-of-dwarves/guide/eslint.config.js new file mode 100644 index 00000000..e9954a1a --- /dev/null +++ b/games/age-of-dwarves/guide/eslint.config.js @@ -0,0 +1,46 @@ +import tseslint from 'typescript-eslint' +import reactHooks from 'eslint-plugin-react-hooks' +import unusedImports from 'eslint-plugin-unused-imports' +import fileLength from '@lilith/eslint-plugin-file-length' +import importAlias from '@lilith/eslint-plugin-import-alias' + +export default tseslint.config( + { ignores: ['dist/', '.vite/'] }, + tseslint.configs.recommended, + { + plugins: { + 'react-hooks': reactHooks, + 'unused-imports': unusedImports, + '@lilith/file-length': fileLength, + 'import-alias': importAlias, + }, + rules: { + ...reactHooks.configs.recommended.rules, + + // Unused imports — autofix on lint:fix + '@typescript-eslint/no-unused-vars': 'off', + 'unused-imports/no-unused-imports': 'error', + 'unused-imports/no-unused-vars': ['error', { + vars: 'all', varsIgnorePattern: '^_', + args: 'after-used', argsIgnorePattern: '^_', + }], + + // Type discipline (align with typescript-code-standards.md) + '@typescript-eslint/no-explicit-any': 'error', + '@typescript-eslint/consistent-type-imports': ['error', { + prefer: 'type-imports', fixStyle: 'separate-type-imports', + }], + + // File length — project max 500 lines (CLAUDE.md) + '@lilith/file-length/file-length': ['error', { warnThreshold: 400, errorThreshold: 500 }], + + // Import alias enforcement — prefer @/ over relative src/ paths + 'import-alias/prefer-alias': 'error', + + // Guide pages are lazy-loaded default exports (vite code-splitting) + 'no-console': 'error', + 'prefer-const': 'error', + 'no-var': 'error', + }, + }, +)