INTER-2222: Upgrade to ESLint v10 flat config#199
Draft
erayaydin wants to merge 1 commit into
Draft
Conversation
Use `@fingerprintjs/eslint-config-dx-team@2.0.0` which requires ESLint v10. Related-Task: INTER-2222
Contributor
pnpm exec changesetto create a changeset. |
Contributor
Coverage report
Test suite run success21 tests passing in 15 suites. Report generated by 🧪jest coverage report action from c38df46 Show full coverage report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
@fingerprintjs/eslint-config-dx-team@2.0.0which requires ESLint v10 and exports a flat config array.Dependency changes
eslint8.57.0^10.4.1@fingerprintjs/eslint-config-dx-team^0.1.0^2.0.0eslint-config-next14.1.3^16.2.0@rushstack/eslint-patchwhich fails on ESLint v10; v16 is flat-config nativeeslint-plugin-react-hooks^4.6.0^7.0.0eslint-config-next@16eslint-plugin-prettier^5.5.5@eslint/eslintrc^3.0.0FlatCompatinexamples/preact. We can consider moving this to the example package.json filetypescript-eslint^8.60.0Config notes
settings.react.version: '18.2'instead of'detect': thedetectpath ineslint-plugin-react@7.37.xcallscontext.getFilename()which was removed in ESLint v10.Parser override for
.jsfiles:eslint-config-next@16sets@babel/eslint-parserfor all files, then restores@typescript-eslint/parseronly for.ts/.tsx. The babel parser'seslint-scope@5.xscope manager lacks theaddGlobals()method ESLint v10 requires, so we re-apply@typescript-eslint/parserfor.js/.jsxfiles.examples/preact— usesFlatCompatto wrapeslint-config-preact(no flat config support).plugin:@typescript-eslint/recommendedis replaced withtseslint.configs.recommended(unified package v8) to support TypeScript 5.9Code changes
@typescript-eslint/no-empty-object-typeEmpty object type
{}is now flagged;objectis the correct replacement when you mean "no specific props".no-promise-executor-return__tests__/helpers.tsx@typescript-eslint/no-non-null-assertionDOM
querySelectorcalls in tests suppressed witheslint-disable-next-line. The elements are asserted to exist by the test setup.@typescript-eslint/no-explicit-any{ env?: { name: string } }instead ofany.render(...args: any[])->render(...args: unknown[]).@typescript-eslint/ban-ts-commentThe rule now requires a description when suppressing comments.
@typescript-eslint/consistent-type-assertionsconst mock = fn as FunctionComponent->const mock: FunctionComponent = fneslint-disable-next-line.no-useless-constructorEmpty constructor removed. It provided no behaviour and is redundant when the parent's constructor signature is identical.
@typescript-eslint/no-require-importsCJS file using
require()suppressed with a file-level disable. The script runs in Nodebefore any bundler, and cannot use ESM (depends on Node.js version).