rfellows opened a new pull request, #11043: URL: https://github.com/apache/nifi/pull/11043
# Summary [NIFI-15704](https://issues.apache.org/jira/browse/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 and with the same approach used in the Openflow UI repo (commit `6eacfd16`). 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** - Related work: parity with Openflow UI ESLint 10 / flat config work (`6eacfd16`) ## Screenshots Not applicable (tooling and non-visual refactors). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
