chore: migrate findable-ui eslint to flat config (#926)#936
Merged
Conversation
Replaces the legacy .eslintrc.json + .eslintignore setup with eslint.config.mjs using FlatCompat to wrap legacy plugin extends (next, storybook, sonarjs, eslint-comments). Stays on ESLint 8.57 with the `ESLINT_USE_FLAT_CONFIG=true` env var opt-in; the ESLint 9 bump and cascading plugin updates are scoped to #932 (eslint-config-next v16). The .storybook/main.ts sort-keys violation was pre-existing — legacy ESLint silently auto-ignored dot-directories. Flat config doesn't, so it surfaced and was fixed with a one-line key reorder. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates this library’s ESLint setup from legacy .eslintrc.json / .eslintignore to ESLint flat config (eslint.config.mjs) while staying on ESLint 8 (using ESLINT_USE_FLAT_CONFIG=true)—a prerequisite step for the later eslint-config-next v16 / ESLint 9+ upgrade path.
Changes:
- Added
eslint.config.mjsusingFlatCompatto mirror the existing rule set and overrides. - Updated the
lintscript and added required devDependencies for flat config (@eslint/eslintrc,@eslint/js). - Removed legacy ESLint config files and fixed one
.storybook/main.tskey-order violation exposed by flat config.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates lint script to enable flat config under ESLint 8; adds flat-config helper devDependencies. |
| package-lock.json | Locks new @eslint/eslintrc / @eslint/js dependency graph changes. |
| eslint.config.mjs | Introduces the flat ESLint configuration (via FlatCompat) and preserves key overrides. |
| .storybook/main.ts | Reorders object keys to satisfy sort-keys now that dot-directories are linted. |
| .eslintrc.json | Removed legacy ESLint configuration. |
| .eslintignore | Removed legacy ignore file; ignores are now in eslint.config.mjs. |
The legacy override matched only **/*.test.ts, missing the 16 .test.tsx component tests under /tests/. Widen the glob so the no-explicit-any and no-duplicate-string relaxations apply consistently to all test files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
NoopDog
approved these changes
May 26, 2026
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
Closes #926
Migrates findable-ui's ESLint configuration from the legacy
.eslintrc.json+.eslintignoreto flat config (eslint.config.mjs). Prerequisite for #932 (eslint-config-nextv16, which requires flat config).Approach
eslint.config.mjsthat usesFlatCompat(@eslint/eslintrc+@eslint/js) to wrap legacy plugin extends —next,storybook-recommended,sonarjs-recommended,eslint-comments-recommended,prettier,@typescript-eslint/recommended.@typescript-eslint/explicit-function-return-typewith.styles.ts(x)exclusion,no-explicit-anyoff for tests) preserved as flat-config blocks withfiles/ignoreskeys..eslintignoremigrated toignores: ["**/node_modules/**", "**/out/**", "**/.next/**", "lib/**"]in the first config block.ESLINT_USE_FLAT_CONFIG=trueenv-var prefix on thelintscript. The ESLint 9 bump and the cascading plugin updates (sonarjs, perfectionist swap, eslint-comments fork, sort-destructure-keys bump) are scoped to [P1.7] Next.js 16 prep: bump eslint-config-next + @next/eslint-plugin-next to v16 #932.One pre-existing issue surfaced
.storybook/main.tshad asort-keysviolation that legacy ESLint silently allowed — legacy auto-ignored dot-directories by default. Flat config doesn't, so the violation now triggers. Fixed with a one-line key reorder (no behavior change).Verification
npm run lintexits 0 (only the pre-existing informational "Pages directory not found" warning).npm run check-formatpasses.npx tsc --noEmitpasses.npm testpasses (50/50 suites, 427/427 tests).Follow-ups (out of scope for this PR)
@typescript-eslint/eslint-plugin,eslint-plugin-jsdoc,eslint-plugin-react-hooks).Part of #884.