4bbd4b1adc
## Current Behavior The nx repo uses the legacy eslintrc format (`.eslintrc.json`, `.eslintignore`) with ESLint v8 and outdated plugin versions. Several of those plugins ship code that crashes under ESLint v9 (`context.getScope` removed, etc.), and the `@nx/eslint` / `@nx/eslint-plugin` sources still reference APIs removed in v9 (`Linter.defineParser`, `Linter.defineRule`, classic `Linter.Config` shape). ## Expected Behavior Every project in the repo uses an `eslint.config.mjs` flat config, the ESLint ecosystem is on the latest v9-compatible versions, and `@nx/eslint` / `@nx/eslint-plugin` sources compile and test cleanly against the v9 type split. ### Main changes - Replaced every `.eslintrc.json` / `.eslintignore` with an `eslint.config.mjs`. - Rewrote the root `eslint.config.mjs`: - Exports a named `baseConfig` that leaf configs import, plus a default export that opts out of linting (`**/*` ignored) so the root acts as a shared base and isn't lint-checked directly. - Drops `FlatCompat` in favor of native plugin imports. - Exports shared `reactHooksV7Off`, `e2eTestOnlyIgnores`, and a `storybookConfigs` wrapper that filters v10's preset down to `storybook/*` rules (the preset references foreign rules like `import-x/*` that we don't register). - Cleaned up leaf configs emitted by the generator: deduplicated file entries, merged split `package.json` blocks, fixed the jsonc parser namespace import after v3 dropped its default export. - Scoped the 15 e2e projects to `*.test.ts` files only via a shared export. - Bumped the ESLint ecosystem to the latest v9-compatible versions: `eslint@^9.39.4`, `@eslint/js@^9.39.4`, `@typescript-eslint/*@^8.58.2`, `eslint-plugin-storybook@^10.3.5`, `eslint-plugin-react-hooks@^7.1.0`, `eslint-plugin-jsx-a11y@^6.10.2`, `eslint-plugin-import@^2.32.0`, `eslint-plugin-playwright@^2.10.1`, `eslint-plugin-cypress@^6.3.1`, `eslint-plugin-jest@^29.15.2`, `toml-eslint-parser@^1.0.3`, `jsonc-eslint-parser@^3.1.0`, `angular-eslint@^21.3.1`. Dropped `@eslint/eslintrc`, `@types/eslint`, `@types/eslint__js`. - Aligned `@nx/eslint` source with the v9 type split: `Linter.Config` → `Linter.LegacyConfig`, `ESLint.Options` → `ESLint.LegacyOptions` wherever the underlying shape is eslintrc. - Rewrote `@nx/eslint-plugin` rule specs (`dependency-checks`, `enforce-module-boundaries`) as flat-config inline tests since `Linter.defineParser`/`defineRule` were removed in v9. - Aligned react/angular/expo/react-native add-linting helpers with the v9 type split. - Migrated `tools/eslint-rules` specs from `TSESLint.RuleTester` (legacy config, rejected by v9's flat Linter) to `@typescript-eslint/rule-tester`; added `isolatedModules: true` so ts-jest resolves the new types under `module: node16`. - Downgraded the new react-hooks v7 rules to `off` via a shared export so the migration doesn't require rewriting legacy code. - Auto-fixed unused eslint-disable directives (`linterOptions.reportUnusedDisableDirectives` defaults to warn in v9). - Ignored `packages/workspace/**/__fixtures__/**` in lint and updated the affected snapshot so the fixture matches what the jest generator templates actually emit. ### Note on ESLint v10 This PR stays on ESLint v9. A few plugins we rely on (`eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react`) still don't declare v10 peer support. The jump to v10 will happen in a follow-up PR once those plugins publish v10-compatible releases.
16 lines
546 B
TypeScript
16 lines
546 B
TypeScript
/**
|
|
* The Nx Devkit is the underlying technology used to customize Nx to support
|
|
* different technologies and custom use-cases. It contains many utility
|
|
* functions for reading and writing files, updating configuration,
|
|
* working with Abstract Syntax Trees(ASTs), and more.
|
|
*
|
|
* As with most things in Nx, the core of Nx Devkit is very simple.
|
|
* It only uses language primitives and immutable objects
|
|
* (the tree being the only exception).
|
|
*
|
|
* @module @nx/devkit
|
|
*/
|
|
|
|
export * from 'nx/src/devkit-exports';
|
|
export * from './public-api';
|