Skip to content

chore: migrate findable-ui eslint to flat config (#926)#936

Merged
NoopDog merged 2 commits into
mainfrom
fran/926-eslint-flat-config
May 26, 2026
Merged

chore: migrate findable-ui eslint to flat config (#926)#936
NoopDog merged 2 commits into
mainfrom
fran/926-eslint-flat-config

Conversation

@frano-m

@frano-m frano-m commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #926

Migrates findable-ui's ESLint configuration from the legacy .eslintrc.json + .eslintignore to flat config (eslint.config.mjs). Prerequisite for #932 (eslint-config-next v16, which requires flat config).

Approach

  • New eslint.config.mjs that uses FlatCompat (@eslint/eslintrc + @eslint/js) to wrap legacy plugin extends — next, storybook-recommended, sonarjs-recommended, eslint-comments-recommended, prettier, @typescript-eslint/recommended.
  • Top-level overrides (@typescript-eslint/explicit-function-return-type with .styles.ts(x) exclusion, no-explicit-any off for tests) preserved as flat-config blocks with files/ignores keys.
  • .eslintignore migrated to ignores: ["**/node_modules/**", "**/out/**", "**/.next/**", "lib/**"] in the first config block.
  • Stays on ESLint 8.57 with ESLINT_USE_FLAT_CONFIG=true env-var prefix on the lint script. 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.ts had a sort-keys violation 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 lint exits 0 (only the pre-existing informational "Pages directory not found" warning).
  • npm run check-format passes.
  • npx tsc --noEmit passes.
  • npm test passes (50/50 suites, 427/427 tests).

Follow-ups (out of scope for this PR)

Part of #884.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mjs using FlatCompat to mirror the existing rule set and overrides.
  • Updated the lint script and added required devDependencies for flat config (@eslint/eslintrc, @eslint/js).
  • Removed legacy ESLint config files and fixed one .storybook/main.ts key-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.

Comment thread 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>
@frano-m frano-m marked this pull request as ready for review May 25, 2026 08:22
@frano-m frano-m changed the base branch from fran/884-nextjs-16-upgrade to main May 26, 2026 00:19
@frano-m frano-m marked this pull request as draft May 26, 2026 00:19
@frano-m frano-m marked this pull request as ready for review May 26, 2026 00:19
Copilot AI review requested due to automatic review settings May 26, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

@NoopDog NoopDog merged commit 745c127 into main May 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P0.2] Next.js 16 prep: migrate findable-ui ESLint to flat config

3 participants