Skip to content

NIFI-15704 - Upgrade eslint from 8 to 10#11043

Merged
mcgilman merged 4 commits intoapache:mainfrom
rfellows:NIFI-15704
Mar 31, 2026
Merged

NIFI-15704 - Upgrade eslint from 8 to 10#11043
mcgilman merged 4 commits intoapache:mainfrom
rfellows:NIFI-15704

Conversation

@rfellows
Copy link
Copy Markdown
Contributor

@rfellows rfellows commented Mar 25, 2026

Summary

NIFI-15704

Description

Upgrades the NiFi frontend Nx workspace (nifi-frontend/src/main/frontend) from ESLint 8 to ESLint 10 and migrates all project-level configuration from legacy .eslintrc.json to the flat config format (eslint.config.mjs). This aligns the toolchain with current ESLint releases.

The upgrade required dependency updates (notably @typescript-eslint/* and Prettier-related ESLint packages), Nx cache input updates, and a set of source fixes so lint completes with zero errors and zero warnings across all six frontend projects: nifi, nifi-registry, nifi-jolt-transform-ui, standard-content-viewer, update-attribute, and shared.

The largest functional code changes are in flow-designer D3 services: removal of the const self = this / function callback pattern in favor of arrow functions and explicit element access, which satisfies @typescript-eslint/no-this-alias without suppressing the rule.

What's Changed

Tooling and configuration

  • Bump eslint from 8.57.0 to ^10.0.3 and refresh eslint-config-prettier / eslint-plugin-prettier
  • Bump @typescript-eslint/eslint-plugin, @typescript-eslint/parser, and @typescript-eslint/utils from 7.18.0 to 8.57.1; add typescript-eslint (^8.40.0)
  • Add @eslint/eslintrc, @eslint/js, and globals for flat config, recommended presets, Jest globals, and FlatCompat bridging of legacy extends chains
  • Remove package.json overrides entry for @humanwhocodes/config-array / minimatch (no longer needed with ESLint 10's dependency tree)
  • Adjust engines.node to ^20.19.0 || ^22.13.0 || >=24.0.0 to match ESLint 10's engine requirements

Flat config migration

  • Delete workspace root .eslintrc.json and add root eslint.config.mjs using FlatCompat, @eslint/js, @nx/eslint-plugin, Nx module boundary rules, compat.config({ extends: ['plugin:@nx/typescript' | 'plugin:@nx/javascript'] }) with file globs, and Jest globals for *.spec.* via globals.jest
  • Replace each app/library .eslintrc.json with eslint.config.mjs (same rule intent: @nx/angular, recommended sets, Angular ESLint, Prettier; project-specific selector and relaxation rules preserved; no-unused-vars configured with _ ignore patterns including caughtErrorsIgnorePattern)
  • Update nx.json so @nx/eslint:lint cache inputs and production filesets reference eslint.config.mjs instead of .eslintrc.json

Application / library source fixes

  • D3 / flow-designer: Refactor behavior and manager services (connectable-behavior, draggable-behavior, quick-select-behavior, selectable-behavior, birdseye-view, canvas-view, canvas-utils, connection-manager, label-manager, port-manager, process-group-manager, remote-process-group-manager) to avoid no-this-alias: use arrow callbacks, .each((_d, i, nodes) => …) with nodes[i], .on('click', (event) => …) with event.currentTarget, and d3.drag().subject(function (this: Element) { return { element: this }; }) so drag handlers can use event.subject.element
  • TypeScript ESLint 8: Replace empty marker interfaces with type aliases where required (*Definition state types)
  • Unused bindings: Prefix unused catch parameters with _ (app.module.ts, registry-auth.service.ts, shared storage services)
  • Sort comparators: Use let retVal: number instead of initializing to 0 where the first branch assigns, to avoid no-unused-vars on the initializer (multiple table components)
  • Specs / small fixes: Minor test and component adjustments (content-viewer, standard-content-viewer, flow-status, user-access-policies, shared Codemirror spec) for lint cleanliness

Testing / Verification

  • nx run-many -t lint for all 6 projects — 0 errors, 0 warnings

Screenshots

Not applicable (tooling and non-visual refactors).

Also removed d3 'self=this' lint issues
@rfellows rfellows added the ui Pull requests for work relating to the user interface label Mar 25, 2026
@mcgilman
Copy link
Copy Markdown
Contributor

Reviewing...

Copy link
Copy Markdown
Contributor

@mcgilman mcgilman left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @rfellows!

@mcgilman mcgilman merged commit 8ab6078 into apache:main Mar 31, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Pull requests for work relating to the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants