Skip to content

Commit ef467d2

Browse files
ryanioclaude
andauthored
chore(deps): upgrade ESLint 8 → 10 (flat config) and chai 4 → 6 (#1934)
* chore(deps): upgrade ESLint 8 → 10 (flat config) and chai 4 → 6 Migrate ESLint to flat config format (eslint.config.mjs), remove .eslintrc. Upgrade chai to v6 which includes built-in TypeScript types, remove @types/chai. - Replace eslint-plugin-import with eslint-plugin-import-x (ESLint 10 compatible fork) - Add typescript-eslint unified package for flat config support - Disable import-x/no-unused-modules (incompatible with ESLint 10) - Add test file overrides for chai expressions and sinon namespace - Remove --ext flag from eslint scripts (not supported in flat config) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve CI issues for ESLint 10 + chai 6 upgrade - Add .claude/** to ESLint ignores (worktree dirs were being linted) - Remove unused eslint-disable directive in assets.ts (import-x/no-unresolved) - Re-add @types/chai (chai 6 does not ship built-in types) - Auto-fix prettier formatting in eslint.config.mjs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ab3d5c4 commit ef467d2

9 files changed

Lines changed: 919 additions & 2789 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 70 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import confusingBrowserGlobals from "confusing-browser-globals";
2+
import importPlugin from "eslint-plugin-import-x";
3+
import prettierPlugin from "eslint-plugin-prettier/recommended";
4+
import globals from "globals";
5+
import tseslint from "typescript-eslint";
6+
7+
export default tseslint.config(
8+
{
9+
ignores: [
10+
"docs/**",
11+
"lib/**",
12+
"coverage/**",
13+
"src/typechain/**",
14+
".claude/**",
15+
],
16+
},
17+
{
18+
linterOptions: {
19+
reportUnusedDisableDirectives: "error",
20+
},
21+
},
22+
tseslint.configs.recommended,
23+
importPlugin.flatConfigs.errors,
24+
importPlugin.flatConfigs.warnings,
25+
importPlugin.flatConfigs.typescript,
26+
prettierPlugin,
27+
{
28+
languageOptions: {
29+
globals: {
30+
...globals.browser,
31+
...globals.node,
32+
},
33+
},
34+
settings: {
35+
"import-x/resolver": {
36+
node: {
37+
extensions: [".js", ".ts", ".tsx", ".json"],
38+
},
39+
typescript: {
40+
alwaysTryTypes: true,
41+
project: "src",
42+
},
43+
},
44+
},
45+
rules: {
46+
"no-restricted-globals": ["error", ...confusingBrowserGlobals],
47+
"no-restricted-imports": [
48+
"error",
49+
{
50+
patterns: [
51+
{
52+
group: ["src/**", "!src/*"],
53+
message: "Please use relative import for `src` files.",
54+
},
55+
],
56+
},
57+
],
58+
curly: ["error"],
59+
"@typescript-eslint/no-unused-vars": [
60+
"error",
61+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
62+
],
63+
"@typescript-eslint/explicit-module-boundary-types": "off",
64+
"@typescript-eslint/no-empty-interface": "off",
65+
"@typescript-eslint/no-require-imports": "off",
66+
"import-x/no-rename-default": "off",
67+
"import-x/no-named-as-default-member": "off",
68+
"import-x/order": [
69+
"error",
70+
{
71+
groups: ["builtin", "external", "internal"],
72+
"newlines-between": "never",
73+
alphabetize: {
74+
order: "asc",
75+
caseInsensitive: true,
76+
},
77+
},
78+
],
79+
"import-x/no-unused-modules": "off",
80+
"no-control-regex": "off",
81+
"object-shorthand": ["error", "always"],
82+
},
83+
},
84+
// Test files: allow chai expressions and sinon namespace usage
85+
{
86+
files: ["test/**/*.ts"],
87+
rules: {
88+
"@typescript-eslint/no-unused-expressions": "off",
89+
"import-x/namespace": "off",
90+
},
91+
},
92+
);

0 commit comments

Comments
 (0)