chore(deps): upgrade eslint to 10 and @ver0/eslint-config to 1.7#1688
Open
xobotyi wants to merge 1 commit into
Open
chore(deps): upgrade eslint to 10 and @ver0/eslint-config to 1.7#1688xobotyi wants to merge 1 commit into
xobotyi wants to merge 1 commit into
Conversation
@ver0/eslint-config 1.7 moved plugins from bundled dependencies to optional peers and replaced buildConfig() with per-preset modules, so the used presets' plugins become direct devDependencies and eslint.config.js switches to defineConfig() composition. eslint-plugin-react 7.x still calls context APIs removed in eslint 10 (getFilename via react version auto-detection, getSourceCode in rule factories); wrapped with @eslint/compat fixupPluginRules and pinned settings.react.version to skip the detection path. New-rule fallout: - react-hooks/refs disabled for src: render-time ref access is the core mechanism of this library (useSyncedRef, useFirstMountState, usePrevious and co). - react-hooks/set-state-in-effect, react-hooks/use-memo: per-line disables where the pattern is deliberate. - @typescript-eslint/strict-void-return disabled for tests; terse value-returning arrows are idiomatic there. - vitest/no-conditional-expect: SSR tests guarded expects behind 'if (result.value !== undefined)' narrowing, silently passing when value is undefined; replaced with expectResultValue() which asserts. - useStorageValue: no-unnecessary-type-assertion autofix removed the 'as typeof actions.current.set' assertion; typed the parameter explicitly instead. - require-unicode-regexp now demands the v flag; max-nested-callbacks fixed by extracting a factory in usePermission test.
Contributor
Author
|
Parked pending the planned migration of linting to oxc — vitest 4 (#1689) and TypeScript 7 (#1691) were restructured off this stack and merged to master directly. If the oxc migration lands first, this PR can be closed; the non-lint fixes it carries (SSR test conditional-expect cleanup, useStorageValue set() typing) may be worth cherry-picking either way. |
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.
Upgrades
eslint9.37.0 → 10.7.0 and@ver0/eslint-config1.3.6 → 1.7.1, with the config migration and lint fallout that entails.Packaging/config migration
@ver0/eslint-config1.7 moved all plugins from bundled dependencies to optional peers — the presets this repo uses (javascript, typescript, react, browser, json, markdown, vitest, prettier) now require their plugins as direct devDependencies (~20 added).buildConfig()was replaced by per-preset modules;eslint.config.jsnow composes them viadefineConfig().eslint 10 compat
eslint-plugin-react7.x (latest; peer of xo-react) still calls context APIs removed in eslint 10 —context.getFilename()via React version auto-detection andcontext.getSourceCode()in rule factories. Handled by:settings.react.version(skips the detection path), andfixupPluginRulesfrom@eslint/compat(targeted — a globalfixupConfigRuleswrap breaks@eslint/markdown's language-plugin rules).fixupPluginRuleswrap (or the version-setting pin) insideconfigs/react.jsso consumers don't have to.New-rule fallout
react-hooks/refs(react-hooks 7 via xo-react 0.29) disabled for src — render-time ref access is the core mechanism of this library (useSyncedRef,useFirstMountState,usePrevious, …).react-hooks/set-state-in-effect/react-hooks/use-memo— per-line disables where the pattern is deliberate (usePermission,useCustomCompareMemo).@typescript-eslint/strict-void-returndisabled for test files (36 hits, all idiomatic terse arrows in tests).vitest/no-conditional-expect— real find: 4 SSR test files guarded expects behindif (result.value !== undefined), silently passing when value is undefined; replaced with the assertingexpectResultValue()helper.require-unicode-regexp(v flag),max-nested-callbacks, prettier reflows, redundant-assertion autofixes.Supersedes #1684.
Verification: lint 0 problems, build clean, 527/527 tests pass.