NIFI-15704 - Upgrade eslint from 8 to 10#11043
Merged
mcgilman merged 4 commits intoapache:mainfrom Mar 31, 2026
Merged
Conversation
Also removed d3 'self=this' lint issues
Contributor
|
Reviewing... |
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
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.jsonto 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, andshared.The largest functional code changes are in flow-designer D3 services: removal of the
const self = this/functioncallback pattern in favor of arrow functions and explicit element access, which satisfies@typescript-eslint/no-this-aliaswithout suppressing the rule.What's Changed
Tooling and configuration
eslintfrom8.57.0to^10.0.3and refresheslint-config-prettier/eslint-plugin-prettier@typescript-eslint/eslint-plugin,@typescript-eslint/parser, and@typescript-eslint/utilsfrom7.18.0to8.57.1; addtypescript-eslint(^8.40.0)@eslint/eslintrc,@eslint/js, andglobalsfor flat config, recommended presets, Jest globals, andFlatCompatbridging of legacyextendschainspackage.jsonoverridesentry for@humanwhocodes/config-array/minimatch(no longer needed with ESLint 10's dependency tree)engines.nodeto^20.19.0 || ^22.13.0 || >=24.0.0to match ESLint 10's engine requirementsFlat config migration
.eslintrc.jsonand add rooteslint.config.mjsusingFlatCompat,@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.*viaglobals.jest.eslintrc.jsonwitheslint.config.mjs(same rule intent:@nx/angular, recommended sets, Angular ESLint, Prettier; project-specific selector and relaxation rules preserved;no-unused-varsconfigured with_ignore patterns includingcaughtErrorsIgnorePattern)nx.jsonso@nx/eslint:lintcache inputs and production filesets referenceeslint.config.mjsinstead of.eslintrc.jsonApplication / library source fixes
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 avoidno-this-alias: use arrow callbacks,.each((_d, i, nodes) => …)withnodes[i],.on('click', (event) => …)withevent.currentTarget, andd3.drag().subject(function (this: Element) { return { element: this }; })so drag handlers can useevent.subject.element*Definitionstate types)catchparameters with_(app.module.ts,registry-auth.service.ts, shared storage services)let retVal: numberinstead of initializing to0where the first branch assigns, to avoidno-unused-varson the initializer (multiple table components)content-viewer,standard-content-viewer,flow-status,user-access-policies, shared Codemirror spec) for lint cleanlinessTesting / Verification
nx run-many -t lintfor all 6 projects — 0 errors, 0 warningsScreenshots
Not applicable (tooling and non-visual refactors).