chore(deps): migrate to ESLint 9 with flat config#17108
Open
chore(deps): migrate to ESLint 9 with flat config#17108
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ac73379 to
6f3f154
Compare
46b5dc5 to
46744b4
Compare
46744b4 to
fc7b3f3
Compare
- Update ESLint from v8 to v9.26.0
- Convert .eslintrc.js to eslint.config.js (flat config)
- Update @typescript-eslint/* to v8.32.1
- Update eslint-config-next to v16.0.0
- Add @eslint/js and @eslint/eslintrc for FlatCompat
- Add globals package for environment globals
Breaking changes from eslint-config-sentry-docs handled via overrides:
- Disable deprecated @typescript-eslint/ban-types (replaced with new rules)
- Disable incompatible no-lookahead-lookbehind-regexp rule
- Enable replacement rules: no-empty-object-type, no-unsafe-function-type, no-wrapper-object-types
Code fixes:
- Replace 'catch (e)' with 'catch' for unused error variables
- Remove deprecated eslint-env comments
- Fix {} type usage with proper Record<string, unknown> or unknown
- Remove unused eslint-disable comments
Resolves security alerts for minimatch, flatted, and ajv by using
ESLint 9's native globbing instead of minimatch.
fc7b3f3 to
e31d3f4
Compare
…d flat config - Remove eslint-config-sentry-docs (abandoned package from getsentry/eslint-config-sentry) - Remove @eslint/eslintrc (no longer needed without FlatCompat) - Add direct ESLint plugin dependencies: eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-import, eslint-plugin-simple-import-sort, globals - Rewrite eslint.config.js as fully self-contained flat config - Remove eslint-plugin-react-hooks pnpm override (now a direct dependency) - Auto-fix import sorting across all source files This completes the ESLint 9 migration by eliminating the dependency on the abandoned eslint-config-sentry-docs package. All rules from the original config have been incorporated directly into the flat config. Tests pass (149 tests), ESLint passes (0 errors, 57 warnings for pre-existing any types), and TypeScript type checking passes.
…try-docs - Add @typescript-eslint/no-shadow and no-redeclare (from sentry-docs config) - Add full React rules from eslint-config-sentry-react/rules/react.js - Add full import rules from eslint-config-sentry-react/rules/imports.js - Update react-hooks/exhaustive-deps to 'error' (matching original) - Add react/function-component-definition rule - Add import/no-anonymous-default-export rule This brings the config closer to the original eslint-config-sentry-docs behavior. Warnings reduced from 57 to 23 (remaining are Next.js suggestions, not sentry rules).
Move no-shadow rule to JS-only config block to prevent the main config block from re-enabling it for TypeScript files (which would override the TypeScript block's 'no-shadow': 'off' setting and cause false positives on type declarations, enums, and generics).
The eslint.config.js imports @typescript-eslint/eslint-plugin and @typescript-eslint/parser directly, which are already listed as separate devDependencies. The typescript-eslint meta-package was not being used.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
'next lint' is deprecated in Next.js 15.5 and will be removed in v16. It also requires eslint-config-next to be installed even when using a custom eslint.config.js. Changed 'pnpm lint' to run all linters (eslint + prettier + ts) as documented in AGENTS.md, instead of duplicating lint:eslint.
9de1861 to
3de2cf1
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.

Summary
Migrates sentry-docs to ESLint 9 with flat config and removes the abandoned
eslint-config-sentry-docsdependency, replacing it with a self-contained configuration.Changes
ESLint 9 Migration
.eslintrc.jstoeslint.config.js(flat config format)@typescript-eslint/*packages to v8.32.1.eslintrc.jsand.eslintignore(replaced by flat config)Remove eslint-config-sentry-docs
The
eslint-config-sentry-docspackage fromgetsentry/eslint-config-sentryhas been abandoned and is incompatible with ESLint 9. This PR removes the dependency and inlines all rules directly:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-import,eslint-plugin-simple-import-sort,globals@eslint/eslintrc(no longer needed without FlatCompat)eslint-config-sentry/rules/base.jseslint-config-sentry-react/rules/react.jseslint-config-sentry-react/rules/imports.jseslint-config-sentry-docs/index.jsBreaking Changes Handled
@typescript-eslint/ban-typesremoved in v8 → replaced withno-empty-object-type,no-unsafe-function-type,no-wrapper-object-typeseslint-plugin-no-lookahead-lookbehind-regexpincompatible with ESLint 9 → removed (was used to prevent Safari crashes, but Safari now supports lookbehind)Security Fixes
minimatch: "^9.0.0"to pnpm overrides, eliminating vulnerable minimatch v3 from the dependency treeCode Fixes
simple-import-sorteslint-disablecommentscatch (e)→catchfor unused error variables{}type usage with proper alternativesTesting
pnpm lint:eslint- 0 errors, 23 warnings (all Next.js suggestions)pnpm lint:ts- passespnpm test:ci- 149 tests passing