Skip to content

fix(ui): make npm run lint actually run - #108

Open
Joaquín Rivero (jQuinRivero) wants to merge 1 commit into
mainfrom
v-joaquinri/fix-eslint-flat-config
Open

fix(ui): make npm run lint actually run#108
Joaquín Rivero (jQuinRivero) wants to merge 1 commit into
mainfrom
v-joaquinri/fix-eslint-flat-config

Conversation

@jQuinRivero

Copy link
Copy Markdown
Contributor

npm run lint has not linted anything since ESLint was raised to 9. There are two independent breakages, and both stop it before it reads a single source file.

1. Config format. ESLint 9 no longer reads .eslintrc.*:

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

So the script has been reporting a configuration error rather than a lint result. This translates the existing config to the flat format — same extends, same rules, same ignores, same React version. Nothing about how the project is linted changes.

2. A broken dependency resolution. With the config fixed it still fails, further in:

TypeError: expand is not a function
    at Minimatch.braceExpand (node_modules/minimatch/minimatch.js:271:10)

The brace-expansion override pins ^5 everywhere. minimatch@3 — depended on by both eslint and eslint-plugin-react — calls it as a function, while v5 exports a namespace. Scoping the override so minimatch@3 resolves 1.1.18 keeps the ReDoS fix the override was raised for and restores the call shape minimatch expects. Everything else stays on v5, and npm audit still reports no advisory for it.

After this

Lint runs, and reports 253 pre-existing errors. They are deliberately left alone.

Most come from rules that eslint-plugin-react-hooks 7 introduced (immutability, set-state-in-effect, purity). The largest single group flags Component.propTypes = {} written inside the component body — a convention used in 72 files in this repository. Fixing those is a decision about the codebase rather than part of repairing the tooling, and bundling them would bury this change.

Worth knowing: lint runs with --max-warnings 0, so it will fail until those are addressed. It was already failing, with a far less informative message.

Verification

  • npm ci && npm run lint — runs, and reports lint results rather than a config error
  • npm run build — unaffected
  • node --test src/Components/Home/ongoingJobs.test.js — 3 passed

`npm run lint` has not linted anything since ESLint was raised to 9.
Two independent breakages, both of which stop it before it reads a source
file.

ESLint 9 no longer reads `.eslintrc.*`. It exits with "couldn't find an
eslint.config.(js|mjs|cjs) file", so the script reports a configuration
error rather than a lint result. The configuration is translated to the flat
format here -- same extends, same rules, same ignores, same React version.
Nothing about how the project is linted changes.

With that fixed it still fails, further in: `TypeError: expand is not a
function`. The `brace-expansion` override pins ^5 everywhere, and
`minimatch@3` -- which ESLint and eslint-plugin-react both depend on --
calls it as a function, while v5 exports a namespace. Scoping the override
so minimatch 3.x resolves 1.1.18 keeps the ReDoS fix the override was raised
for and restores the call shape minimatch expects. Everything else stays on
v5.

Lint now runs, and reports 253 pre-existing errors. They are left alone
deliberately: most come from rules that eslint-plugin-react-hooks 7
introduced (`immutability`, `set-state-in-effect`, `purity`), and the
largest group flags `Component.propTypes = {}` written inside the component
body -- a convention used in 72 files here. Fixing those is a decision about
the codebase, not part of repairing the tooling, and bundling them would
bury this change.

Note that `lint` runs with `--max-warnings 0`, so it will fail until those
are addressed. It was already failing, with a less informative message.
@jQuinRivero
Joaquín Rivero (jQuinRivero) requested a review from a team as a code owner August 7, 2026 12:40

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

Restores ESLint 9 lint execution for the React UI.

Changes:

  • Migrates ESLint configuration to flat config.
  • Adds a scoped brace-expansion compatibility override for minimatch@3.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
ui/.eslintrc.cjs Removes obsolete legacy configuration.
ui/eslint.config.js Adds ESLint 9 flat configuration.
ui/package.json Adds the scoped dependency override.
ui/package-lock.json Locks the compatible dependency tree.
Files not reviewed (1)
  • ui/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ui/eslint.config.js
Comment on lines +12 to +13
import js from "@eslint/js";
import globals from "globals";
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.

3 participants