Draft
Conversation
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
Contributor
Upgrade ESLint from v8 to v9 across all workspaces. ESLint 9 uses flat config by default, but we keep using legacy .eslintrc.js format via ESLINT_USE_FLAT_CONFIG=false since upstream @sentry-internal/eslint-config-sdk hasn't migrated yet. Key changes: - Bump eslint to ^9.0.0 in all packages - Bump @typescript-eslint/* to ^8.0.0 (supports ESLint 9) - Bump @react-native/eslint-config to 0.84.1 (ESLint 9 compatible deps) - Replace deprecated @typescript-eslint/ban-types with new v8 rules - Replace @typescript-eslint/no-var-requires with no-require-imports - Set caughtErrors: 'none' for no-unused-vars (v8 changed default) - Add ESLINT_USE_FLAT_CONFIG=false to lint/fix scripts - Auto-fix prefer-optional-chain violations - Force eslint-plugin-ft-flow to ^3.0.0 via resolution (ESLint 9 compat) Ref: #5594 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ffeaf69 to
d09f643
Compare
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.
📢 Type of change
📜 Description
Upgrades ESLint from v8 to v9 (latest 9.39.4) across all workspaces. This is based on the dependabot PR #5594 but done manually to handle the breaking changes properly.
Key changes:
^8.x→^9.0.0in all packages^5.x/^7.x→^8.0.0(required for ESLint 9 compatibility)0.84.1(has ESLint 9-compatible sub-dependencies)^3.0.0via resolution (v2 uses removed ESLint 9 APIs).eslintrc.jsconfigs are kept as-is, usingESLINT_USE_FLAT_CONFIG=falsesince upstream@sentry-internal/eslint-config-sdkhasn't migrated to flat config yetban-types→ replaced byno-empty-object-type,no-wrapper-object-types,no-unsafe-function-typeno-var-requires→no-require-imports(disabled for RN code which uses dynamic requires)no-unused-varscatch clause behavior changed (setcaughtErrors: 'none'to match v5 behavior)prefer-optional-chainviolations (safe code improvements)complexityviolations newly surfaced by ESLint 9's stricter countingWhy not ESLint 10?
ESLint 10.0.3 exists but is very new. Going from v8 to v10 in one jump would be two major versions. The
@sentry-internal/eslint-config-sdkupstream hasn't even migrated to ESLint 9 flat config yet, so ESLint 10 (which fully removes legacy config support) would require a much bigger effort. Better to do 9 now and 10 separately later.💡 Motivation and Context
ESLint 8 is deprecated and no longer receiving updates. ESLint 9 brings performance improvements and is required for newer plugin versions.
Fixes #5600
Ref: #5594
💚 How did you test it?
yarn build— passesyarn test— passesyarn circularDepCheck— passesESLINT_USE_FLAT_CONFIG=falselint verified for:packages/core— same 7 pre-existing issues as ESLint 8 (5no-explicit-anyerrors + 2import/no-duplicateswarnings)samples/react-native— cleansamples/expo— cleansamples/react-native-macos— clean📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
.eslintrc.jsto flat config (eslint.config.js) once@sentry-internal/eslint-config-sdksupports it