From d98090c1b433c757b44e2cc555de33ee0e6df6ec Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Fri, 13 Oct 2023 17:26:28 +0200 Subject: [PATCH] fix(linter): temporary disable docs changes --- docs/generated/manifests/menus.json | 22 ++++++------ docs/generated/manifests/nx-api.json | 34 +++++++++---------- docs/generated/packages-metadata.json | 22 ++++++------ .../documents/dependency-checks.md | 2 +- .../eslint-plugin/documents/overview.md | 2 +- .../executors/eslint.json} | 4 +-- .../generators/convert-to-flat-config.json | 0 .../generators/workspace-rule.json | 2 +- .../generators/workspace-rules-project.json | 0 .../automate-updating-dependencies.md | 2 +- docs/shared/packages/linter/linter-plugin.md | 2 +- .../tips-n-tricks/migrating-to-flat-eslint.md | 2 +- docs/shared/reference/sitemap.md | 14 ++++---- nx-dev/nx-dev/redirect-rules.js | 7 ++-- packages/eslint/docs/eslint-examples.md | 12 +++---- .../eslint/docs/workspace-rule-examples.md | 4 +-- .../package-schemas/package-metadata.ts | 20 ++++++++--- 17 files changed, 82 insertions(+), 69 deletions(-) rename docs/generated/packages/{eslint/executors/lint.json => linter/executors/eslint.json} (62%) rename docs/generated/packages/{eslint => linter}/generators/convert-to-flat-config.json (100%) rename docs/generated/packages/{eslint => linter}/generators/workspace-rule.json (92%) rename docs/generated/packages/{eslint => linter}/generators/workspace-rules-project.json (100%) diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 59822302e1e938..7e46e02e3b66a8 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -6518,19 +6518,19 @@ "disableCollapsible": false }, { - "id": "eslint", - "path": "/nx-api/eslint", - "name": "eslint", + "id": "linter", + "path": "/nx-api/linter", + "name": "linter", "children": [ { "id": "executors", - "path": "/nx-api/eslint/executors", + "path": "/nx-api/linter/executors", "name": "executors", "children": [ { - "id": "lint", - "path": "/nx-api/eslint/executors/lint", - "name": "lint", + "id": "eslint", + "path": "/nx-api/linter/executors/eslint", + "name": "eslint", "children": [], "isExternal": false, "disableCollapsible": false @@ -6541,12 +6541,12 @@ }, { "id": "generators", - "path": "/nx-api/eslint/generators", + "path": "/nx-api/linter/generators", "name": "generators", "children": [ { "id": "workspace-rules-project", - "path": "/nx-api/eslint/generators/workspace-rules-project", + "path": "/nx-api/linter/generators/workspace-rules-project", "name": "workspace-rules-project", "children": [], "isExternal": false, @@ -6554,7 +6554,7 @@ }, { "id": "workspace-rule", - "path": "/nx-api/eslint/generators/workspace-rule", + "path": "/nx-api/linter/generators/workspace-rule", "name": "workspace-rule", "children": [], "isExternal": false, @@ -6562,7 +6562,7 @@ }, { "id": "convert-to-flat-config", - "path": "/nx-api/eslint/generators/convert-to-flat-config", + "path": "/nx-api/linter/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 a9d393c90004e3..501f96b3b21a5c 100644 --- a/docs/generated/manifests/nx-api.json +++ b/docs/generated/manifests/nx-api.json @@ -650,55 +650,55 @@ }, "path": "/nx-api/esbuild" }, - "eslint": { + "linter": { "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "eslint", - "packageName": "@nx/eslint", + "name": "linter", + "packageName": "@nx/linter", "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", "documents": {}, "root": "/packages/eslint", "source": "/packages/eslint/src", "executors": { - "/nx-api/eslint/executors/lint": { + "/nx-api/linter/executors/eslint": { "description": "Run ESLint on a project.", - "file": "generated/packages/eslint/executors/lint.json", + "file": "generated/packages/linter/executors/eslint.json", "hidden": false, - "name": "lint", + "name": "eslint", "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", - "path": "/nx-api/eslint/executors/lint", + "path": "/nx-api/linter/executors/eslint", "type": "executor" } }, "generators": { - "/nx-api/eslint/generators/workspace-rules-project": { + "/nx-api/linter/generators/workspace-rules-project": { "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/eslint/generators/workspace-rules-project.json", + "file": "generated/packages/linter/generators/workspace-rules-project.json", "hidden": true, "name": "workspace-rules-project", "originalFilePath": "/packages/eslint/src/generators/workspace-rules-project/schema.json", - "path": "/nx-api/eslint/generators/workspace-rules-project", + "path": "/nx-api/linter/generators/workspace-rules-project", "type": "generator" }, - "/nx-api/eslint/generators/workspace-rule": { + "/nx-api/linter/generators/workspace-rule": { "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/eslint/generators/workspace-rule.json", + "file": "generated/packages/linter/generators/workspace-rule.json", "hidden": false, "name": "workspace-rule", "originalFilePath": "/packages/eslint/src/generators/workspace-rule/schema.json", - "path": "/nx-api/eslint/generators/workspace-rule", + "path": "/nx-api/linter/generators/workspace-rule", "type": "generator" }, - "/nx-api/eslint/generators/convert-to-flat-config": { + "/nx-api/linter/generators/convert-to-flat-config": { "description": "Convert an Nx workspace's ESLint configs to use Flat Config.", - "file": "generated/packages/eslint/generators/convert-to-flat-config.json", + "file": "generated/packages/linter/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/eslint/generators/convert-to-flat-config", + "path": "/nx-api/linter/generators/convert-to-flat-config", "type": "generator" } }, - "path": "/nx-api/eslint" + "path": "/nx-api/linter" }, "eslint-plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index 20e63dca6191ac..5a6f845692da56 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -649,46 +649,46 @@ "executors": [ { "description": "Run ESLint on a project.", - "file": "generated/packages/eslint/executors/lint.json", + "file": "generated/packages/linter/executors/eslint.json", "hidden": false, - "name": "lint", + "name": "eslint", "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", - "path": "eslint/executors/lint", + "path": "linter/executors/eslint", "type": "executor" } ], "generators": [ { "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/eslint/generators/workspace-rules-project.json", + "file": "generated/packages/linter/generators/workspace-rules-project.json", "hidden": true, "name": "workspace-rules-project", "originalFilePath": "/packages/eslint/src/generators/workspace-rules-project/schema.json", - "path": "eslint/generators/workspace-rules-project", + "path": "linter/generators/workspace-rules-project", "type": "generator" }, { "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/eslint/generators/workspace-rule.json", + "file": "generated/packages/linter/generators/workspace-rule.json", "hidden": false, "name": "workspace-rule", "originalFilePath": "/packages/eslint/src/generators/workspace-rule/schema.json", - "path": "eslint/generators/workspace-rule", + "path": "linter/generators/workspace-rule", "type": "generator" }, { "description": "Convert an Nx workspace's ESLint configs to use Flat Config.", - "file": "generated/packages/eslint/generators/convert-to-flat-config.json", + "file": "generated/packages/linter/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": "eslint/generators/convert-to-flat-config", + "path": "linter/generators/convert-to-flat-config", "type": "generator" } ], "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "eslint", - "packageName": "@nx/eslint", + "name": "linter", + "packageName": "@nx/linter", "root": "/packages/eslint", "source": "/packages/eslint/src" }, diff --git a/docs/generated/packages/eslint-plugin/documents/dependency-checks.md b/docs/generated/packages/eslint-plugin/documents/dependency-checks.md index 1a571d8a4dd5d5..6e8aae7bf9294d 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/eslint:lint", + "executor": "@nx/linter: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 dcab3273d9a5e1..751e5efbb12d18 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/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: +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: - [enforce-module-boundaries](#enforce-module-boundaries-rule) - [dependency-checks](#dependency-checks-rule) diff --git a/docs/generated/packages/eslint/executors/lint.json b/docs/generated/packages/linter/executors/eslint.json similarity index 62% rename from docs/generated/packages/eslint/executors/lint.json rename to docs/generated/packages/linter/executors/eslint.json index 1e4453f0fc0733..77173d5a0928b8 100644 --- a/docs/generated/packages/eslint/executors/lint.json +++ b/docs/generated/packages/linter/executors/eslint.json @@ -1,5 +1,5 @@ { - "name": "lint", + "name": "eslint", "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/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", + "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", "presets": [] }, "hasher": "./src/executors/lint/hasher", diff --git a/docs/generated/packages/eslint/generators/convert-to-flat-config.json b/docs/generated/packages/linter/generators/convert-to-flat-config.json similarity index 100% rename from docs/generated/packages/eslint/generators/convert-to-flat-config.json rename to docs/generated/packages/linter/generators/convert-to-flat-config.json diff --git a/docs/generated/packages/eslint/generators/workspace-rule.json b/docs/generated/packages/linter/generators/workspace-rule.json similarity index 92% rename from docs/generated/packages/eslint/generators/workspace-rule.json rename to docs/generated/packages/linter/generators/workspace-rule.json index c063d51be5170e..10e513eb0a64be 100644 --- a/docs/generated/packages/eslint/generators/workspace-rule.json +++ b/docs/generated/packages/linter/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/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", + "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", "presets": [] }, "description": "Create a new Workspace ESLint rule.", diff --git a/docs/generated/packages/eslint/generators/workspace-rules-project.json b/docs/generated/packages/linter/generators/workspace-rules-project.json similarity index 100% rename from docs/generated/packages/eslint/generators/workspace-rules-project.json rename to docs/generated/packages/linter/generators/workspace-rules-project.json diff --git a/docs/shared/core-features/automate-updating-dependencies.md b/docs/shared/core-features/automate-updating-dependencies.md index 0e3f70dae8bb73..1f320e04983f1d 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/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. +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. Updating happens in three steps: diff --git a/docs/shared/packages/linter/linter-plugin.md b/docs/shared/packages/linter/linter-plugin.md index 9c48f7cdcfc868..c8f105fff55f3f 100644 --- a/docs/shared/packages/linter/linter-plugin.md +++ b/docs/shared/packages/linter/linter-plugin.md @@ -32,7 +32,7 @@ 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) +- [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) ## ESLint plugin 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 6d254d91749e76..f9e9adb84e250f 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/eslint:lint](/nx-api/eslint/executors/lint) 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/lint:eslint](/nx-api/linter/executors/eslint) 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 475703c28a83d0..743f46800ba4ff 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -371,13 +371,13 @@ - [generators](/nx-api/esbuild/generators) - [init](/nx-api/esbuild/generators/init) - [configuration](/nx-api/esbuild/generators/configuration) - - [eslint](/nx-api/eslint) - - [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) + - [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-plugin](/nx-api/eslint-plugin) - [documents](/nx-api/eslint-plugin/documents) - [Overview](/nx-api/eslint-plugin/documents/overview) diff --git a/nx-dev/nx-dev/redirect-rules.js b/nx-dev/nx-dev/redirect-rules.js index 31964077d0bf91..de0f0d8d2521ca 100644 --- a/nx-dev/nx-dev/redirect-rules.js +++ b/nx-dev/nx-dev/redirect-rules.js @@ -897,10 +897,11 @@ const aiChat = { }; // rename nx/linter to eslint +// TODO(v17) invert these redirects const eslintRename = { - '/nx-api/linter': '/nx-api/eslint', - '/packages/linter': '/packages/eslint', - '/nx-api/linter/executors/eslint': '/nx-api/eslint/executors/lint', + '/nx-api/eslint': '/nx-api/linter', + '/packages/eslint': '/packages/linter', + '/nx-api/eslint/executors/lint': '/nx-api/linter/executors/eslint', }; /** diff --git a/packages/eslint/docs/eslint-examples.md b/packages/eslint/docs/eslint-examples.md index 03f7651a5e98be..95136037a12054 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/eslint:lint", + "executor": "@nx/linter:eslint", "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/eslint:lint", + "executor": "@nx/linter:eslint", "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/eslint:lint", + "executor": "@nx/linter:eslint", "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/eslint:lint", + "executor": "@nx/linter:eslint", "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/eslint:lint", + "executor": "@nx/linter:eslint", "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/eslint:lint", + "executor": "@nx/linter:eslint", "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 0191bee4c1b53f..0446b7e102b855 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/eslint:workspace-rule my-custom-rule +nx g @nx/linter:workspace-rule my-custom-rule ``` {% /tab %} @@ -13,7 +13,7 @@ nx g @nx/eslint:workspace-rule my-custom-rule We can change the default sub-folder from `rules` and specify a custom one: ```shell -nx g @nx/eslint:workspace-rule --name=my-custom-rule --directory=my/custom/path +nx g @nx/linter: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/scripts/documentation/package-schemas/package-metadata.ts b/scripts/documentation/package-schemas/package-metadata.ts index 10e5a498b9b9f6..f167dfc5d42aa8 100644 --- a/scripts/documentation/package-schemas/package-metadata.ts +++ b/scripts/documentation/package-schemas/package-metadata.ts @@ -139,8 +139,13 @@ export function findPackageMetadataList( ? null : { githubRoot: 'https://github.com/nrwl/nx/blob/master', - name: folderName, - packageName: packageJson.name, + // TODO(v17): Remove this replace + name: folderName === 'eslint' ? 'linter' : folderName, + // TODO(v17): Remove this replace + packageName: + packageJson.name === '@nx/eslint' + ? '@nx/linter' + : packageJson.name, description: packageJson.description, root: relativeFolderPath, source: join(relativeFolderPath, '/src'), @@ -152,7 +157,7 @@ export function findPackageMetadataList( content: readFileSync( join('docs', item.file + '.md'), 'utf8' - ), + ).replace('@nx/eslint', '@nx/linter'), })) : [], generators: getSchemaList( @@ -172,7 +177,14 @@ 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);