chore(ui): migrate ESLint to flat eslint.config.ts with typescript-eslint and import-x#11352
Open
pfe-nazaries wants to merge 4 commits into
Open
chore(ui): migrate ESLint to flat eslint.config.ts with typescript-eslint and import-x#11352pfe-nazaries wants to merge 4 commits into
pfe-nazaries wants to merge 4 commits into
Conversation
Contributor
🔒 osv-scanner: 2 finding(s) in
|
| Severity | ID | Package | Version | Summary |
|---|---|---|---|---|
| 🟠 HIGH (7.5) | GHSA-w5hq-g745-h8pq |
npm/uuid |
10.0.0 |
uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided |
| 🟠 HIGH (7.5) | GHSA-w5hq-g745-h8pq |
npm/uuid |
9.0.1 |
uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided |
To accept a finding, add an [[IgnoredVulns]] entry to osv-scanner.toml at the repo root with a reason and ignoreUntil.
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Contributor
|
✅ All necessary |
added 3 commits
May 25, 2026 13:48
…lint and import-x Convert ui/eslint.config.mjs to ui/eslint.config.ts and switch to the typescript-eslint meta-package via tseslint.config(), replacing the separate @typescript-eslint/eslint-plugin and @typescript-eslint/parser entries. Enable projectService with tsconfigRootDir: import.meta.dirname so the parser uses the canonical TS project graph; one duplicate test file (events-timeline.test.tsx) is opted into allowDefaultProject because TypeScript skips it in favor of its .ts sibling. Replace eslint-plugin-prettier (which proxies Prettier through ESLint rules) with eslint-config-prettier/flat so Prettier only disables conflicting rules. Replace eslint-plugin-simple-import-sort and eslint-plugin-unused-imports with eslint-plugin-import-x using the recommended + typescript flat configs, wire up the import-x resolver-next chain via eslint-import-resolver-typescript + createNodeResolver, and add jiti so ESLint can load the .ts config. The migration is intentionally behavior-preserving: import-x/export is disabled to keep parity with the legacy config (pre-existing duplicate exports stay tracked for the canonical Base layer PR), eslint.config.ts is excluded from tsc and ignored by ESLint, and lint:check stays under the --max-warnings 40 budget.
Re-sort imports and consolidate duplicate React imports to satisfy the new import-x/order rule from eslint-plugin-import-x's recommended + typescript configs. The rule enforces alphabetical sort within groups (builtin / external / internal / parent / sibling / index) and a blank line between groups, replacing the prior simple-import-sort layout. Pure auto-fix output from `pnpm run lint:fix` — no runtime changes.
Contributor
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
666bbc7 to
41e8178
Compare
| import { useTheme } from "next-themes"; | ||
| import { FC } from "react"; | ||
| import React from "react"; | ||
| import React, { FC } from "react"; |
Contributor
There was a problem hiding this comment.
Maybe we can use this opportunity to remove this kind of imports (import React)
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.
Context
The legacy
ui/eslint.config.mjswas an early flat-config port: it still glued together hand-imported plugins (@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-plugin-prettier,eslint-plugin-simple-import-sort,eslint-plugin-unused-imports) and didn't use type-aware linting. This PR consolidates that config onto the canonical flat-config primitives and prepares the workspace for type-aware rules without changing any product behavior.Description
ui/eslint.config.mjs→ui/eslint.config.tsand wires it throughtseslint.config(...)so we can use the typescript-eslint meta-package and TS types in the config itself.@typescript-eslint/eslint-plugin+@typescript-eslint/parserentries withtypescript-eslint. EnablesparserOptions.projectServicewithtsconfigRootDir: import.meta.dirnameso the parser uses the canonical TS project graph.events-timeline.test.tsxis opted intoallowDefaultProjectbecause TypeScript skips it in favor of its.tssibling.eslint-plugin-prettier(which runs Prettier through ESLint) witheslint-config-prettier/flat(which only disables conflicting rules).eslint-plugin-simple-import-sort+eslint-plugin-unused-importsintoeslint-plugin-import-xusing its recommended + typescript flat configs. Wires the resolver chain viacreateTypeScriptImportResolver+createNodeResolverand addsjitiso ESLint can load the.tsconfig.eslint.config.tstotsconfig.jsonexcludeand to the ESLint own ignore list to keep it out of the typecheck/lint passes.eslint --fixfor the newimport-x/orderrule across the workspace (alphabetised, blank lines between groups). All churn is purely import grouping/consolidation — no runtime code changes.ui/CHANGELOG.mdentry under[1.28.0]/🔄 Changed.The migration is intentionally behavior-preserving:
import-x/exportis kept off so pre-existing duplicate exports stay tracked separately, andlint:checkstays under the existing--max-warnings 40budget.Steps to review
pnpm install(regenerates the lockfile entries for the new plugins).pnpm run lint:checkshould pass under--max-warnings 40.pnpm run typecheckshould pass.ui/eslint.config.tsand compare with the previous.mjsto confirm there are no rule changes other than the documented ones.ui/components/findings/table/resource-detail-drawer/resource-detail-drawer-content.tsx,ui/components/ui/sidebar/sidebar.tsx) — the only edits are import consolidation and blank lines between import groups.Checklist
Community Checklist
SDK/CLI
UI
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.