From b30f3c59cc02e9b9ea5040d4e3d3f5189dcedc59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Fri, 20 Oct 2023 00:07:12 +0200 Subject: [PATCH] docs(linter): update docs for eslint package (#19649) --- CODEOWNERS | 4 +- docs/generated/manifests/menus.json | 39 +++++++---- docs/generated/manifests/nx-api.json | 54 ++++++++++------ docs/generated/packages-metadata.json | 42 +++++++----- .../documents/dependency-checks.md | 2 +- .../eslint-plugin/documents/overview.md | 2 +- .../packages/eslint/documents/overview.md} | 6 +- .../executors/lint.json} | 4 +- .../generators/convert-to-flat-config.json | 0 .../generators/workspace-rule.json | 2 +- .../generators/workspace-rules-project.json | 0 docs/map.json | 14 ++-- .../automate-updating-dependencies.md | 2 +- .../{linter => eslint}/dependency-checks.md | 0 .../enforce-module-boundaries.md | 0 .../{linter => eslint}/eslint-plugin.md | 0 docs/shared/packages/eslint/eslint.md | 39 +++++++++++ .../tips-n-tricks/migrating-to-flat-eslint.md | 2 +- docs/shared/reference/sitemap.md | 16 +++-- .../src/fixtures/nx-examples-task-inputs.json | 30 ++++----- .../src/assets/task-inputs/e2e-affected.json | 44 ++++++------- graph/client/src/assets/task-inputs/e2e.json | 44 ++++++------- nx-dev/nx-dev-e2e/src/packages.spec.ts | 12 ++-- nx-dev/nx-dev/redirect-rules.js | 17 +++-- packages/eslint/docs/eslint-examples.md | 12 ++-- .../eslint/docs/workspace-rule-examples.md | 4 +- .../update-17-0-0-rename-to-eslint.ts | 2 + .../__snapshots__/configuration.spec.ts.snap | 64 +++++++++---------- .../root-workspace-configuration.json | 10 +-- .../test-configs/various-projects.json | 64 +++++++++---------- .../different-target-variations.json | 2 +- .../utils/test-configs/executor-context.json | 2 +- .../__snapshots__/configuration.spec.ts.snap | 10 +-- .../test-files/angular-project.config.json | 2 +- .../react-lib-non-buildable-jest.json | 2 +- .../react-lib-non-buildable-vitest.json | 2 +- .../react-mixed-project.config.json | 2 +- .../test-files/react-project.config.json | 2 +- .../utils/test-files/web-project.config.json | 2 +- .../package-schemas/package-metadata.ts | 20 ++---- 40 files changed, 329 insertions(+), 248 deletions(-) rename docs/{shared/packages/linter/linter-plugin.md => generated/packages/eslint/documents/overview.md} (88%) rename docs/generated/packages/{linter/executors/eslint.json => eslint/executors/lint.json} (62%) rename docs/generated/packages/{linter => eslint}/generators/convert-to-flat-config.json (100%) rename docs/generated/packages/{linter => eslint}/generators/workspace-rule.json (92%) rename docs/generated/packages/{linter => eslint}/generators/workspace-rules-project.json (100%) rename docs/shared/packages/{linter => eslint}/dependency-checks.md (100%) rename docs/shared/packages/{linter => eslint}/enforce-module-boundaries.md (100%) rename docs/shared/packages/{linter => eslint}/eslint-plugin.md (100%) create mode 100644 docs/shared/packages/eslint/eslint.md diff --git a/CODEOWNERS b/CODEOWNERS index 9bf00f1c13..2147d75575 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -113,8 +113,8 @@ rust-toolchain @nrwl/nx-native-reviewers # Linter /docs/generated/packages/eslint-plugin/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers -/docs/generated/packages/linter/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers -/docs/shared/packages/linter/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers +/docs/generated/packages/eslint/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers +/docs/shared/packages/eslint/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers /packages/eslint-plugin/** @nrwl/nx-linter-reviewers /packages/eslint/** @nrwl/nx-linter-reviewers /e2e/eslint/** @nrwl/nx-linter-reviewers diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index ff313fdcbd..51373cbd06 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -6668,19 +6668,36 @@ "disableCollapsible": false }, { - "id": "linter", - "path": "/nx-api/linter", - "name": "linter", + "id": "eslint", + "path": "/nx-api/eslint", + "name": "eslint", "children": [ + { + "id": "documents", + "path": "/nx-api/eslint/documents", + "name": "documents", + "children": [ + { + "name": "Overview", + "path": "/nx-api/eslint/documents/overview", + "id": "overview", + "isExternal": false, + "children": [], + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + }, { "id": "executors", - "path": "/nx-api/linter/executors", + "path": "/nx-api/eslint/executors", "name": "executors", "children": [ { - "id": "eslint", - "path": "/nx-api/linter/executors/eslint", - "name": "eslint", + "id": "lint", + "path": "/nx-api/eslint/executors/lint", + "name": "lint", "children": [], "isExternal": false, "disableCollapsible": false @@ -6691,12 +6708,12 @@ }, { "id": "generators", - "path": "/nx-api/linter/generators", + "path": "/nx-api/eslint/generators", "name": "generators", "children": [ { "id": "workspace-rules-project", - "path": "/nx-api/linter/generators/workspace-rules-project", + "path": "/nx-api/eslint/generators/workspace-rules-project", "name": "workspace-rules-project", "children": [], "isExternal": false, @@ -6704,7 +6721,7 @@ }, { "id": "workspace-rule", - "path": "/nx-api/linter/generators/workspace-rule", + "path": "/nx-api/eslint/generators/workspace-rule", "name": "workspace-rule", "children": [], "isExternal": false, @@ -6712,7 +6729,7 @@ }, { "id": "convert-to-flat-config", - "path": "/nx-api/linter/generators/convert-to-flat-config", + "path": "/nx-api/eslint/generators/convert-to-flat-config", "name": "convert-to-flat-config", "children": [], "isExternal": false, diff --git a/docs/generated/manifests/nx-api.json b/docs/generated/manifests/nx-api.json index 48b0a0e072..5cc48a9f36 100644 --- a/docs/generated/manifests/nx-api.json +++ b/docs/generated/manifests/nx-api.json @@ -650,55 +650,67 @@ }, "path": "/nx-api/esbuild" }, - "linter": { + "eslint": { "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "linter", - "packageName": "@nx/linter", + "name": "eslint", + "packageName": "@nx/eslint", "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "documents": {}, + "documents": { + "/nx-api/eslint/documents/overview": { + "id": "overview", + "name": "Overview", + "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "file": "generated/packages/eslint/documents/overview", + "itemList": [], + "isExternal": false, + "path": "/nx-api/eslint/documents/overview", + "tags": [], + "originalFilePath": "shared/packages/eslint/eslint" + } + }, "root": "/packages/eslint", "source": "/packages/eslint/src", "executors": { - "/nx-api/linter/executors/eslint": { + "/nx-api/eslint/executors/lint": { "description": "Run ESLint on a project.", - "file": "generated/packages/linter/executors/eslint.json", + "file": "generated/packages/eslint/executors/lint.json", "hidden": false, - "name": "eslint", + "name": "lint", "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", - "path": "/nx-api/linter/executors/eslint", + "path": "/nx-api/eslint/executors/lint", "type": "executor" } }, "generators": { - "/nx-api/linter/generators/workspace-rules-project": { + "/nx-api/eslint/generators/workspace-rules-project": { "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/linter/generators/workspace-rules-project.json", + "file": "generated/packages/eslint/generators/workspace-rules-project.json", "hidden": true, "name": "workspace-rules-project", "originalFilePath": "/packages/eslint/src/generators/workspace-rules-project/schema.json", - "path": "/nx-api/linter/generators/workspace-rules-project", + "path": "/nx-api/eslint/generators/workspace-rules-project", "type": "generator" }, - "/nx-api/linter/generators/workspace-rule": { + "/nx-api/eslint/generators/workspace-rule": { "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/linter/generators/workspace-rule.json", + "file": "generated/packages/eslint/generators/workspace-rule.json", "hidden": false, "name": "workspace-rule", "originalFilePath": "/packages/eslint/src/generators/workspace-rule/schema.json", - "path": "/nx-api/linter/generators/workspace-rule", + "path": "/nx-api/eslint/generators/workspace-rule", "type": "generator" }, - "/nx-api/linter/generators/convert-to-flat-config": { + "/nx-api/eslint/generators/convert-to-flat-config": { "description": "Convert an Nx workspace's ESLint configs to use Flat Config.", - "file": "generated/packages/linter/generators/convert-to-flat-config.json", + "file": "generated/packages/eslint/generators/convert-to-flat-config.json", "hidden": false, "name": "convert-to-flat-config", "originalFilePath": "/packages/eslint/src/generators/convert-to-flat-config/schema.json", - "path": "/nx-api/linter/generators/convert-to-flat-config", + "path": "/nx-api/eslint/generators/convert-to-flat-config", "type": "generator" } }, - "path": "/nx-api/linter" + "path": "/nx-api/eslint" }, "eslint-plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", @@ -715,7 +727,7 @@ "isExternal": false, "path": "/nx-api/eslint-plugin/documents/overview", "tags": [], - "originalFilePath": "shared/packages/linter/eslint-plugin" + "originalFilePath": "shared/packages/eslint/eslint-plugin" }, "/nx-api/eslint-plugin/documents/enforce-module-boundaries": { "id": "enforce-module-boundaries", @@ -726,7 +738,7 @@ "isExternal": false, "path": "/nx-api/eslint-plugin/documents/enforce-module-boundaries", "tags": [], - "originalFilePath": "shared/packages/linter/enforce-module-boundaries" + "originalFilePath": "shared/packages/eslint/enforce-module-boundaries" }, "/nx-api/eslint-plugin/documents/dependency-checks": { "id": "dependency-checks", @@ -737,7 +749,7 @@ "isExternal": false, "path": "/nx-api/eslint-plugin/documents/dependency-checks", "tags": [], - "originalFilePath": "shared/packages/linter/dependency-checks" + "originalFilePath": "shared/packages/eslint/dependency-checks" } }, "root": "/packages/eslint-plugin", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index 56234c6157..b80d9d4617 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -645,50 +645,62 @@ }, { "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "documents": [], + "documents": [ + { + "id": "overview", + "name": "Overview", + "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "file": "generated/packages/eslint/documents/overview", + "itemList": [], + "isExternal": false, + "path": "eslint/documents/overview", + "tags": [], + "originalFilePath": "shared/packages/eslint/eslint" + } + ], "executors": [ { "description": "Run ESLint on a project.", - "file": "generated/packages/linter/executors/eslint.json", + "file": "generated/packages/eslint/executors/lint.json", "hidden": false, - "name": "eslint", + "name": "lint", "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", - "path": "linter/executors/eslint", + "path": "eslint/executors/lint", "type": "executor" } ], "generators": [ { "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/linter/generators/workspace-rules-project.json", + "file": "generated/packages/eslint/generators/workspace-rules-project.json", "hidden": true, "name": "workspace-rules-project", "originalFilePath": "/packages/eslint/src/generators/workspace-rules-project/schema.json", - "path": "linter/generators/workspace-rules-project", + "path": "eslint/generators/workspace-rules-project", "type": "generator" }, { "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/linter/generators/workspace-rule.json", + "file": "generated/packages/eslint/generators/workspace-rule.json", "hidden": false, "name": "workspace-rule", "originalFilePath": "/packages/eslint/src/generators/workspace-rule/schema.json", - "path": "linter/generators/workspace-rule", + "path": "eslint/generators/workspace-rule", "type": "generator" }, { "description": "Convert an Nx workspace's ESLint configs to use Flat Config.", - "file": "generated/packages/linter/generators/convert-to-flat-config.json", + "file": "generated/packages/eslint/generators/convert-to-flat-config.json", "hidden": false, "name": "convert-to-flat-config", "originalFilePath": "/packages/eslint/src/generators/convert-to-flat-config/schema.json", - "path": "linter/generators/convert-to-flat-config", + "path": "eslint/generators/convert-to-flat-config", "type": "generator" } ], "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "linter", - "packageName": "@nx/linter", + "name": "eslint", + "packageName": "@nx/eslint", "root": "/packages/eslint", "source": "/packages/eslint/src" }, @@ -704,7 +716,7 @@ "isExternal": false, "path": "eslint-plugin/documents/overview", "tags": [], - "originalFilePath": "shared/packages/linter/eslint-plugin" + "originalFilePath": "shared/packages/eslint/eslint-plugin" }, { "id": "enforce-module-boundaries", @@ -715,7 +727,7 @@ "isExternal": false, "path": "eslint-plugin/documents/enforce-module-boundaries", "tags": [], - "originalFilePath": "shared/packages/linter/enforce-module-boundaries" + "originalFilePath": "shared/packages/eslint/enforce-module-boundaries" }, { "id": "dependency-checks", @@ -726,7 +738,7 @@ "isExternal": false, "path": "eslint-plugin/documents/dependency-checks", "tags": [], - "originalFilePath": "shared/packages/linter/dependency-checks" + "originalFilePath": "shared/packages/eslint/dependency-checks" } ], "executors": [], diff --git a/docs/generated/packages/eslint-plugin/documents/dependency-checks.md b/docs/generated/packages/eslint-plugin/documents/dependency-checks.md index 6e8aae7bf9..1a571d8a4d 100644 --- a/docs/generated/packages/eslint-plugin/documents/dependency-checks.md +++ b/docs/generated/packages/eslint-plugin/documents/dependency-checks.md @@ -38,7 +38,7 @@ Additionally, you need to adjust your `lintFilePatterns` to include the project' "targets": { // ... more targets "lint": { - "executor": "@nx/linter:lint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/docs/generated/packages/eslint-plugin/documents/overview.md b/docs/generated/packages/eslint-plugin/documents/overview.md index 751e5efbb1..dcab3273d9 100644 --- a/docs/generated/packages/eslint-plugin/documents/overview.md +++ b/docs/generated/packages/eslint-plugin/documents/overview.md @@ -1,4 +1,4 @@ -The `@nx/linter-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as the following Nx-specific ESLint rules: +The `@nx/eslint-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as the following Nx-specific ESLint rules: - [enforce-module-boundaries](#enforce-module-boundaries-rule) - [dependency-checks](#dependency-checks-rule) diff --git a/docs/shared/packages/linter/linter-plugin.md b/docs/generated/packages/eslint/documents/overview.md similarity index 88% rename from docs/shared/packages/linter/linter-plugin.md rename to docs/generated/packages/eslint/documents/overview.md index c8f105fff5..9727103084 100644 --- a/docs/shared/packages/linter/linter-plugin.md +++ b/docs/generated/packages/eslint/documents/overview.md @@ -1,6 +1,6 @@ -The Linter plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace. +The ESLint plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace. -## Setting Up Linter +## Setting Up ESLint ### Installation @@ -32,7 +32,7 @@ nx lint my-lib ## Utils -- [convert-to-flat-config](/nx-api/linter/generators/convert-to-flat-config) - Converts the workspace's [ESLint](https://eslint.org/) configs to the new [Flat Config](https://eslint.org/blog/2022/08/new-config-system-part-2) +- [convert-to-flat-config](/nx-api/eslint/generators/convert-to-flat-config) - Converts the workspace's [ESLint](https://eslint.org/) configs to the new [Flat Config](https://eslint.org/blog/2022/08/new-config-system-part-2) ## ESLint plugin diff --git a/docs/generated/packages/linter/executors/eslint.json b/docs/generated/packages/eslint/executors/lint.json similarity index 62% rename from docs/generated/packages/linter/executors/eslint.json rename to docs/generated/packages/eslint/executors/lint.json index 77173d5a09..1e4453f0fc 100644 --- a/docs/generated/packages/linter/executors/eslint.json +++ b/docs/generated/packages/eslint/executors/lint.json @@ -1,5 +1,5 @@ { - "name": "eslint", + "name": "lint", "implementation": "/packages/eslint/src/executors/lint/lint.impl.ts", "schema": { "version": 2, @@ -136,7 +136,7 @@ } }, "required": ["lintFilePatterns"], - "examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Flat Config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag. The new `Flat Config` is now also supported:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \"eslint.config.js\"\n }\n}\n```\n\n**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.js`. Built-in migrations and generators support only `.eslintrc.json` at the moment.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Flat Config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag. The new `Flat Config` is now also supported:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/eslint:lint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \"eslint.config.js\"\n }\n}\n```\n\n**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.js`. Built-in migrations and generators support only `.eslintrc.json` at the moment.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "hasher": "./src/executors/lint/hasher", diff --git a/docs/generated/packages/linter/generators/convert-to-flat-config.json b/docs/generated/packages/eslint/generators/convert-to-flat-config.json similarity index 100% rename from docs/generated/packages/linter/generators/convert-to-flat-config.json rename to docs/generated/packages/eslint/generators/convert-to-flat-config.json diff --git a/docs/generated/packages/linter/generators/workspace-rule.json b/docs/generated/packages/eslint/generators/workspace-rule.json similarity index 92% rename from docs/generated/packages/linter/generators/workspace-rule.json rename to docs/generated/packages/eslint/generators/workspace-rule.json index 10e513eb0a..c063d51be5 100644 --- a/docs/generated/packages/linter/generators/workspace-rule.json +++ b/docs/generated/packages/eslint/generators/workspace-rule.json @@ -22,7 +22,7 @@ } }, "required": ["name", "directory"], - "examplesFile": "{% tabs %}\n{% tab label=\"Create rule\" %}\n\nThis command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder:\n\n```shell\nnx g @nx/linter:workspace-rule my-custom-rule\n```\n\n{% /tab %}\n{% tab label=\"Custom sub-folder\" %}\n\nWe can change the default sub-folder from `rules` and specify a custom one:\n\n```shell\nnx g @nx/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path\n```\n\nThe command above will generate the rule in `tools/eslint-rules/my/custom/path` folder.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", + "examplesFile": "{% tabs %}\n{% tab label=\"Create rule\" %}\n\nThis command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder:\n\n```shell\nnx g @nx/eslint:workspace-rule my-custom-rule\n```\n\n{% /tab %}\n{% tab label=\"Custom sub-folder\" %}\n\nWe can change the default sub-folder from `rules` and specify a custom one:\n\n```shell\nnx g @nx/eslint:workspace-rule --name=my-custom-rule --directory=my/custom/path\n```\n\nThe command above will generate the rule in `tools/eslint-rules/my/custom/path` folder.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, "description": "Create a new Workspace ESLint rule.", diff --git a/docs/generated/packages/linter/generators/workspace-rules-project.json b/docs/generated/packages/eslint/generators/workspace-rules-project.json similarity index 100% rename from docs/generated/packages/linter/generators/workspace-rules-project.json rename to docs/generated/packages/eslint/generators/workspace-rules-project.json diff --git a/docs/map.json b/docs/map.json index 70ecd412f1..0464ceea04 100644 --- a/docs/map.json +++ b/docs/map.json @@ -2174,15 +2174,15 @@ ] }, { - "name": "linter", - "id": "linter", + "name": "eslint", + "id": "eslint", "description": "Linter package.", "itemList": [ { "id": "overview", "name": "Overview", - "path": "/nx-api/linter", - "file": "shared/packages/linter/linter-plugin" + "path": "/nx-api/eslint", + "file": "shared/packages/eslint/eslint" } ] }, @@ -2195,19 +2195,19 @@ "id": "overview", "name": "Overview", "path": "/nx-api/eslint-plugin", - "file": "shared/packages/linter/eslint-plugin" + "file": "shared/packages/eslint/eslint-plugin" }, { "id": "enforce-module-boundaries", "name": "The `enforce-module-boundaries` rule", "path": "/nx-api/eslint-plugin", - "file": "shared/packages/linter/enforce-module-boundaries" + "file": "shared/packages/eslint/enforce-module-boundaries" }, { "id": "dependency-checks", "name": "The `dependency-checks` rule", "path": "/nx-api/eslint-plugin", - "file": "shared/packages/linter/dependency-checks" + "file": "shared/packages/eslint/dependency-checks" } ] }, diff --git a/docs/shared/core-features/automate-updating-dependencies.md b/docs/shared/core-features/automate-updating-dependencies.md index 1f320e0498..0e3f70dae8 100644 --- a/docs/shared/core-features/automate-updating-dependencies.md +++ b/docs/shared/core-features/automate-updating-dependencies.md @@ -17,7 +17,7 @@ title="How Automated Code Migrations Work" Nx knows where its configuration files are and can therefore make sure they match the expected format. This automated update process, commonly referred to as "migration," becomes even more powerful when you leverage [Nx plugins](/nx-api). Nx plugins, which are NPM packages with a range of capabilities (code generation, task automation...), offer targeted updates based on their specific areas of responsibility. -For example, the [Nx ESLint plugin](/nx-api/linter) excels at configuring linting in your workspace. With its understanding of the configuration file locations, this plugin can provide precise migration scripts to update ESLint packages in your `package.json` and corresponding configuration files in your workspace when a new version is released. +For example, the [Nx ESLint plugin](/nx-api/eslint) excels at configuring linting in your workspace. With its understanding of the configuration file locations, this plugin can provide precise migration scripts to update ESLint packages in your `package.json` and corresponding configuration files in your workspace when a new version is released. Updating happens in three steps: diff --git a/docs/shared/packages/linter/dependency-checks.md b/docs/shared/packages/eslint/dependency-checks.md similarity index 100% rename from docs/shared/packages/linter/dependency-checks.md rename to docs/shared/packages/eslint/dependency-checks.md diff --git a/docs/shared/packages/linter/enforce-module-boundaries.md b/docs/shared/packages/eslint/enforce-module-boundaries.md similarity index 100% rename from docs/shared/packages/linter/enforce-module-boundaries.md rename to docs/shared/packages/eslint/enforce-module-boundaries.md diff --git a/docs/shared/packages/linter/eslint-plugin.md b/docs/shared/packages/eslint/eslint-plugin.md similarity index 100% rename from docs/shared/packages/linter/eslint-plugin.md rename to docs/shared/packages/eslint/eslint-plugin.md diff --git a/docs/shared/packages/eslint/eslint.md b/docs/shared/packages/eslint/eslint.md new file mode 100644 index 0000000000..9727103084 --- /dev/null +++ b/docs/shared/packages/eslint/eslint.md @@ -0,0 +1,39 @@ +The ESLint plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace. + +## Setting Up ESLint + +### Installation + +{% callout type="note" title="Keep Nx Package Versions In Sync" %} +Make sure to install the `@nx/eslint` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync). +{% /callout %} + +In any Nx workspace, you can install `@nx/eslint` by running the following commands if `@nx/eslint` package is not installed: + +```shell +npm i --save-dev @nx/eslint +``` + +```shell +yarn add --dev @nx/eslint +``` + +## Lint + +You can lint an application or a library with the following command: + +```shell +nx lint my-app +``` + +```shell +nx lint my-lib +``` + +## Utils + +- [convert-to-flat-config](/nx-api/eslint/generators/convert-to-flat-config) - Converts the workspace's [ESLint](https://eslint.org/) configs to the new [Flat Config](https://eslint.org/blog/2022/08/new-config-system-part-2) + +## ESLint plugin + +Read about our dedicated ESLint plugin - [eslint-plugin-nx](/nx-api/eslint-plugin/documents/overview). diff --git a/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md b/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md index f9e9adb84e..6d254d9174 100644 --- a/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md +++ b/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md @@ -156,7 +156,7 @@ module.exports = { For additional details, head over to [ESLint's official blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/). -Since version 16.8.0, Nx supports the usage of flat config in the [@nx/lint:eslint](/nx-api/linter/executors/eslint) executor and `@nx/*` generators, and provides an automated config conversion from `.eslintrc.json` config files. +Since version 16.8.0, Nx supports the usage of flat config in the [@nx/eslint:lint](/nx-api/eslint/executors/lint) executor and `@nx/*` generators, and provides an automated config conversion from `.eslintrc.json` config files. ## Converting workspace from .eslintrc.json to flat config diff --git a/docs/shared/reference/sitemap.md b/docs/shared/reference/sitemap.md index 4c72fbaa2e..b7eb1bb942 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -378,13 +378,15 @@ - [generators](/nx-api/esbuild/generators) - [init](/nx-api/esbuild/generators/init) - [configuration](/nx-api/esbuild/generators/configuration) - - [linter](/nx-api/linter) - - [executors](/nx-api/linter/executors) - - [eslint](/nx-api/linter/executors/eslint) - - [generators](/nx-api/linter/generators) - - [workspace-rules-project](/nx-api/linter/generators/workspace-rules-project) - - [workspace-rule](/nx-api/linter/generators/workspace-rule) - - [convert-to-flat-config](/nx-api/linter/generators/convert-to-flat-config) + - [eslint](/nx-api/eslint) + - [documents](/nx-api/eslint/documents) + - [Overview](/nx-api/eslint/documents/overview) + - [executors](/nx-api/eslint/executors) + - [lint](/nx-api/eslint/executors/lint) + - [generators](/nx-api/eslint/generators) + - [workspace-rules-project](/nx-api/eslint/generators/workspace-rules-project) + - [workspace-rule](/nx-api/eslint/generators/workspace-rule) + - [convert-to-flat-config](/nx-api/eslint/generators/convert-to-flat-config) - [eslint-plugin](/nx-api/eslint-plugin) - [documents](/nx-api/eslint-plugin/documents) - [Overview](/nx-api/eslint-plugin/documents/overview) diff --git a/graph/client-e2e/src/fixtures/nx-examples-task-inputs.json b/graph/client-e2e/src/fixtures/nx-examples-task-inputs.json index 47cf540a60..8269c41b31 100644 --- a/graph/client-e2e/src/fixtures/nx-examples-task-inputs.json +++ b/graph/client-e2e/src/fixtures/nx-examples-task-inputs.json @@ -25,7 +25,7 @@ "libs/products/product-detail-page/tsconfig.lib.json", "libs/products/product-detail-page/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "products-product-detail-page:test": { "general": [ @@ -135,7 +135,7 @@ "libs/shared/product/state/tsconfig.lib.json", "libs/shared/product/state/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-product-state:test": { "general": [ @@ -224,7 +224,7 @@ "libs/shared/product/types/tsconfig.json", "libs/shared/product/types/tsconfig.lib.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-product-data:lint": { "general": [ @@ -247,7 +247,7 @@ "libs/shared/product/data/tsconfig.json", "libs/shared/product/data/tsconfig.lib.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "products-home-page:lint": { "general": [ @@ -275,7 +275,7 @@ "libs/products/home-page/tsconfig.lib.json", "libs/products/home-page/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "products-home-page:test": { "general": [ @@ -396,7 +396,7 @@ "libs/shared/product/ui/tsconfig.lib.json", "libs/shared/product/ui/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-product-ui:test": { "general": [ @@ -528,7 +528,7 @@ "libs/shared/cart/state/tsconfig.lib.json", "libs/shared/cart/state/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-cart-state:test": { "general": [ @@ -646,7 +646,7 @@ "libs/shared/e2e-utils/tsconfig.json", "libs/shared/e2e-utils/tsconfig.lib.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "cart-cart-page:lint": { "general": [ @@ -671,7 +671,7 @@ "libs/cart/cart-page/tsconfig.lib.json", "libs/cart/cart-page/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "cart-cart-page:test": { "general": [ @@ -815,7 +815,7 @@ "libs/shared/jsxify/tsconfig.json", "libs/shared/jsxify/tsconfig.lib.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-header:lint": { "general": [ @@ -842,7 +842,7 @@ "libs/shared/header/tsconfig.lib.json", "libs/shared/header/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "shared-header:test": { "general": [ @@ -1364,7 +1364,7 @@ "apps/products-e2e/src/support/e2e.ts", "apps/products-e2e/tsconfig.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "products:build": { "general": [ @@ -2259,7 +2259,7 @@ "apps/products/tsconfig.json", "apps/products/tsconfig.spec.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "products:test": { "general": [ @@ -3073,7 +3073,7 @@ "apps/cart-e2e/src/support/e2e.ts", "apps/cart-e2e/tsconfig.json" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "cart:build:production": { "general": [ @@ -3940,7 +3940,7 @@ "apps/cart/tsconfig.spec.json", "apps/cart/webpack.config.js" ], - "external": ["external:@nx/linter"] + "external": ["external:@nx/eslint"] }, "cart:test": { "general": [ diff --git a/graph/client/src/assets/task-inputs/e2e-affected.json b/graph/client/src/assets/task-inputs/e2e-affected.json index 701ee0d19f..3e31c910fd 100644 --- a/graph/client/src/assets/task-inputs/e2e-affected.json +++ b/graph/client/src/assets/task-inputs/e2e-affected.json @@ -18,7 +18,7 @@ "libs/products/product-detail-page/tsconfig.lib.json", "libs/products/product-detail-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-product-detail-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -232,7 +232,7 @@ "libs/shared/product/types/tsconfig.json", "libs/shared/product/types/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-state:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -256,7 +256,7 @@ "libs/shared/product/state/tsconfig.lib.json", "libs/shared/product/state/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-state:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -469,7 +469,7 @@ "libs/shared/product/data/tsconfig.json", "libs/shared/product/data/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-home-page:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -490,7 +490,7 @@ "libs/products/home-page/tsconfig.lib.json", "libs/products/home-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-home-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -717,7 +717,7 @@ "libs/shared/product/ui/tsconfig.lib.json", "libs/shared/product/ui/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-ui:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -772,7 +772,7 @@ "libs/shared/cart/state/tsconfig.lib.json", "libs/shared/cart/state/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-cart-state:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -994,7 +994,7 @@ "libs/shared/translate/tsconfig.json", "libs/shared/translate/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-e2e-utils:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -1007,7 +1007,7 @@ "libs/shared/e2e-utils/tsconfig.json", "libs/shared/e2e-utils/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart-cart-page:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -1025,7 +1025,7 @@ "libs/cart/cart-page/tsconfig.lib.json", "libs/cart/cart-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart-cart-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -1218,7 +1218,7 @@ "libs/shared/header/tsconfig.lib.json", "libs/shared/header/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-header:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -1265,7 +1265,7 @@ "libs/shared/jsxify/tsconfig.json", "libs/shared/jsxify/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-e2e:e2e": { "general": [".gitignore", "babel.config.json", "nx.json"], @@ -1726,7 +1726,7 @@ "apps/products-e2e/src/support/e2e.ts", "apps/products-e2e/tsconfig.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products:build": { "general": [ @@ -2989,7 +2989,7 @@ "apps/products/tsconfig.json", "apps/products/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -3939,7 +3939,7 @@ "apps/cart-e2e/src/support/e2e.ts", "apps/cart-e2e/tsconfig.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart:build:production": { "general": [".gitignore", "babel.config.json", "nx.json"], @@ -4190,7 +4190,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -5150,7 +5150,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -6125,7 +6125,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -7100,7 +7100,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -7835,7 +7835,7 @@ "apps/cart/tsconfig.spec.json", "apps/cart/webpack.config.js" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -8092,7 +8092,7 @@ "npm:@nx/devkit", "npm:@nx/jest", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -9072,7 +9072,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", diff --git a/graph/client/src/assets/task-inputs/e2e.json b/graph/client/src/assets/task-inputs/e2e.json index 701ee0d19f..3e31c910fd 100644 --- a/graph/client/src/assets/task-inputs/e2e.json +++ b/graph/client/src/assets/task-inputs/e2e.json @@ -18,7 +18,7 @@ "libs/products/product-detail-page/tsconfig.lib.json", "libs/products/product-detail-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-product-detail-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -232,7 +232,7 @@ "libs/shared/product/types/tsconfig.json", "libs/shared/product/types/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-state:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -256,7 +256,7 @@ "libs/shared/product/state/tsconfig.lib.json", "libs/shared/product/state/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-state:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -469,7 +469,7 @@ "libs/shared/product/data/tsconfig.json", "libs/shared/product/data/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-home-page:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -490,7 +490,7 @@ "libs/products/home-page/tsconfig.lib.json", "libs/products/home-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-home-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -717,7 +717,7 @@ "libs/shared/product/ui/tsconfig.lib.json", "libs/shared/product/ui/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-product-ui:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -772,7 +772,7 @@ "libs/shared/cart/state/tsconfig.lib.json", "libs/shared/cart/state/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-cart-state:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -994,7 +994,7 @@ "libs/shared/translate/tsconfig.json", "libs/shared/translate/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-e2e-utils:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -1007,7 +1007,7 @@ "libs/shared/e2e-utils/tsconfig.json", "libs/shared/e2e-utils/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart-cart-page:lint": { "general": [".eslintrc.json", ".gitignore", "babel.config.json", "nx.json"], @@ -1025,7 +1025,7 @@ "libs/cart/cart-page/tsconfig.lib.json", "libs/cart/cart-page/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart-cart-page:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -1218,7 +1218,7 @@ "libs/shared/header/tsconfig.lib.json", "libs/shared/header/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "shared-header:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -1265,7 +1265,7 @@ "libs/shared/jsxify/tsconfig.json", "libs/shared/jsxify/tsconfig.lib.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products-e2e:e2e": { "general": [".gitignore", "babel.config.json", "nx.json"], @@ -1726,7 +1726,7 @@ "apps/products-e2e/src/support/e2e.ts", "apps/products-e2e/tsconfig.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products:build": { "general": [ @@ -2989,7 +2989,7 @@ "apps/products/tsconfig.json", "apps/products/tsconfig.spec.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "products:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -3939,7 +3939,7 @@ "apps/cart-e2e/src/support/e2e.ts", "apps/cart-e2e/tsconfig.json" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart:build:production": { "general": [".gitignore", "babel.config.json", "nx.json"], @@ -4190,7 +4190,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -5150,7 +5150,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -6125,7 +6125,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -7100,7 +7100,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -7835,7 +7835,7 @@ "apps/cart/tsconfig.spec.json", "apps/cart/webpack.config.js" ], - "external": ["npm:@nx/linter"] + "external": ["npm:@nx/eslint"] }, "cart:test": { "general": [".gitignore", "babel.config.json", "jest.preset.js", "nx.json"], @@ -8092,7 +8092,7 @@ "npm:@nx/devkit", "npm:@nx/jest", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", @@ -9072,7 +9072,7 @@ "npm:@nrwl/workspace", "npm:@nx/devkit", "npm:@nx/js", - "npm:@nx/linter", + "npm:@nx/eslint", "npm:@nx/nx-darwin-arm64", "npm:@nx/nx-darwin-x64@18.0.5", "npm:@nx/nx-freebsd-x64@18.0.5", diff --git a/nx-dev/nx-dev-e2e/src/packages.spec.ts b/nx-dev/nx-dev-e2e/src/packages.spec.ts index bbb634455f..1ec98e04e5 100644 --- a/nx-dev/nx-dev-e2e/src/packages.spec.ts +++ b/nx-dev/nx-dev-e2e/src/packages.spec.ts @@ -169,16 +169,16 @@ const pages: Array<{ title: string; path: string }> = [ }, { title: '@nx/js:tsc', path: '/packages/js/executors/tsc' }, { title: '@nx/js:swc', path: '/packages/js/executors/swc' }, - { title: '@nx/linter', path: '/packages/eslint' }, + { title: '@nx/eslint', path: '/packages/eslint' }, { - title: '@nx/linter:workspace-rules-project', - path: '/packages/linter/generators/workspace-rules-project', + title: '@nx/eslint:workspace-rules-project', + path: '/packages/eslint/generators/workspace-rules-project', }, { - title: '@nx/linter', - path: '/packages/linter/generators/workspace-rule', + title: '@nx/eslint', + path: '/packages/eslint/generators/workspace-rule', }, - { title: '@nx/linter', path: '/packages/linter/executors/eslint' }, + { title: '@nx/eslint', path: '/packages/eslint/executors/lint' }, { title: '@nx/nest', path: '/packages/nest' }, { title: '@nx/nest:application', diff --git a/nx-dev/nx-dev/redirect-rules.js b/nx-dev/nx-dev/redirect-rules.js index 3b627eddee..faf03696b6 100644 --- a/nx-dev/nx-dev/redirect-rules.js +++ b/nx-dev/nx-dev/redirect-rules.js @@ -913,11 +913,20 @@ const aiChat = { }; // rename nx/linter to eslint -// TODO(v17) invert these redirects const eslintRename = { - '/nx-api/eslint': '/nx-api/linter', - '/packages/eslint': '/packages/linter', - '/nx-api/eslint/executors/lint': '/nx-api/linter/executors/eslint', + '/nx-api/linter': '/nx-api/eslint', + '/nx-api/linter/documents': '/nx-api/eslint/documents', + '/nx-api/linter/documents/overview': '/nx-api/eslint/documents/overview', + '/nx-api/linter/executors': '/nx-api/eslint/executors', + '/nx-api/linter/executors/eslint': '/nx-api/eslint/executors/lint', + '/nx-api/linter/generators': '/nx-api/eslint/generators', + '/nx-api/linter/generators/convert-to-flat-config': + '/nx-api/eslint/generators/convert-to-flat-config', + '/nx-api/linter/generators/workspace-rule': + '/nx-api/eslint/generators/workspace-rule', + '/nx-api/linter/generators/workspace-rules-project': + '/nx-api/eslint/generators/workspace-rules-project', + '/packages/linter': '/packages/eslint', }; /** diff --git a/packages/eslint/docs/eslint-examples.md b/packages/eslint/docs/eslint-examples.md index 95136037a1..03f7651a5e 100644 --- a/packages/eslint/docs/eslint-examples.md +++ b/packages/eslint/docs/eslint-examples.md @@ -4,7 +4,7 @@ Linter can be configured in multiple ways. The basic way is to provide only `lin ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"] } @@ -20,7 +20,7 @@ Linter provides an automated way of fixing known issues. To ensure that those ch ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"] @@ -38,7 +38,7 @@ We can also set this flag via project configuration to always fix files when run ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -54,7 +54,7 @@ ESLint executor uses the `stylish` output format by default. You can change this ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -76,7 +76,7 @@ We can also set this via project configuration as a default option. ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], @@ -92,7 +92,7 @@ We can also set this via project configuration as a default option. ```json "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/frontend/**/*.ts"], diff --git a/packages/eslint/docs/workspace-rule-examples.md b/packages/eslint/docs/workspace-rule-examples.md index 0446b7e102..0191bee4c1 100644 --- a/packages/eslint/docs/workspace-rule-examples.md +++ b/packages/eslint/docs/workspace-rule-examples.md @@ -4,7 +4,7 @@ This command will generate a new workspace lint rule called `my-custom-rule`. The new rule will be generated in `tools/eslint-rules/rules` folder: ```shell -nx g @nx/linter:workspace-rule my-custom-rule +nx g @nx/eslint:workspace-rule my-custom-rule ``` {% /tab %} @@ -13,7 +13,7 @@ nx g @nx/linter:workspace-rule my-custom-rule We can change the default sub-folder from `rules` and specify a custom one: ```shell -nx g @nx/linter:workspace-rule --name=my-custom-rule --directory=my/custom/path +nx g @nx/eslint:workspace-rule --name=my-custom-rule --directory=my/custom/path ``` The command above will generate the rule in `tools/eslint-rules/my/custom/path` folder. diff --git a/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts index b9dce789ba..bfeb50b447 100644 --- a/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts +++ b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts @@ -30,6 +30,7 @@ function updateNxJsonExecutor(tree: Tree) { for (const [targetName, targetConfig] of Object.entries( nxJson.targetDefaults ?? {} )) { + // this will be in a broken state after the package is globally renamed if (targetConfig.executor !== '@nx/eslint:eslint') { continue; } @@ -51,6 +52,7 @@ function updateProjectExecutor(tree: Tree) { for (const [targetName, targetConfig] of Object.entries( projectConfiguration.targets ?? {} )) { + // this will be in a broken state after the package is globally renamed if (targetConfig.executor !== '@nx/eslint:eslint') { continue; } diff --git a/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index a029d2c822..c13046d0d5 100644 --- a/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -473,7 +473,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-vite/**/*.{ts,tsx,js,jsx}", @@ -555,7 +555,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-vite-e2e/**/*.{js,ts}", @@ -610,7 +610,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-vite-ts/**/*.{ts,tsx,js,jsx}", @@ -692,7 +692,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-vite-ts-e2e/**/*.{js,ts}", @@ -775,7 +775,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-webpack/**/*.{ts,tsx,js,jsx}", @@ -857,7 +857,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/main-webpack-e2e/**/*.{js,ts}", @@ -936,7 +936,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/nextapp/**/*.{ts,tsx,js,jsx}", @@ -1019,7 +1019,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/nextapp-e2e/**/*.{js,ts}", @@ -1113,7 +1113,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/ngapp/**/*.ts", @@ -1187,7 +1187,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/ngapp-e2e/**/*.{js,ts}", @@ -1224,7 +1224,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/nglib-e2e/**/*.{js,ts}", @@ -1261,7 +1261,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/react-rollup-e2e/**/*.{js,ts}", @@ -1343,7 +1343,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/react-swc/**/*.{ts,tsx,js,jsx}", @@ -1425,7 +1425,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/react-swc-e2e/**/*.{js,ts}", @@ -1462,7 +1462,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/react-vite-e2e/**/*.{js,ts}", @@ -1517,7 +1517,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/reapp/**/*.{ts,tsx,js,jsx}", @@ -1599,7 +1599,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/reapp-e2e/**/*.{js,ts}", @@ -1681,7 +1681,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/reappw/**/*.{ts,tsx,js,jsx}", @@ -1763,7 +1763,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/reappw-e2e/**/*.{js,ts}", @@ -1818,7 +1818,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/wv1/**/*.ts", @@ -1900,7 +1900,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/wv1-e2e/**/*.{js,ts}", @@ -1976,7 +1976,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/ww1/**/*.ts", @@ -2052,7 +2052,7 @@ Map { }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/ww1-e2e/**/*.{js,ts}", @@ -2107,7 +2107,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/my-plugin/**/*.ts", @@ -2172,7 +2172,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/nglib/**/*.ts", @@ -2257,7 +2257,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/react-rollup/**/*.{ts,tsx,js,jsx}", @@ -2330,7 +2330,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/react-rollup-2/**/*.{ts,tsx,js,jsx}", @@ -2394,7 +2394,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/react-vite/**/*.{ts,tsx,js,jsx}", @@ -2461,7 +2461,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/react-vite-2/**/*.{ts,tsx,js,jsx}", @@ -2504,7 +2504,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/utils/one/**/*.ts", @@ -2544,7 +2544,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/utils/three-vite/**/*.ts", @@ -2587,7 +2587,7 @@ Map { ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/utils/two/**/*.ts", diff --git a/packages/storybook/src/generators/configuration/test-configs/root-workspace-configuration.json b/packages/storybook/src/generators/configuration/test-configs/root-workspace-configuration.json index 1d1bd1a55d..61ccd7eb76 100644 --- a/packages/storybook/src/generators/configuration/test-configs/root-workspace-configuration.json +++ b/packages/storybook/src/generators/configuration/test-configs/root-workspace-configuration.json @@ -146,7 +146,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reapp/**/*.{ts,tsx,js,jsx}"] @@ -171,7 +171,7 @@ "tags": [], "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/nxlib/**/*.{ts,tsx,js,jsx}"] @@ -215,7 +215,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/nxlib-buildable/**/*.{ts,tsx,js,jsx}"] @@ -259,7 +259,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/relib-buildable/**/*.{ts,tsx,js,jsx}"] @@ -342,7 +342,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reapp-swc/**/*.{ts,tsx,js,jsx}"] diff --git a/packages/storybook/src/generators/configuration/test-configs/various-projects.json b/packages/storybook/src/generators/configuration/test-configs/various-projects.json index 4d7456d9f4..c4cfd6272b 100644 --- a/packages/storybook/src/generators/configuration/test-configs/various-projects.json +++ b/packages/storybook/src/generators/configuration/test-configs/various-projects.json @@ -42,7 +42,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-vite/**/*.{ts,tsx,js,jsx}"] @@ -89,7 +89,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-vite-e2e/**/*.{js,ts}"] } } @@ -141,7 +141,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-vite-ts/**/*.{ts,tsx,js,jsx}"] @@ -188,7 +188,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-vite-ts-e2e/**/*.{js,ts}"] @@ -261,7 +261,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-webpack/**/*.{ts,tsx,js,jsx}"] @@ -316,7 +316,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-webpack-e2e/**/*.{js,ts}"] @@ -392,7 +392,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/nextapp/**/*.{ts,tsx,js,jsx}"] } }, @@ -437,7 +437,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/nextapp-e2e/**/*.{js,ts}"] } } @@ -506,7 +506,7 @@ "options": { "browserTarget": "ngapp:build" } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/ngapp/**/*.ts", "apps/ngapp/**/*.html"] @@ -563,7 +563,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/ngapp-e2e/**/*.{js,ts}"] } } @@ -588,7 +588,7 @@ "configurations": { "ci": { "devServerTarget": "nglib:storybook:ci" } } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/nglib-e2e/**/*.{js,ts}"] } } @@ -615,7 +615,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/react-rollup-e2e/**/*.{js,ts}"] @@ -687,7 +687,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/react-swc/**/*.{ts,tsx,js,jsx}"] @@ -723,7 +723,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/react-swc-e2e/**/*.{js,ts}"] } } @@ -750,7 +750,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/react-vite-e2e/**/*.{js,ts}"] } } @@ -802,7 +802,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reapp/**/*.{ts,tsx,js,jsx}"] } }, @@ -847,7 +847,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reapp-e2e/**/*.{js,ts}"] } } @@ -914,7 +914,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reappw/**/*.{ts,tsx,js,jsx}"] } }, @@ -967,7 +967,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/reappw-e2e/**/*.{js,ts}"] } } @@ -1009,7 +1009,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/wv1/**/*.ts"] } }, @@ -1061,7 +1061,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/wv1-e2e/**/*.{js,ts}"] } } @@ -1118,7 +1118,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/ww1/**/*.ts"] } }, @@ -1170,7 +1170,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/ww1-e2e/**/*.{js,ts}"] } } @@ -1218,7 +1218,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ @@ -1266,7 +1266,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/nglib/**/*.ts", "libs/nglib/**/*.html"] @@ -1304,7 +1304,7 @@ "tags": [], "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-rollup/**/*.{ts,tsx,js,jsx}"] @@ -1367,7 +1367,7 @@ "tags": [], "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-rollup-2/**/*.{ts,tsx,js,jsx}"] @@ -1412,7 +1412,7 @@ "tags": [], "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-vite/**/*.{ts,tsx,js,jsx}"] @@ -1466,7 +1466,7 @@ "tags": [], "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-vite-2/**/*.{ts,tsx,js,jsx}"] @@ -1510,7 +1510,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/utils/one/**/*.ts"] } }, @@ -1538,7 +1538,7 @@ "options": { "outputPath": "dist/libs/utils/three-vite" } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/utils/three-vite/**/*.ts"] } }, @@ -1571,7 +1571,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/utils/two/**/*.ts"] } }, diff --git a/packages/storybook/src/utils/test-configs/different-target-variations.json b/packages/storybook/src/utils/test-configs/different-target-variations.json index 534e3a314e..7b9cc716c3 100644 --- a/packages/storybook/src/utils/test-configs/different-target-variations.json +++ b/packages/storybook/src/utils/test-configs/different-target-variations.json @@ -160,7 +160,7 @@ "defaultConfiguration": "production" }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/nglibuild/**/*.ts", diff --git a/packages/storybook/src/utils/test-configs/executor-context.json b/packages/storybook/src/utils/test-configs/executor-context.json index 11b30283d0..5514236236 100644 --- a/packages/storybook/src/utils/test-configs/executor-context.json +++ b/packages/storybook/src/utils/test-configs/executor-context.json @@ -84,7 +84,7 @@ }, "lint": { "inputs": ["default", "{workspaceRoot}/.eslintrc.json"], - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/main-webpack/**/*.{ts,tsx,js,jsx}"] diff --git a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index 44e61d72c6..bfa3ba169f 100644 --- a/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/vite/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -114,7 +114,7 @@ exports[`@nx/vite:configuration library mode should set up non buildable library "projectType": "library", "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ @@ -195,7 +195,7 @@ exports[`@nx/vite:configuration library mode should set up non buildable library "projectType": "library", "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ @@ -255,7 +255,7 @@ exports[`@nx/vite:configuration transform React app to use Vite by providing cus } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ @@ -398,7 +398,7 @@ exports[`@nx/vite:configuration transform React app to use Vite should transform } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/my-test-react-app/**/*.{ts,tsx,js,jsx}"] @@ -527,7 +527,7 @@ exports[`@nx/vite:configuration transform Web app to use Vite should transform w } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/my-test-web-app/**/*.ts"] diff --git a/packages/vite/src/utils/test-files/angular-project.config.json b/packages/vite/src/utils/test-files/angular-project.config.json index 2557ec6d8b..f5a3bca217 100644 --- a/packages/vite/src/utils/test-files/angular-project.config.json +++ b/packages/vite/src/utils/test-files/angular-project.config.json @@ -67,7 +67,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/packages/vite/src/utils/test-files/react-lib-non-buildable-jest.json b/packages/vite/src/utils/test-files/react-lib-non-buildable-jest.json index e837dc1b11..bc0942d026 100644 --- a/packages/vite/src/utils/test-files/react-lib-non-buildable-jest.json +++ b/packages/vite/src/utils/test-files/react-lib-non-buildable-jest.json @@ -6,7 +6,7 @@ "projectType": "library", "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-lib-nonb-jest/**/*.{ts,tsx,js,jsx}"] diff --git a/packages/vite/src/utils/test-files/react-lib-non-buildable-vitest.json b/packages/vite/src/utils/test-files/react-lib-non-buildable-vitest.json index a14a8c9e8a..a1c97c5174 100644 --- a/packages/vite/src/utils/test-files/react-lib-non-buildable-vitest.json +++ b/packages/vite/src/utils/test-files/react-lib-non-buildable-vitest.json @@ -6,7 +6,7 @@ "projectType": "library", "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/react-lib-nonb-vitest/**/*.{ts,tsx,js,jsx}"] diff --git a/packages/vite/src/utils/test-files/react-mixed-project.config.json b/packages/vite/src/utils/test-files/react-mixed-project.config.json index 2362abfafd..a5d4e375da 100644 --- a/packages/vite/src/utils/test-files/react-mixed-project.config.json +++ b/packages/vite/src/utils/test-files/react-mixed-project.config.json @@ -31,7 +31,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/packages/vite/src/utils/test-files/react-project.config.json b/packages/vite/src/utils/test-files/react-project.config.json index 2f83097d66..bc64bab865 100644 --- a/packages/vite/src/utils/test-files/react-project.config.json +++ b/packages/vite/src/utils/test-files/react-project.config.json @@ -66,7 +66,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/my-test-react-app/**/*.{ts,tsx,js,jsx}"] diff --git a/packages/vite/src/utils/test-files/web-project.config.json b/packages/vite/src/utils/test-files/web-project.config.json index 239beb184e..0356aed565 100644 --- a/packages/vite/src/utils/test-files/web-project.config.json +++ b/packages/vite/src/utils/test-files/web-project.config.json @@ -54,7 +54,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/my-test-web-app/**/*.ts"] diff --git a/scripts/documentation/package-schemas/package-metadata.ts b/scripts/documentation/package-schemas/package-metadata.ts index f167dfc5d4..10e5a498b9 100644 --- a/scripts/documentation/package-schemas/package-metadata.ts +++ b/scripts/documentation/package-schemas/package-metadata.ts @@ -139,13 +139,8 @@ export function findPackageMetadataList( ? null : { githubRoot: 'https://github.com/nrwl/nx/blob/master', - // TODO(v17): Remove this replace - name: folderName === 'eslint' ? 'linter' : folderName, - // TODO(v17): Remove this replace - packageName: - packageJson.name === '@nx/eslint' - ? '@nx/linter' - : packageJson.name, + name: folderName, + packageName: packageJson.name, description: packageJson.description, root: relativeFolderPath, source: join(relativeFolderPath, '/src'), @@ -157,7 +152,7 @@ export function findPackageMetadataList( content: readFileSync( join('docs', item.file + '.md'), 'utf8' - ).replace('@nx/eslint', '@nx/linter'), + ), })) : [], generators: getSchemaList( @@ -177,14 +172,7 @@ export function findPackageMetadataList( }, 'executors.json', ['executors', 'builders'] - ) - // TODO(v17): Remove this remapping - .map((schema) => { - if (folderName === 'eslint' && schema.name === 'lint') { - schema.name = 'eslint'; - } - return schema; - }), + ), }; }) .filter(Boolean);