Skip to content

INTER-2222: Upgrade to ESLint v10 flat config#199

Draft
erayaydin wants to merge 1 commit into
mainfrom
chore/eslint-upgrade-inter-2222
Draft

INTER-2222: Upgrade to ESLint v10 flat config#199
erayaydin wants to merge 1 commit into
mainfrom
chore/eslint-upgrade-inter-2222

Conversation

@erayaydin

Copy link
Copy Markdown
Member

Use @fingerprintjs/eslint-config-dx-team@2.0.0 which requires ESLint v10 and exports a flat config array.

Dependency changes

Package Before After Reason
eslint 8.57.0 ^10.4.1 Required by dx-team config v2
@fingerprintjs/eslint-config-dx-team ^0.1.0 ^2.0.0 ESLint upgrade and flat config
eslint-config-next 14.1.3 ^16.2.0 v14 uses @rushstack/eslint-patch which fails on ESLint v10; v16 is flat-config native
eslint-plugin-react-hooks ^4.6.0 ^7.0.0 Required peer of eslint-config-next@16
eslint-plugin-prettier ^5.5.5 removed Bundled in dx-team config
@eslint/eslintrc - ^3.0.0 ⚠️ Needed for FlatCompat in examples/preact. We can consider moving this to the example package.json file
typescript-eslint - ^8.60.0 Explicit dep for parser override in root config

Config notes

settings.react.version: '18.2' instead of 'detect': the detect path in eslint-plugin-react@7.37.x calls context.getFilename() which was removed in ESLint v10.

Parser override for .js files: eslint-config-next@16 sets @babel/eslint-parser for all files, then restores @typescript-eslint/parser only for .ts/.tsx. The babel parser's eslint-scope@5.x scope manager lacks the addGlobals() method ESLint v10 requires, so we re-apply @typescript-eslint/parser for .js/.jsx files.

examples/preact — uses FlatCompat to wrap eslint-config-preact (no flat config support). plugin:@typescript-eslint/recommended is replaced with tseslint.configs.recommended (unified package v8) to support TypeScript 5.9

Code changes

@typescript-eslint/no-empty-object-type

Empty object type {} is now flagged; object is the correct replacement when you mean "no specific props".

no-promise-executor-return

__tests__/helpers.tsx

// before
new Promise(resolve => setTimeout(resolve, ms))
// after
new Promise(resolve => { setTimeout(resolve, ms) })

@typescript-eslint/no-non-null-assertion

DOM querySelector calls in tests suppressed with eslint-disable-next-line. The elements are asserted to exist by the test setup.

@typescript-eslint/no-explicit-any

  • Test props typed as { env?: { name: string } } instead of any.
  • render(...args: any[]) -> render(...args: unknown[]).

@typescript-eslint/ban-ts-comment

The rule now requires a description when suppressing comments.

@typescript-eslint/consistent-type-assertions

  • const mock = fn as FunctionComponent -> const mock: FunctionComponent = fn
  • Unavoidable widening/narrowing casts suppressed with eslint-disable-next-line.

no-useless-constructor

Empty constructor removed. It provided no behaviour and is redundant when the parent's constructor signature is identical.

@typescript-eslint/no-require-imports

CJS file using require() suppressed with a file-level disable. The script runs in Node
before any bundler, and cannot use ESM (depends on Node.js version).

Use `@fingerprintjs/eslint-config-dx-team@2.0.0` which requires ESLint
v10.

Related-Task: INTER-2222
@erayaydin erayaydin self-assigned this Jun 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
83.08% (-0.13% 🔻)
108/130
🟡 Branches 63.77% 44/69
🟢 Functions
80% (-0.49% 🔻)
32/40
🟢 Lines
82.68% (-0.14% 🔻)
105/127

Test suite run success

21 tests passing in 15 suites.

Report generated by 🧪jest coverage report action from c38df46

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 83.07 63.76 80 82.67
🟢  src 88.7 75.86 83.33 88.33
🟢   detect-env.ts 90 83.33 100 90 15,87
🟢   env.ts 100 100 100 100
🟢   env.types.ts 85.71 40 50 83.33 14
🟡   ...nt-context.ts 75 100 0 75 8
🟡   get-env.ts 60 0 100 60 8-9
🟢   ssr.ts 100 100 100 100
🟢   ...sitor-data.ts 95.65 100 80 95.65 101
🟢  src/components 92.3 61.53 90.9 92.1
🟢   ...-provider.tsx 91.17 58.33 90 90.9 54,59,97
🟢   ...vironment.tsx 100 100 100 100
🟡  src/utils 58.62 42.85 63.63 58.62
🟡   ...-is-truthy.ts 50 50 100 50 3
🟡   to-error.ts 66.66 50 100 66.66 6
🟢   use-const.ts 100 50 100 100 5
🟢   ...mise-store.ts 92.3 75 100 92.3 7
🔴   wait-until.ts 0 0 0 0 8-19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant