diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index 7b37e38a7a4037..1377eadbd1a5e1 100644 --- a/.github/workflows/e2e-matrix.yml +++ b/.github/workflows/e2e-matrix.yml @@ -117,7 +117,7 @@ jobs: - e2e-jest - e2e-js - e2e-lerna-smoke-tests - - e2e-linter + - e2e-eslint - e2e-next - e2e-node - e2e-nx-init @@ -165,7 +165,7 @@ jobs: codeowners: 'S04SJ6HHP0X' - project: e2e-lerna-smoke-tests codeowners: 'S04TNCVEETS' - - project: e2e-linter + - project: e2e-eslint codeowners: 'S04SYJGKSCT' - project: e2e-next codeowners: 'S04TNCNJG5N' @@ -227,7 +227,7 @@ jobs: - node_version: 16 project: e2e-js - node_version: 16 - project: e2e-linter + project: e2e-eslint - node_version: 16 project: e2e-next - node_version: 16 @@ -275,7 +275,7 @@ jobs: - node_version: 20 project: e2e-js - node_version: 20 - project: e2e-linter + project: e2e-eslint - node_version: 20 project: e2e-next - node_version: 20 diff --git a/.github/workflows/e2e-windows.yml b/.github/workflows/e2e-windows.yml index 6be6b5c8bf6fd9..0143a35c6278a1 100644 --- a/.github/workflows/e2e-windows.yml +++ b/.github/workflows/e2e-windows.yml @@ -86,7 +86,7 @@ jobs: - e2e-jest - e2e-js - e2e-lerna-smoke-tests - - e2e-linter + - e2e-eslint - e2e-next - e2e-node - e2e-nx-init @@ -119,7 +119,7 @@ jobs: codeowners: 'S04SJ6HHP0X' - project: e2e-lerna-smoke-tests codeowners: 'S04TNCVEETS' - - project: e2e-linter + - project: e2e-eslint codeowners: 'S04SYJGKSCT' - project: e2e-next codeowners: 'S04TNCNJG5N' @@ -168,7 +168,7 @@ jobs: - node_version: 16 project: e2e-js - node_version: 16 - project: e2e-linter + project: e2e-eslint - node_version: 16 project: e2e-next - node_version: 16 @@ -210,7 +210,7 @@ jobs: - node_version: 20 project: e2e-js - node_version: 20 - project: e2e-linter + project: e2e-eslint - node_version: 20 project: e2e-next - node_version: 20 diff --git a/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md b/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md index 0861f2e510327a..68be8ec7e9e156 100644 --- a/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md +++ b/docs/generated/devkit/ngcli_adapter/overrideCollectionResolutionForTesting.md @@ -17,7 +17,7 @@ overrideCollectionResolutionForTesting({ '../../../../workspace/generators.json' ), '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), - '@nx/linter': path.join(__dirname, '../../../../linter/generators.json'), + '@nx/eslint': path.join(__dirname, '../../../../linter/generators.json'), }); ``` diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index 5c640605218d62..15815db0113c8a 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -6533,6 +6533,65 @@ "isExternal": false, "disableCollapsible": false }, + { + "id": "eslint", + "path": "/nx-api/eslint", + "name": "eslint", + "children": [ + { + "id": "executors", + "path": "/nx-api/eslint/executors", + "name": "executors", + "children": [ + { + "id": "lint", + "path": "/nx-api/eslint/executors/lint", + "name": "lint", + "children": [], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + }, + { + "id": "generators", + "path": "/nx-api/eslint/generators", + "name": "generators", + "children": [ + { + "id": "workspace-rules-project", + "path": "/nx-api/eslint/generators/workspace-rules-project", + "name": "workspace-rules-project", + "children": [], + "isExternal": false, + "disableCollapsible": false + }, + { + "id": "workspace-rule", + "path": "/nx-api/eslint/generators/workspace-rule", + "name": "workspace-rule", + "children": [], + "isExternal": false, + "disableCollapsible": false + }, + { + "id": "convert-to-flat-config", + "path": "/nx-api/eslint/generators/convert-to-flat-config", + "name": "convert-to-flat-config", + "children": [], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + } + ], + "isExternal": false, + "disableCollapsible": false + }, { "id": "eslint-plugin", "path": "/nx-api/eslint-plugin", @@ -6998,82 +7057,6 @@ "isExternal": false, "disableCollapsible": false }, - { - "id": "linter", - "path": "/nx-api/linter", - "name": "linter", - "children": [ - { - "id": "documents", - "path": "/nx-api/linter/documents", - "name": "documents", - "children": [ - { - "name": "Overview", - "path": "/nx-api/linter/documents/overview", - "id": "overview", - "isExternal": false, - "children": [], - "disableCollapsible": false - } - ], - "isExternal": false, - "disableCollapsible": false - }, - { - "id": "executors", - "path": "/nx-api/linter/executors", - "name": "executors", - "children": [ - { - "id": "eslint", - "path": "/nx-api/linter/executors/eslint", - "name": "eslint", - "children": [], - "isExternal": false, - "disableCollapsible": false - } - ], - "isExternal": false, - "disableCollapsible": false - }, - { - "id": "generators", - "path": "/nx-api/linter/generators", - "name": "generators", - "children": [ - { - "id": "workspace-rules-project", - "path": "/nx-api/linter/generators/workspace-rules-project", - "name": "workspace-rules-project", - "children": [], - "isExternal": false, - "disableCollapsible": false - }, - { - "id": "workspace-rule", - "path": "/nx-api/linter/generators/workspace-rule", - "name": "workspace-rule", - "children": [], - "isExternal": false, - "disableCollapsible": false - }, - { - "id": "convert-to-flat-config", - "path": "/nx-api/linter/generators/convert-to-flat-config", - "name": "convert-to-flat-config", - "children": [], - "isExternal": false, - "disableCollapsible": false - } - ], - "isExternal": false, - "disableCollapsible": false - } - ], - "isExternal": false, - "disableCollapsible": false - }, { "id": "nest", "path": "/nx-api/nest", diff --git a/docs/generated/manifests/nx-api.json b/docs/generated/manifests/nx-api.json index 228eaf00234a9d..1a2ad86aa77af9 100644 --- a/docs/generated/manifests/nx-api.json +++ b/docs/generated/manifests/nx-api.json @@ -641,6 +641,56 @@ }, "path": "/nx-api/esbuild" }, + "eslint": { + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "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": {}, + "root": "/packages/eslint", + "source": "/packages/eslint/src", + "executors": { + "/nx-api/eslint/executors/lint": { + "description": "Run ESLint on a project.", + "file": "generated/packages/eslint/executors/lint.json", + "hidden": false, + "name": "lint", + "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", + "path": "/nx-api/eslint/executors/lint", + "type": "executor" + } + }, + "generators": { + "/nx-api/eslint/generators/workspace-rules-project": { + "description": "Create the Workspace Lint Rules Project.", + "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/eslint/generators/workspace-rules-project", + "type": "generator" + }, + "/nx-api/eslint/generators/workspace-rule": { + "description": "Create a new Workspace ESLint rule.", + "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/eslint/generators/workspace-rule", + "type": "generator" + }, + "/nx-api/eslint/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", + "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", + "type": "generator" + } + }, + "path": "/nx-api/eslint" + }, "eslint-plugin": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "eslint-plugin", @@ -1078,68 +1128,6 @@ }, "path": "/nx-api/js" }, - "linter": { - "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "linter", - "packageName": "@nx/linter", - "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "documents": { - "/nx-api/linter/documents/overview": { - "id": "overview", - "name": "Overview", - "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "file": "generated/packages/linter/documents/overview", - "itemList": [], - "isExternal": false, - "path": "/nx-api/linter/documents/overview", - "tags": [], - "originalFilePath": "shared/packages/linter/linter-plugin" - } - }, - "root": "/packages/linter", - "source": "/packages/linter/src", - "executors": { - "/nx-api/linter/executors/eslint": { - "description": "Run ESLint on a project.", - "file": "generated/packages/linter/executors/eslint.json", - "hidden": false, - "name": "eslint", - "originalFilePath": "/packages/linter/src/executors/eslint/schema.json", - "path": "/nx-api/linter/executors/eslint", - "type": "executor" - } - }, - "generators": { - "/nx-api/linter/generators/workspace-rules-project": { - "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/linter/generators/workspace-rules-project.json", - "hidden": true, - "name": "workspace-rules-project", - "originalFilePath": "/packages/linter/src/generators/workspace-rules-project/schema.json", - "path": "/nx-api/linter/generators/workspace-rules-project", - "type": "generator" - }, - "/nx-api/linter/generators/workspace-rule": { - "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/linter/generators/workspace-rule.json", - "hidden": false, - "name": "workspace-rule", - "originalFilePath": "/packages/linter/src/generators/workspace-rule/schema.json", - "path": "/nx-api/linter/generators/workspace-rule", - "type": "generator" - }, - "/nx-api/linter/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", - "hidden": false, - "name": "convert-to-flat-config", - "originalFilePath": "/packages/linter/src/generators/convert-to-flat-config/schema.json", - "path": "/nx-api/linter/generators/convert-to-flat-config", - "type": "generator" - } - }, - "path": "/nx-api/linter" - }, "nest": { "githubRoot": "https://github.com/nrwl/nx/blob/master", "name": "nest", diff --git a/docs/generated/packages-metadata.json b/docs/generated/packages-metadata.json index 667fc7768181f7..806bccb1cc77d4 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -634,6 +634,55 @@ "root": "/packages/esbuild", "source": "/packages/esbuild/src" }, + { + "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "documents": [], + "executors": [ + { + "description": "Run ESLint on a project.", + "file": "generated/packages/eslint/executors/lint.json", + "hidden": false, + "name": "lint", + "originalFilePath": "/packages/eslint/src/executors/lint/schema.json", + "path": "eslint/executors/lint", + "type": "executor" + } + ], + "generators": [ + { + "description": "Create the Workspace Lint Rules Project.", + "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": "eslint/generators/workspace-rules-project", + "type": "generator" + }, + { + "description": "Create a new Workspace ESLint rule.", + "file": "generated/packages/eslint/generators/workspace-rule.json", + "hidden": false, + "name": "workspace-rule", + "originalFilePath": "/packages/eslint/src/generators/workspace-rule/schema.json", + "path": "eslint/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", + "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", + "type": "generator" + } + ], + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "eslint", + "packageName": "@nx/eslint", + "root": "/packages/eslint", + "source": "/packages/eslint/src" + }, { "description": "The 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 an Nx-specific lint rule called enforce-module-boundaries.", "documents": [ @@ -1066,67 +1115,6 @@ "root": "/packages/js", "source": "/packages/js/src" }, - { - "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "documents": [ - { - "id": "overview", - "name": "Overview", - "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", - "file": "generated/packages/linter/documents/overview", - "itemList": [], - "isExternal": false, - "path": "linter/documents/overview", - "tags": [], - "originalFilePath": "shared/packages/linter/linter-plugin" - } - ], - "executors": [ - { - "description": "Run ESLint on a project.", - "file": "generated/packages/linter/executors/eslint.json", - "hidden": false, - "name": "eslint", - "originalFilePath": "/packages/linter/src/executors/eslint/schema.json", - "path": "linter/executors/eslint", - "type": "executor" - } - ], - "generators": [ - { - "description": "Create the Workspace Lint Rules Project.", - "file": "generated/packages/linter/generators/workspace-rules-project.json", - "hidden": true, - "name": "workspace-rules-project", - "originalFilePath": "/packages/linter/src/generators/workspace-rules-project/schema.json", - "path": "linter/generators/workspace-rules-project", - "type": "generator" - }, - { - "description": "Create a new Workspace ESLint rule.", - "file": "generated/packages/linter/generators/workspace-rule.json", - "hidden": false, - "name": "workspace-rule", - "originalFilePath": "/packages/linter/src/generators/workspace-rule/schema.json", - "path": "linter/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", - "hidden": false, - "name": "convert-to-flat-config", - "originalFilePath": "/packages/linter/src/generators/convert-to-flat-config/schema.json", - "path": "linter/generators/convert-to-flat-config", - "type": "generator" - } - ], - "githubRoot": "https://github.com/nrwl/nx/blob/master", - "name": "linter", - "packageName": "@nx/linter", - "root": "/packages/linter", - "source": "/packages/linter/src" - }, { "description": "The Nx Plugin for Nest contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.", "documents": [ diff --git a/docs/generated/packages/eslint-plugin/documents/dependency-checks.md b/docs/generated/packages/eslint-plugin/documents/dependency-checks.md index aaa8998a457c7c..1a571d8a4dd5d5 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:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/docs/generated/packages/linter/executors/eslint.json b/docs/generated/packages/eslint/executors/lint.json similarity index 60% rename from docs/generated/packages/linter/executors/eslint.json rename to docs/generated/packages/eslint/executors/lint.json index 82d84942d39d52..1e4453f0fc0733 100644 --- a/docs/generated/packages/linter/executors/eslint.json +++ b/docs/generated/packages/eslint/executors/lint.json @@ -1,6 +1,6 @@ { - "name": "eslint", - "implementation": "/packages/linter/src/executors/eslint/lint.impl.ts", + "name": "lint", + "implementation": "/packages/eslint/src/executors/lint/lint.impl.ts", "schema": { "version": 2, "outputCapture": "direct-nodejs", @@ -136,13 +136,13 @@ } }, "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/eslint/hasher", + "hasher": "./src/executors/lint/hasher", "description": "Run ESLint on a project.", "aliases": [], "hidden": false, - "path": "/packages/linter/src/executors/eslint/schema.json", + "path": "/packages/eslint/src/executors/lint/schema.json", "type": "executor" } 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 85% rename from docs/generated/packages/linter/generators/convert-to-flat-config.json rename to docs/generated/packages/eslint/generators/convert-to-flat-config.json index 0bbddebb1d165d..0658338d098619 100644 --- a/docs/generated/packages/linter/generators/convert-to-flat-config.json +++ b/docs/generated/packages/eslint/generators/convert-to-flat-config.json @@ -20,9 +20,9 @@ "presets": [] }, "description": "Convert an Nx workspace's ESLint configs to use Flat Config.", - "implementation": "/packages/linter/src/generators/convert-to-flat-config/generator.ts", + "implementation": "/packages/eslint/src/generators/convert-to-flat-config/generator.ts", "aliases": [], "hidden": false, - "path": "/packages/linter/src/generators/convert-to-flat-config/schema.json", + "path": "/packages/eslint/src/generators/convert-to-flat-config/schema.json", "type": "generator" } 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 e80e3eff5dd16b..10e513eb0a64be 100644 --- a/docs/generated/packages/linter/generators/workspace-rule.json +++ b/docs/generated/packages/eslint/generators/workspace-rule.json @@ -26,9 +26,9 @@ "presets": [] }, "description": "Create a new Workspace ESLint rule.", - "implementation": "/packages/linter/src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator.ts", + "implementation": "/packages/eslint/src/generators/workspace-rule/workspace-rule#lintWorkspaceRuleGenerator.ts", "aliases": [], "hidden": false, - "path": "/packages/linter/src/generators/workspace-rule/schema.json", + "path": "/packages/eslint/src/generators/workspace-rule/schema.json", "type": "generator" } diff --git a/docs/generated/packages/linter/generators/workspace-rules-project.json b/docs/generated/packages/eslint/generators/workspace-rules-project.json similarity index 88% rename from docs/generated/packages/linter/generators/workspace-rules-project.json rename to docs/generated/packages/eslint/generators/workspace-rules-project.json index 571bb3c5802dae..237556f3471160 100644 --- a/docs/generated/packages/linter/generators/workspace-rules-project.json +++ b/docs/generated/packages/eslint/generators/workspace-rules-project.json @@ -27,8 +27,8 @@ }, "description": "Create the Workspace Lint Rules Project.", "hidden": true, - "implementation": "/packages/linter/src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator.ts", + "implementation": "/packages/eslint/src/generators/workspace-rules-project/workspace-rules-project#lintWorkspaceRulesProjectGenerator.ts", "aliases": [], - "path": "/packages/linter/src/generators/workspace-rules-project/schema.json", + "path": "/packages/eslint/src/generators/workspace-rules-project/schema.json", "type": "generator" } diff --git a/docs/generated/packages/linter/documents/overview.md b/docs/generated/packages/linter/documents/overview.md deleted file mode 100644 index f987ba1a7cb9c1..00000000000000 --- a/docs/generated/packages/linter/documents/overview.md +++ /dev/null @@ -1,39 +0,0 @@ -The Linter plugin contains executors, generator, plugin and utilities used for linting JavaScript/TypeScript projects within an Nx workspace. - -## Setting Up Linter - -### Installation - -{% callout type="note" title="Keep Nx Package Versions In Sync" %} -Make sure to install the `@nx/linter` 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/linter` by running the following commands if `@nx/linter` package is not installed: - -```shell -npm i --save-dev @nx/linter -``` - -```shell -yarn add --dev @nx/linter -``` - -## 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/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 - -Read about our dedicated ESLint plugin - [eslint-plugin-nx](/nx-api/eslint-plugin/documents/overview). diff --git a/docs/shared/angular-standalone-tutorial/3-task-running.md b/docs/shared/angular-standalone-tutorial/3-task-running.md index 8f2f7d9b7f119f..89126ea47f7125 100644 --- a/docs/shared/angular-standalone-tutorial/3-task-running.md +++ b/docs/shared/angular-standalone-tutorial/3-task-running.md @@ -47,7 +47,7 @@ Here's the `project.json` file for your `shared-ui` project: } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": ["shared/ui/**/*.ts", "shared/ui/**/*.html"] } diff --git a/docs/shared/angular-standalone-tutorial/4-task-pipelines.md b/docs/shared/angular-standalone-tutorial/4-task-pipelines.md index 580479c42e97f4..84e5c4c0375a58 100644 --- a/docs/shared/angular-standalone-tutorial/4-task-pipelines.md +++ b/docs/shared/angular-standalone-tutorial/4-task-pipelines.md @@ -162,7 +162,7 @@ Here are the outputs defined for the `shared-ui` project: } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": ["shared/ui/**/*.ts", "shared/ui/**/*.html"] } diff --git a/docs/shared/node-server-tutorial/3-task-running.md b/docs/shared/node-server-tutorial/3-task-running.md index 0ff128d3c7dde9..39ca6e52ea4a7e 100644 --- a/docs/shared/node-server-tutorial/3-task-running.md +++ b/docs/shared/node-server-tutorial/3-task-running.md @@ -37,7 +37,7 @@ Here's the `project.json` file for the `auth` project: } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["auth/**/*.ts"] diff --git a/docs/shared/node-server-tutorial/4-task-pipelines.md b/docs/shared/node-server-tutorial/4-task-pipelines.md index 961477fdcc6a38..d75c660bb5a623 100644 --- a/docs/shared/node-server-tutorial/4-task-pipelines.md +++ b/docs/shared/node-server-tutorial/4-task-pipelines.md @@ -146,7 +146,7 @@ Here are the outputs defined for the `auth` project: } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "outputFile": "dist/auth/lint-report.txt" diff --git a/docs/shared/packages/linter/dependency-checks.md b/docs/shared/packages/linter/dependency-checks.md index aaa8998a457c7c..1a571d8a4dd5d5 100644 --- a/docs/shared/packages/linter/dependency-checks.md +++ b/docs/shared/packages/linter/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:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/docs/shared/recipes/reduce-repetitive-configuration.md b/docs/shared/recipes/reduce-repetitive-configuration.md index 2320a401b9a1e5..4aa70664e4e9e4 100644 --- a/docs/shared/recipes/reduce-repetitive-configuration.md +++ b/docs/shared/recipes/reduce-repetitive-configuration.md @@ -44,7 +44,7 @@ All three libraries have a similar project configuration. Here is what their `pr } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/lib1/**/*.ts"] @@ -90,7 +90,7 @@ All three libraries have a similar project configuration. Here is what their `pr } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/lib2/**/*.ts"] @@ -137,7 +137,7 @@ All three libraries have a similar project configuration. Here is what their `pr } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["libs/lib3/**/*.ts"] @@ -185,7 +185,7 @@ Let's use the `targetDefaults` property in `nx.json` to reduce some of this dupl } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["{projectRoot}/**/*.ts"] 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 641f4332a187ae..0c2fadb4fb2613 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/linter: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/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 cc8fc339724dd3..62e3b4d26e770a 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -371,6 +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) - [eslint-plugin](/nx-api/eslint-plugin) - [documents](/nx-api/eslint-plugin/documents) - [Overview](/nx-api/eslint-plugin/documents/overview) @@ -427,15 +434,6 @@ - [release-version](/nx-api/js/generators/release-version) - [setup-verdaccio](/nx-api/js/generators/setup-verdaccio) - [setup-build](/nx-api/js/generators/setup-build) - - [linter](/nx-api/linter) - - [documents](/nx-api/linter/documents) - - [Overview](/nx-api/linter/documents/overview) - - [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) - [nest](/nx-api/nest) - [documents](/nx-api/nest/documents) - [Overview](/nx-api/nest/documents/overview) diff --git a/e2e/angular-core/src/config.test.ts b/e2e/angular-core/src/config.test.ts index 36f16520947d7c..9dd2dadb38b719 100644 --- a/e2e/angular-core/src/config.test.ts +++ b/e2e/angular-core/src/config.test.ts @@ -120,7 +120,7 @@ const angularV1Json = (appName: string) => `{ } }, "lint": { - "builder": "@nx/linter:eslint", + "builder": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "${appName}/src/**/*.ts", @@ -158,7 +158,7 @@ const angularV1Json = (appName: string) => `{ } }, "lint": { - "builder": "@nx/linter:eslint", + "builder": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["${appName}-e2e/**/*.{js,ts}"] diff --git a/e2e/angular-core/src/ng-add.test.ts b/e2e/angular-core/src/ng-add.test.ts index 1104206fd0fc4e..6aa7e09486bf6f 100644 --- a/e2e/angular-core/src/ng-add.test.ts +++ b/e2e/angular-core/src/ng-add.test.ts @@ -410,7 +410,7 @@ describe('convert Angular CLI workspace to an Nx workspace', () => { const projectConfig = readJson(`apps/${project}/project.json`); expect(projectConfig.targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: [ `apps/${project}/src/**/*.ts`, diff --git a/e2e/linter/jest.config.ts b/e2e/eslint/jest.config.ts similarity index 92% rename from e2e/linter/jest.config.ts rename to e2e/eslint/jest.config.ts index 95190f44887064..d04ab1546a328b 100644 --- a/e2e/linter/jest.config.ts +++ b/e2e/eslint/jest.config.ts @@ -8,6 +8,6 @@ export default { globals: {}, globalSetup: '../utils/global-setup.ts', globalTeardown: '../utils/global-teardown.ts', - displayName: 'e2e-linter', + displayName: 'e2e-eslint', preset: '../../jest.preset.js', }; diff --git a/e2e/linter/project.json b/e2e/eslint/project.json similarity index 59% rename from e2e/linter/project.json rename to e2e/eslint/project.json index 7b61e586005dce..b9e741dac42151 100644 --- a/e2e/linter/project.json +++ b/e2e/eslint/project.json @@ -1,19 +1,19 @@ { - "name": "e2e-linter", + "name": "e2e-eslint", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "e2e/linter", + "sourceRoot": "e2e/eslint", "projectType": "application", "targets": { "e2e": {}, "run-e2e-tests": { "executor": "@nx/jest:jest", "options": { - "jestConfig": "e2e/linter/jest.config.ts", + "jestConfig": "e2e/eslint/jest.config.ts", "passWithNoTests": true, "runInBand": true }, - "outputs": ["{workspaceRoot}/coverage/e2e/linter"] + "outputs": ["{workspaceRoot}/coverage/e2e/eslint"] } }, - "implicitDependencies": ["linter"] + "implicitDependencies": ["eslint"] } diff --git a/e2e/linter/src/linter.test.ts b/e2e/eslint/src/linter.test.ts similarity index 100% rename from e2e/linter/src/linter.test.ts rename to e2e/eslint/src/linter.test.ts diff --git a/e2e/linter/tsconfig.json b/e2e/eslint/tsconfig.json similarity index 100% rename from e2e/linter/tsconfig.json rename to e2e/eslint/tsconfig.json diff --git a/e2e/linter/tsconfig.spec.json b/e2e/eslint/tsconfig.spec.json similarity index 100% rename from e2e/linter/tsconfig.spec.json rename to e2e/eslint/tsconfig.spec.json diff --git a/nx-dev/nx-dev-e2e/src/packages.spec.ts b/nx-dev/nx-dev-e2e/src/packages.spec.ts index 91f4e89fe38d10..9e313dbf865c6e 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/linter' }, + { title: '@nx/eslint', path: '/packages/eslint' }, { - title: '@nx/linter:workspace-rules-project', + title: '@nx/eslint:workspace-rules-project', path: '/packages/linter/generators/workspace-rules-project', }, { - title: '@nx/linter', + title: '@nx/eslint', path: '/packages/linter/generators/workspace-rule', }, - { title: '@nx/linter', path: '/packages/linter/executors/eslint' }, + { title: '@nx/eslint', path: '/packages/linter/executors/eslint' }, { title: '@nx/nest', path: '/packages/nest' }, { title: '@nx/nest:application', diff --git a/packages-legacy/linter-nx/README.md b/packages-legacy/linter-nx/README.md new file mode 100644 index 00000000000000..9d5d0bd34d1c50 --- /dev/null +++ b/packages-legacy/linter-nx/README.md @@ -0,0 +1,13 @@ +## @nx/linter has been renamed to @nx/eslint! + +@nx/linter has been renamed to [@nx/eslint](https://www.npmjs.com/package/@nx/eslint). Please use that instead. + +[Read more here](https://nx.dev/recipes/other/rescope) + +@nx/linter will no longer be published in Nx v18. + +

Nx - Smart, Fast and Extensible Build System

+ +# Nx: Smart, Fast and Extensible Build System + +Nx is a next generation build system with first class monorepo support and powerful integrations. diff --git a/packages-legacy/linter-nx/executors.json b/packages-legacy/linter-nx/executors.json new file mode 100644 index 00000000000000..82ea0a29287b79 --- /dev/null +++ b/packages-legacy/linter-nx/executors.json @@ -0,0 +1,17 @@ +{ + "builders": { + "eslint": { + "implementation": "@nx/eslint/src/executors/lint/compat", + "schema": "@nx/eslint/src/executors/lint/schema.json", + "description": "Run ESLint on a project." + } + }, + "executors": { + "eslint": { + "implementation": "@nx/eslint/src/executors/lint/lint.impl", + "schema": "@nx/eslint/src/executors/lint/schema.json", + "hasher": "@nx/eslint/src/executors/lint/hasher", + "description": "Run ESLint on a project." + } + } +} diff --git a/packages-legacy/linter-nx/generators.json b/packages-legacy/linter-nx/generators.json new file mode 100644 index 00000000000000..0ff8e21d462728 --- /dev/null +++ b/packages-legacy/linter-nx/generators.json @@ -0,0 +1,4 @@ +{ + "extends": ["@nx/eslint"], + "schematics": {} +} diff --git a/packages-legacy/linter-nx/index.ts b/packages-legacy/linter-nx/index.ts new file mode 100644 index 00000000000000..e320f1b0c99aa3 --- /dev/null +++ b/packages-legacy/linter-nx/index.ts @@ -0,0 +1 @@ +export * from '@nx/eslint'; diff --git a/packages-legacy/linter-nx/package.json b/packages-legacy/linter-nx/package.json new file mode 100644 index 00000000000000..f902d3ea2a1fcc --- /dev/null +++ b/packages-legacy/linter-nx/package.json @@ -0,0 +1,37 @@ +{ + "name": "@nx/linter", + "version": "0.0.1", + "private": false, + "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "repository": { + "type": "git", + "url": "https://github.com/nrwl/nx.git", + "directory": "packages-legacy/linter-nx" + }, + "keywords": [ + "Monorepo", + "Web", + "Lint", + "ESLint", + "CLI" + ], + "main": "./index", + "typings": "./index.d.ts", + "author": "Victor Savkin", + "license": "MIT", + "bugs": { + "url": "https://github.com/nrwl/nx/issues" + }, + "homepage": "https://nx.dev", + "builders": "./executors.json", + "schematics": "./generators.json", + "dependencies": { + "@nx/eslint": "file:../../packages/eslint" + }, + "publishConfig": { + "access": "public" + }, + "nx-migrations": { + "migrations": "@nx/eslint/migrations.json" + } +} diff --git a/packages-legacy/linter-nx/project.json b/packages-legacy/linter-nx/project.json new file mode 100644 index 00000000000000..4c6533fa9717d8 --- /dev/null +++ b/packages-legacy/linter-nx/project.json @@ -0,0 +1,38 @@ +{ + "name": "linter-nx-legacy", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages-legacy/linter-nx", + "projectType": "library", + "targets": { + "build": { + "command": "node ./scripts/copy-readme.js linter-nx-legacy" + }, + "build-base": { + "executor": "@nx/js:tsc", + "dependsOn": ["^build-base"], + "options": { + "main": "packages-legacy/linter-nx/index.ts", + "tsConfig": "packages-legacy/linter-nx/tsconfig.json", + "outputPath": "build/packages/linter-nx-legacy", + "assets": [ + { + "input": "packages-legacy/linter-nx", + "glob": "**/*.json", + "ignore": ["**/tsconfig*.json", "project.json"], + "output": "/" + }, + { + "input": "packages-legacy/linter-nx", + "glob": "**/*.d.ts", + "output": "/" + }, + { + "input": "", + "glob": "LICENSE", + "output": "/" + } + ] + } + } + } +} diff --git a/packages-legacy/linter-nx/tsconfig.json b/packages-legacy/linter-nx/tsconfig.json new file mode 100644 index 00000000000000..133314b126cffc --- /dev/null +++ b/packages-legacy/linter-nx/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": {}, + "include": ["**/*.ts"], + "files": ["index.ts"] +} diff --git a/packages-legacy/linter/executors.json b/packages-legacy/linter/executors.json index ba70860fa5761e..82ea0a29287b79 100644 --- a/packages-legacy/linter/executors.json +++ b/packages-legacy/linter/executors.json @@ -1,16 +1,16 @@ { "builders": { "eslint": { - "implementation": "@nx/linter/src/executors/eslint/compat", - "schema": "@nx/linter/src/executors/eslint/schema.json", + "implementation": "@nx/eslint/src/executors/lint/compat", + "schema": "@nx/eslint/src/executors/lint/schema.json", "description": "Run ESLint on a project." } }, "executors": { "eslint": { - "implementation": "@nx/linter/src/executors/eslint/lint.impl", - "schema": "@nx/linter/src/executors/eslint/schema.json", - "hasher": "@nx/linter/src/executors/eslint/hasher", + "implementation": "@nx/eslint/src/executors/lint/lint.impl", + "schema": "@nx/eslint/src/executors/lint/schema.json", + "hasher": "@nx/eslint/src/executors/lint/hasher", "description": "Run ESLint on a project." } } diff --git a/packages-legacy/linter/generators.json b/packages-legacy/linter/generators.json index 331f10e4586c61..0ff8e21d462728 100644 --- a/packages-legacy/linter/generators.json +++ b/packages-legacy/linter/generators.json @@ -1,4 +1,4 @@ { - "extends": ["@nx/linter"], + "extends": ["@nx/eslint"], "schematics": {} } diff --git a/packages-legacy/linter/index.ts b/packages-legacy/linter/index.ts index ef67cd24cb9b40..e320f1b0c99aa3 100644 --- a/packages-legacy/linter/index.ts +++ b/packages-legacy/linter/index.ts @@ -1 +1 @@ -export * from '@nx/linter'; +export * from '@nx/eslint'; diff --git a/packages-legacy/linter/package.json b/packages-legacy/linter/package.json index c920961a361452..ef0ca3de895978 100644 --- a/packages-legacy/linter/package.json +++ b/packages-legacy/linter/package.json @@ -26,12 +26,12 @@ "builders": "./executors.json", "schematics": "./generators.json", "dependencies": { - "@nx/linter": "file:../../packages/linter" + "@nx/eslint": "file:../../packages/eslint" }, "publishConfig": { "access": "public" }, "nx-migrations": { - "migrations": "@nx/linter/migrations.json" + "migrations": "@nx/eslint/migrations.json" } } diff --git a/packages-legacy/nest/project.json b/packages-legacy/nest/project.json index b961e9a140b591..d6891825bb9ce4 100644 --- a/packages-legacy/nest/project.json +++ b/packages-legacy/nest/project.json @@ -35,5 +35,5 @@ } } }, - "implicitDependencies": ["node", "linter"] + "implicitDependencies": ["node", "eslint"] } diff --git a/packages/angular/package.json b/packages/angular/package.json index 747bc783362a75..9f8c706faa48d6 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -62,7 +62,7 @@ "@nx/cypress": "file:../cypress", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/webpack": "file:../webpack", "@nx/workspace": "file:../workspace" }, diff --git a/packages/angular/src/generators/add-linting/add-linting.spec.ts b/packages/angular/src/generators/add-linting/add-linting.spec.ts index b23fa88464c687..f298773d34dad8 100644 --- a/packages/angular/src/generators/add-linting/add-linting.spec.ts +++ b/packages/angular/src/generators/add-linting/add-linting.spec.ts @@ -6,7 +6,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import * as linter from '@nx/linter'; +import * as linter from '@nx/eslint'; import { addLintingGenerator } from './add-linting'; describe('addLinting generator', () => { @@ -72,7 +72,7 @@ describe('addLinting generator', () => { const project = readProjectConfiguration(tree, appProjectName); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: [ `${appProjectRoot}/**/*.ts`, @@ -150,7 +150,7 @@ describe('addLinting generator', () => { const project = readProjectConfiguration(tree, appProjectName); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: [ `${appProjectRoot}/**/*.ts`, diff --git a/packages/angular/src/generators/add-linting/add-linting.ts b/packages/angular/src/generators/add-linting/add-linting.ts index 1500a0007b94c9..fc531abe75933d 100755 --- a/packages/angular/src/generators/add-linting/add-linting.ts +++ b/packages/angular/src/generators/add-linting/add-linting.ts @@ -6,15 +6,15 @@ import { runTasksInSerial, Tree, } from '@nx/devkit'; -import { Linter, lintProjectGenerator } from '@nx/linter'; -import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; +import { mapLintPattern } from '@nx/eslint/src/generators/lint-project/lint-project'; import { addAngularEsLintDependencies } from './lib/add-angular-eslint-dependencies'; import type { AddLintingGeneratorSchema } from './schema'; import { findEslintFile, isEslintConfigSupported, replaceOverridesInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; import { camelize, dasherize } from '@nx/devkit/src/utils/string-utils'; export async function addLintingGenerator( diff --git a/packages/angular/src/generators/application/application.spec.ts b/packages/angular/src/generators/application/application.spec.ts index 299f297ef7fb30..cd2dd979c55020 100644 --- a/packages/angular/src/generators/application/application.spec.ts +++ b/packages/angular/src/generators/application/application.spec.ts @@ -11,7 +11,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import * as enquirer from 'enquirer'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { @@ -471,7 +471,7 @@ describe('app', () => { expect(readProjectConfiguration(appTree, 'my-app').targets.lint) .toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app/**/*.ts", @@ -486,7 +486,7 @@ describe('app', () => { expect(readProjectConfiguration(appTree, 'my-app-e2e').targets.lint) .toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", diff --git a/packages/angular/src/generators/application/lib/add-linting.ts b/packages/angular/src/generators/application/lib/add-linting.ts index f1ff025624e861..8f6983f0aae1fe 100644 --- a/packages/angular/src/generators/application/lib/add-linting.ts +++ b/packages/angular/src/generators/application/lib/add-linting.ts @@ -1,7 +1,7 @@ import type { Tree } from '@nx/devkit'; import type { NormalizedSchema } from './normalized-schema'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import addLintingGenerator from '../../add-linting/add-linting'; export async function addLinting(host: Tree, options: NormalizedSchema) { diff --git a/packages/angular/src/generators/application/lib/normalize-options.ts b/packages/angular/src/generators/application/lib/normalize-options.ts index 04b9b9eeddaab3..d3e481b744a840 100644 --- a/packages/angular/src/generators/application/lib/normalize-options.ts +++ b/packages/angular/src/generators/application/lib/normalize-options.ts @@ -1,7 +1,7 @@ import { Tree } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; import { getNpmScope } from '@nx/js/src/utils/package-json/get-npm-scope'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners'; import { normalizeNewProjectPrefix } from '../../utils/project'; import type { Schema } from '../schema'; diff --git a/packages/angular/src/generators/application/lib/normalized-schema.ts b/packages/angular/src/generators/application/lib/normalized-schema.ts index 5eb30bdb724e31..dbfd8f83fa7402 100644 --- a/packages/angular/src/generators/application/lib/normalized-schema.ts +++ b/packages/angular/src/generators/application/lib/normalized-schema.ts @@ -1,6 +1,6 @@ import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners'; import type { Schema } from '../schema'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export interface NormalizedSchema extends Schema { linter: Linter; diff --git a/packages/angular/src/generators/application/schema.d.ts b/packages/angular/src/generators/application/schema.d.ts index c13a0ec15825ae..cdb84fd5f505a9 100644 --- a/packages/angular/src/generators/application/schema.d.ts +++ b/packages/angular/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/component-test/component-test.spec.ts b/packages/angular/src/generators/component-test/component-test.spec.ts index cfaf4357172983..08e6998a9bb217 100644 --- a/packages/angular/src/generators/component-test/component-test.spec.ts +++ b/packages/angular/src/generators/component-test/component-test.spec.ts @@ -1,7 +1,7 @@ import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { UnitTestRunner } from '../../utils/test-runners'; import { componentGenerator } from '../component/component'; import { generateTestLibrary } from '../utils/testing'; @@ -73,7 +73,7 @@ export class MyLibComponent implements OnInit { @Input() message: string | undefined; @Input() anotherProp: any; @Input() anotherNeverProp: never; - + constructor() { } ngOnInit(): void { @@ -186,11 +186,11 @@ describe(MyLibComponent.name, () => { beforeEach(() => { TestBed.overrideComponent(MyLibComponent, { - add: { + add: { imports: [], providers: [] } - }) + }) }) it('renders', () => { diff --git a/packages/angular/src/generators/host/schema.d.ts b/packages/angular/src/generators/host/schema.d.ts index 4ad7be7d2578f8..917b248ea30bd7 100644 --- a/packages/angular/src/generators/host/schema.d.ts +++ b/packages/angular/src/generators/host/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/init/init.spec.ts b/packages/angular/src/generators/init/init.spec.ts index dfc3ea4a2a90e0..47babcef7a8a49 100644 --- a/packages/angular/src/generators/init/init.spec.ts +++ b/packages/angular/src/generators/init/init.spec.ts @@ -17,7 +17,7 @@ import { updateNxJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { backwardCompatibleVersions } from '../../utils/backward-compatible-versions'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { angularDevkitVersion, angularVersion } from '../../utils/versions'; diff --git a/packages/angular/src/generators/init/init.ts b/packages/angular/src/generators/init/init.ts index 100847d840ffee..d8a34f1e9bd75c 100755 --- a/packages/angular/src/generators/init/init.ts +++ b/packages/angular/src/generators/init/init.ts @@ -10,7 +10,7 @@ import { updateNxJson, } from '@nx/devkit'; import { jestInitGenerator } from '@nx/jest'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { initGenerator as jsInitGenerator } from '@nx/js'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import { diff --git a/packages/angular/src/generators/init/schema.d.ts b/packages/angular/src/generators/init/schema.d.ts index 3c0cacfbb1cd7d..1530d8691d70e6 100644 --- a/packages/angular/src/generators/init/schema.d.ts +++ b/packages/angular/src/generators/init/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/library/lib/normalize-options.ts b/packages/angular/src/generators/library/lib/normalize-options.ts index 9fb8c6fa82171a..583438f99afec2 100644 --- a/packages/angular/src/generators/library/lib/normalize-options.ts +++ b/packages/angular/src/generators/library/lib/normalize-options.ts @@ -1,7 +1,7 @@ import { names, Tree } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; import { getNpmScope } from '@nx/js/src/utils/package-json/get-npm-scope'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { UnitTestRunner } from '../../../utils/test-runners'; import { normalizeNewProjectPrefix } from '../../utils/project'; import { Schema } from '../schema'; diff --git a/packages/angular/src/generators/library/lib/normalized-schema.ts b/packages/angular/src/generators/library/lib/normalized-schema.ts index 920652d5ce2c5d..5524bc66ae996d 100644 --- a/packages/angular/src/generators/library/lib/normalized-schema.ts +++ b/packages/angular/src/generators/library/lib/normalized-schema.ts @@ -1,5 +1,5 @@ import { UnitTestRunner } from '../../../utils/test-runners'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface NormalizedSchema { libraryOptions: { diff --git a/packages/angular/src/generators/library/library.spec.ts b/packages/angular/src/generators/library/library.spec.ts index aa17cb797cada9..7670aaf6b9d5d2 100644 --- a/packages/angular/src/generators/library/library.spec.ts +++ b/packages/angular/src/generators/library/library.spec.ts @@ -9,7 +9,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { backwardCompatibleVersions } from '../../utils/backward-compatible-versions'; import { createApp } from '../../utils/nx-devkit/testing'; import { UnitTestRunner } from '../../utils/test-runners'; @@ -1128,7 +1128,7 @@ describe('lib', () => { expect(readProjectConfiguration(tree, 'my-lib').targets['lint']) .toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-lib/**/*.ts", diff --git a/packages/angular/src/generators/library/library.ts b/packages/angular/src/generators/library/library.ts index 7a70d7a56232b4..3d96504c33cde6 100644 --- a/packages/angular/src/generators/library/library.ts +++ b/packages/angular/src/generators/library/library.ts @@ -6,7 +6,7 @@ import { Tree, } from '@nx/devkit'; import { configurationGenerator } from '@nx/jest'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { addTsConfigPath } from '@nx/js'; import { lt } from 'semver'; import init from '../../generators/init/init'; diff --git a/packages/angular/src/generators/library/schema.d.ts b/packages/angular/src/generators/library/schema.d.ts index a5398670d6b303..242fd8e48ef571 100644 --- a/packages/angular/src/generators/library/schema.d.ts +++ b/packages/angular/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { UnitTestRunner } from '../../utils/test-runners'; export interface Schema { diff --git a/packages/angular/src/generators/move/move.spec.ts b/packages/angular/src/generators/move/move.spec.ts index 12121171482394..ec73ac120e4fbc 100644 --- a/packages/angular/src/generators/move/move.spec.ts +++ b/packages/angular/src/generators/move/move.spec.ts @@ -1,7 +1,7 @@ import * as devkit from '@nx/devkit'; import { ProjectGraph, readJson, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { UnitTestRunner } from '../../utils/test-runners'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; import { generateTestLibrary } from '../utils/testing'; diff --git a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts index eabbd9808c5d9b..92672d179ff60c 100644 --- a/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.ts @@ -10,7 +10,7 @@ import { updateJson, updateProjectConfiguration, } from '@nx/devkit'; -import { hasRulesRequiringTypeChecking } from '@nx/linter'; +import { hasRulesRequiringTypeChecking } from '@nx/eslint'; import { dirname } from 'path'; import type { Logger, ProjectMigrationInfo } from '../../utilities'; import { BuilderMigrator } from './builder.migrator'; @@ -69,7 +69,7 @@ export class AngularEslintLintMigrator extends BuilderMigrator { targetName: string, target: TargetConfiguration ): Promise { - target.executor = '@nx/linter:eslint'; + target.executor = '@nx/eslint:lint'; if (!target.options) { this.logger.warn( diff --git a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts index 8b7eaa5c366f44..54551b816928e1 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/app.migrator.spec.ts @@ -877,7 +877,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], }, @@ -903,7 +903,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.myCustomLintTarget).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], }, @@ -930,7 +930,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { eslintConfig: 'apps/app1/.eslintrc.json', lintFilePatterns: ['apps/app1/**/*.ts', 'apps/app1/**/*.html'], @@ -969,7 +969,7 @@ describe('app migrator', () => { const { targets } = readProjectConfiguration(tree, 'app1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { eslintConfig: 'apps/app1/.eslintrc.json', hasTypeAwareRules: true, diff --git a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts index 4f39e9bdedd0eb..c180bb46dab47b 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts @@ -20,7 +20,7 @@ import { visitNotIgnoredFiles, writeJson, } from '@nx/devkit'; -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { getRootTsConfigPathInTree, insertImport } from '@nx/js'; import { basename, relative } from 'path'; import type { diff --git a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts index ce1cd972365188..47bc03b9a3a9ce 100644 --- a/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts +++ b/packages/angular/src/generators/ng-add/migrators/projects/lib.migrator.spec.ts @@ -710,7 +710,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], }, @@ -739,7 +739,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.myCustomLintTarget).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], }, @@ -769,7 +769,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { eslintConfig: 'libs/lib1/.eslintrc.json', lintFilePatterns: ['libs/lib1/**/*.ts', 'libs/lib1/**/*.html'], @@ -811,7 +811,7 @@ describe('lib migrator', () => { const { targets } = readProjectConfiguration(tree, 'lib1'); expect(targets.lint).toStrictEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { eslintConfig: 'libs/lib1/.eslintrc.json', hasTypeAwareRules: true, diff --git a/packages/angular/src/generators/ng-add/schema.d.ts b/packages/angular/src/generators/ng-add/schema.d.ts index 457bc2c0d10197..c8b70ab4f93bb6 100644 --- a/packages/angular/src/generators/ng-add/schema.d.ts +++ b/packages/angular/src/generators/ng-add/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/ng-add/utilities/workspace.ts b/packages/angular/src/generators/ng-add/utilities/workspace.ts index 2c7e875dc7ebff..581d03a08fb64e 100644 --- a/packages/angular/src/generators/ng-add/utilities/workspace.ts +++ b/packages/angular/src/generators/ng-add/utilities/workspace.ts @@ -9,7 +9,7 @@ import { updateNxJson, writeJson, } from '@nx/devkit'; -import { Linter, lintInitGenerator } from '@nx/linter'; +import { Linter, lintInitGenerator } from '@nx/eslint'; import { getRootTsConfigPathInTree, initGenerator as jsInitGenerator, diff --git a/packages/angular/src/generators/remote/schema.d.ts b/packages/angular/src/generators/remote/schema.d.ts index e2ec3c49a06d54..0a91bf222b00a8 100644 --- a/packages/angular/src/generators/remote/schema.d.ts +++ b/packages/angular/src/generators/remote/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; import type { Styles } from '../utils/types'; diff --git a/packages/angular/src/generators/storybook-configuration/schema.d.ts b/packages/angular/src/generators/storybook-configuration/schema.d.ts index 517f376627a054..e474621e9a8194 100644 --- a/packages/angular/src/generators/storybook-configuration/schema.d.ts +++ b/packages/angular/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface StorybookConfigurationOptions { configureStaticServe?: boolean; diff --git a/packages/angular/src/generators/utils/testing.ts b/packages/angular/src/generators/utils/testing.ts index a7574681990ccc..45cae6efd45da4 100644 --- a/packages/angular/src/generators/utils/testing.ts +++ b/packages/angular/src/generators/utils/testing.ts @@ -1,7 +1,7 @@ import type { Tree } from '@nx/devkit'; import { names, readProjectConfiguration, updateJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { UnitTestRunner } from '../../utils/test-runners'; import { angularDevkitVersion } from '../../utils/versions'; import { applicationGenerator } from '../application/application'; @@ -216,9 +216,9 @@ import { VariableSpreadDeclareButtonComponent } from './variable-spread-declare- import { VariableSpreadDeclareViewComponent } from './variable-spread-declare-view/variable-spread-declare-view.component'; import { VariableSpreadDeclareAnotherviewComponent } from './variable-spread-declare-anotherview/variable-spread-declare-anotherview.component'; -const COMPONENTS = [ - VariableSpreadDeclareButtonComponent, - VariableSpreadDeclareViewComponent +const COMPONENTS = [ + VariableSpreadDeclareButtonComponent, + VariableSpreadDeclareViewComponent ] @NgModule({ @@ -319,7 +319,7 @@ function generateModule( moduleFilePath, `import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; - + @NgModule({ declarations: [], imports: [CommonModule], diff --git a/packages/cypress/package.json b/packages/cypress/package.json index 892ea88470f0c3..d7c0d2b0925bde 100644 --- a/packages/cypress/package.json +++ b/packages/cypress/package.json @@ -40,7 +40,7 @@ "tslib": "^2.3.0", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter" + "@nx/eslint": "file:../eslint" }, "peerDependencies": { "cypress": ">= 3 < 14" diff --git a/packages/cypress/src/generators/configuration/configuration.ts b/packages/cypress/src/generators/configuration/configuration.ts index a4aa0f33bfbe0b..b5b65761fd5689 100644 --- a/packages/cypress/src/generators/configuration/configuration.ts +++ b/packages/cypress/src/generators/configuration/configuration.ts @@ -15,7 +15,7 @@ import { updateProjectConfiguration, } from '@nx/devkit'; import { getRelativePathToRootTsConfig } from '@nx/js'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { join } from 'path'; import { addLinterToCyProject } from '../../utils/add-linter'; import { addDefaultE2EConfig } from '../../utils/config'; diff --git a/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts b/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts index 590939d292ee37..52e24948b9dd2f 100644 --- a/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts +++ b/packages/cypress/src/generators/cypress-project/cypress-project.spec.ts @@ -8,7 +8,7 @@ import { import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { cypressProjectGenerator } from './cypress-project'; import { Schema } from './schema'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { installedCypressVersion } from '../../utils/cypress-version'; import { cypressInitGenerator } from '../init/init'; diff --git a/packages/cypress/src/generators/cypress-project/cypress-project.ts b/packages/cypress/src/generators/cypress-project/cypress-project.ts index 634d2880f04f86..bfb9489b66ffc5 100644 --- a/packages/cypress/src/generators/cypress-project/cypress-project.ts +++ b/packages/cypress/src/generators/cypress-project/cypress-project.ts @@ -20,7 +20,7 @@ import { import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver'; import { getRelativePathToRootTsConfig } from '@nx/js'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { join } from 'path'; import { major } from 'semver'; import { addLinterToCyProject } from '../../utils/add-linter'; diff --git a/packages/cypress/src/generators/cypress-project/schema.d.ts b/packages/cypress/src/generators/cypress-project/schema.d.ts index 8d480818e407b4..6abafe7f11c3e7 100644 --- a/packages/cypress/src/generators/cypress-project/schema.d.ts +++ b/packages/cypress/src/generators/cypress-project/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { project?: string; diff --git a/packages/cypress/src/utils/add-linter.ts b/packages/cypress/src/utils/add-linter.ts index 7f333f7b5c96d4..add4b4d513a3b7 100644 --- a/packages/cypress/src/utils/add-linter.ts +++ b/packages/cypress/src/utils/add-linter.ts @@ -6,7 +6,7 @@ import { runTasksInSerial, Tree, } from '@nx/devkit'; -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { installedCypressVersion } from './cypress-version'; import { eslintPluginCypressVersion } from './versions'; import { @@ -16,8 +16,8 @@ import { findEslintFile, isEslintConfigSupported, replaceOverridesInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; -import { javaScriptOverride } from '@nx/linter/src/generators/init/global-eslint-config'; +} from '@nx/eslint/src/generators/utils/eslint-file'; +import { javaScriptOverride } from '@nx/eslint/src/generators/init/global-eslint-config'; export interface CyLinterOptions { project: string; diff --git a/packages/detox/package.json b/packages/detox/package.json index 8437047ae186df..236b224d170f1f 100644 --- a/packages/detox/package.json +++ b/packages/detox/package.json @@ -28,7 +28,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/react": "file:../react", "tslib": "^2.3.0" }, diff --git a/packages/detox/src/generators/application/lib/add-linting.spec.ts b/packages/detox/src/generators/application/lib/add-linting.spec.ts index c2658f764c0980..80653dd5d6279c 100644 --- a/packages/detox/src/generators/application/lib/add-linting.spec.ts +++ b/packages/detox/src/generators/application/lib/add-linting.spec.ts @@ -1,6 +1,6 @@ import { readProjectConfiguration, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { addLinting } from './add-linting'; import { addProject } from './add-project'; @@ -41,7 +41,7 @@ describe('Add Linting', () => { const project = readProjectConfiguration(tree, 'my-app-e2e'); expect(project.targets.lint).toBeDefined(); - expect(project.targets.lint.executor).toEqual('@nx/linter:eslint'); + expect(project.targets.lint.executor).toEqual('@nx/eslint:lint'); }); it('should not add lint target when "none" is passed', async () => { diff --git a/packages/detox/src/generators/application/lib/add-linting.ts b/packages/detox/src/generators/application/lib/add-linting.ts index 180ecc0d7f124b..2f4235741403c6 100644 --- a/packages/detox/src/generators/application/lib/add-linting.ts +++ b/packages/detox/src/generators/application/lib/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { addDependenciesToPackageJson, joinPathFragments, @@ -10,7 +10,7 @@ import { NormalizedSchema } from './normalize-options'; import { addExtendsToLintConfig, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; export async function addLinting(host: Tree, options: NormalizedSchema) { if (options.linter === Linter.None) { diff --git a/packages/detox/src/generators/application/lib/add-project.spec.ts b/packages/detox/src/generators/application/lib/add-project.spec.ts index 17032dfb560ed3..989e0c763aafdc 100644 --- a/packages/detox/src/generators/application/lib/add-project.spec.ts +++ b/packages/detox/src/generators/application/lib/add-project.spec.ts @@ -4,7 +4,7 @@ import { Tree, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { addProject } from './add-project'; describe('Add Project', () => { diff --git a/packages/detox/src/generators/application/lib/create-files.spec.ts b/packages/detox/src/generators/application/lib/create-files.spec.ts index d6b13ae193fd23..603a02f6f4fdc3 100644 --- a/packages/detox/src/generators/application/lib/create-files.spec.ts +++ b/packages/detox/src/generators/application/lib/create-files.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { createFiles } from './create-files'; describe('Create Files', () => { diff --git a/packages/detox/src/generators/application/lib/normalize-options.spec.ts b/packages/detox/src/generators/application/lib/normalize-options.spec.ts index 55a95f0c15adc3..50f8d36fa57f20 100644 --- a/packages/detox/src/generators/application/lib/normalize-options.spec.ts +++ b/packages/detox/src/generators/application/lib/normalize-options.spec.ts @@ -1,6 +1,6 @@ import { addProjectConfiguration, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/detox/src/generators/application/schema.d.ts b/packages/detox/src/generators/application/schema.d.ts index 2fa7b27118db47..81bddc9df49b67 100644 --- a/packages/detox/src/generators/application/schema.d.ts +++ b/packages/detox/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { appProject: string; // name of the project app to be tested (directory + app name in kebab class) diff --git a/packages/linter/.eslintrc.json b/packages/eslint/.eslintrc.json similarity index 100% rename from packages/linter/.eslintrc.json rename to packages/eslint/.eslintrc.json diff --git a/packages/linter/README.md b/packages/eslint/README.md similarity index 100% rename from packages/linter/README.md rename to packages/eslint/README.md diff --git a/packages/linter/docs/eslint-examples.md b/packages/eslint/docs/eslint-examples.md similarity index 92% rename from packages/linter/docs/eslint-examples.md rename to packages/eslint/docs/eslint-examples.md index 95136037a12054..03f7651a5e98be 100644 --- a/packages/linter/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/linter/docs/workspace-rule-examples.md b/packages/eslint/docs/workspace-rule-examples.md similarity index 100% rename from packages/linter/docs/workspace-rule-examples.md rename to packages/eslint/docs/workspace-rule-examples.md diff --git a/packages/eslint/executors.json b/packages/eslint/executors.json new file mode 100644 index 00000000000000..5bcd01cc5585d5 --- /dev/null +++ b/packages/eslint/executors.json @@ -0,0 +1,17 @@ +{ + "builders": { + "lint": { + "implementation": "./src/executors/lint/compat", + "schema": "./src/executors/lint/schema.json", + "description": "Run ESLint on a project." + } + }, + "executors": { + "lint": { + "implementation": "./src/executors/lint/lint.impl", + "schema": "./src/executors/lint/schema.json", + "hasher": "./src/executors/lint/hasher", + "description": "Run ESLint on a project." + } + } +} diff --git a/packages/linter/generators.json b/packages/eslint/generators.json similarity index 98% rename from packages/linter/generators.json rename to packages/eslint/generators.json index 7cfdf3c9f80622..d078780754d4e8 100644 --- a/packages/linter/generators.json +++ b/packages/eslint/generators.json @@ -1,5 +1,5 @@ { - "name": "nx/linter", + "name": "nx/eslint", "version": "0.1", "schematics": { "workspace-rules-project": { diff --git a/packages/linter/index.ts b/packages/eslint/index.ts similarity index 86% rename from packages/linter/index.ts rename to packages/eslint/index.ts index 46439d120412c6..6d96077a6428fc 100644 --- a/packages/linter/index.ts +++ b/packages/eslint/index.ts @@ -4,5 +4,5 @@ export { Linter } from './src/generators/utils/linter'; // @nx/angular needs it for the Angular CLI workspace migration to Nx to // infer whether a config is using type aware rules and set the -// `hasTypeAwareRules` option of the `@nx/linter:eslint` executor. +// `hasTypeAwareRules` option of the `@nx/eslint:lint` executor. export { hasRulesRequiringTypeChecking } from './src/utils/rules-requiring-type-checking'; diff --git a/packages/linter/jest.config.ts b/packages/eslint/jest.config.ts similarity index 91% rename from packages/linter/jest.config.ts rename to packages/eslint/jest.config.ts index 283d0b3928810b..d666bd199e1362 100644 --- a/packages/linter/jest.config.ts +++ b/packages/eslint/jest.config.ts @@ -5,7 +5,7 @@ export default { }, moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], globals: {}, - displayName: 'linter', + displayName: 'eslint', testEnvironment: 'node', preset: '../../jest.preset.js', }; diff --git a/packages/linter/migrations.json b/packages/eslint/migrations.json similarity index 100% rename from packages/linter/migrations.json rename to packages/eslint/migrations.json diff --git a/packages/linter/migrations.spec.ts b/packages/eslint/migrations.spec.ts similarity index 100% rename from packages/linter/migrations.spec.ts rename to packages/eslint/migrations.spec.ts diff --git a/packages/linter/package.json b/packages/eslint/package.json similarity index 92% rename from packages/linter/package.json rename to packages/eslint/package.json index 1229ee6600ec24..e80e355812e0c1 100644 --- a/packages/linter/package.json +++ b/packages/eslint/package.json @@ -1,8 +1,8 @@ { - "name": "@nx/linter", + "name": "@nx/eslint", "version": "0.0.1", "private": false, - "description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", "repository": { "type": "git", "url": "https://github.com/nrwl/nx.git", diff --git a/packages/linter/project.json b/packages/eslint/project.json similarity index 70% rename from packages/linter/project.json rename to packages/eslint/project.json index 283dda3fbf7660..6bbf59059961aa 100644 --- a/packages/linter/project.json +++ b/packages/eslint/project.json @@ -1,7 +1,7 @@ { - "name": "linter", + "name": "eslint", "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "packages/linter", + "sourceRoot": "packages/eslint", "projectType": "library", "targets": { "test": {}, @@ -10,29 +10,29 @@ "options": { "assets": [ { - "input": "packages/linter", + "input": "packages/eslint", "glob": "**/files/**", "output": "/" }, { - "input": "packages/linter", + "input": "packages/eslint", "glob": "**/files/**/.gitkeep", "output": "/" }, { - "input": "packages/linter", + "input": "packages/eslint", "glob": "**/*.json", "ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"], "output": "/" }, { - "input": "packages/linter", + "input": "packages/eslint", "glob": "**/*.js", "ignore": ["**/jest.config.js"], "output": "/" }, { - "input": "packages/linter", + "input": "packages/eslint", "glob": "**/*.d.ts", "output": "/" }, @@ -46,13 +46,13 @@ }, "build": { "executor": "nx:run-commands", - "outputs": ["{workspaceRoot}/build/packages/linter"], + "outputs": ["{workspaceRoot}/build/packages/eslint"], "options": { - "command": "node ./scripts/copy-readme.js linter" + "command": "node ./scripts/copy-readme.js eslint" } }, "add-extra-dependencies": { - "command": "node ./scripts/add-dependency-to-build.js linter @nrwl/linter" + "command": "node ./scripts/add-dependency-to-build.js eslint @nrwl/eslint" }, "lint": {} }, diff --git a/packages/linter/src/executors/eslint/compat.ts b/packages/eslint/src/executors/lint/compat.ts similarity index 100% rename from packages/linter/src/executors/eslint/compat.ts rename to packages/eslint/src/executors/lint/compat.ts diff --git a/packages/linter/src/executors/eslint/hasher.ts b/packages/eslint/src/executors/lint/hasher.ts similarity index 100% rename from packages/linter/src/executors/eslint/hasher.ts rename to packages/eslint/src/executors/lint/hasher.ts diff --git a/packages/linter/src/executors/eslint/lint.impl.spec.ts b/packages/eslint/src/executors/lint/lint.impl.spec.ts similarity index 100% rename from packages/linter/src/executors/eslint/lint.impl.spec.ts rename to packages/eslint/src/executors/lint/lint.impl.spec.ts diff --git a/packages/linter/src/executors/eslint/lint.impl.ts b/packages/eslint/src/executors/lint/lint.impl.ts similarity index 100% rename from packages/linter/src/executors/eslint/lint.impl.ts rename to packages/eslint/src/executors/lint/lint.impl.ts diff --git a/packages/linter/src/executors/eslint/schema.d.ts b/packages/eslint/src/executors/lint/schema.d.ts similarity index 100% rename from packages/linter/src/executors/eslint/schema.d.ts rename to packages/eslint/src/executors/lint/schema.d.ts diff --git a/packages/linter/src/executors/eslint/schema.json b/packages/eslint/src/executors/lint/schema.json similarity index 100% rename from packages/linter/src/executors/eslint/schema.json rename to packages/eslint/src/executors/lint/schema.json diff --git a/packages/linter/src/executors/eslint/utility/eslint-utils.spec.ts b/packages/eslint/src/executors/lint/utility/eslint-utils.spec.ts similarity index 100% rename from packages/linter/src/executors/eslint/utility/eslint-utils.spec.ts rename to packages/eslint/src/executors/lint/utility/eslint-utils.spec.ts diff --git a/packages/linter/src/executors/eslint/utility/eslint-utils.ts b/packages/eslint/src/executors/lint/utility/eslint-utils.ts similarity index 100% rename from packages/linter/src/executors/eslint/utility/eslint-utils.ts rename to packages/eslint/src/executors/lint/utility/eslint-utils.ts diff --git a/packages/linter/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap b/packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap rename to packages/eslint/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap diff --git a/packages/linter/src/generators/convert-to-flat-config/converters/json-converter.spec.ts b/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/converters/json-converter.spec.ts rename to packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.spec.ts diff --git a/packages/linter/src/generators/convert-to-flat-config/converters/json-converter.ts b/packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.ts similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/converters/json-converter.ts rename to packages/eslint/src/generators/convert-to-flat-config/converters/json-converter.ts diff --git a/packages/linter/src/generators/convert-to-flat-config/generator.spec.ts b/packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/generator.spec.ts rename to packages/eslint/src/generators/convert-to-flat-config/generator.spec.ts diff --git a/packages/linter/src/generators/convert-to-flat-config/generator.ts b/packages/eslint/src/generators/convert-to-flat-config/generator.ts similarity index 89% rename from packages/linter/src/generators/convert-to-flat-config/generator.ts rename to packages/eslint/src/generators/convert-to-flat-config/generator.ts index 8047e18cf76eed..09d24233d2fe95 100644 --- a/packages/linter/src/generators/convert-to-flat-config/generator.ts +++ b/packages/eslint/src/generators/convert-to-flat-config/generator.ts @@ -65,7 +65,7 @@ function convertProjectToFlatConfig( if (tree.exists(`${projectConfig.root}/.eslintrc.json`)) { if (projectConfig.targets) { const eslintTargets = Object.keys(projectConfig.targets || {}).filter( - (t) => projectConfig.targets[t].executor === '@nx/linter:eslint' + (t) => projectConfig.targets[t].executor === '@nx/eslint:lint' ); for (const target of eslintTargets) { // remove any obsolete `eslintConfig` options pointing to the old config file @@ -76,8 +76,8 @@ function convertProjectToFlatConfig( } const nxHasLintTargets = Object.keys(nxJson.targetDefaults || {}).some( (t) => - (t === '@nx/linter:eslint' || - nxJson.targetDefaults[t].executor === '@nx/linter:eslint') && + (t === '@nx/eslint:lint' || + nxJson.targetDefaults[t].executor === '@nx/eslint:lint') && projectConfig.targets?.[t] ); if (nxHasLintTargets || eslintTargets.length > 0) { @@ -102,12 +102,10 @@ function updateNxJsonConfig(tree: Tree) { inputSet.add('{workspaceRoot}/eslint.config.js'); json.targetDefaults.lint.inputs = Array.from(inputSet); } - if (json.targetDefaults?.['@nx/linter:eslint']?.inputs) { - const inputSet = new Set( - json.targetDefaults['@nx/linter:eslint'].inputs - ); + if (json.targetDefaults?.['@nx/eslint:lint']?.inputs) { + const inputSet = new Set(json.targetDefaults['@nx/eslint:lint'].inputs); inputSet.add('{workspaceRoot}/eslint.config.js'); - json.targetDefaults['@nx/linter:eslint'].inputs = Array.from(inputSet); + json.targetDefaults['@nx/eslint:lint'].inputs = Array.from(inputSet); } if (json.namedInputs?.production) { const inputSet = new Set(json.namedInputs.production); diff --git a/packages/linter/src/generators/convert-to-flat-config/schema.d.ts b/packages/eslint/src/generators/convert-to-flat-config/schema.d.ts similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/schema.d.ts rename to packages/eslint/src/generators/convert-to-flat-config/schema.d.ts diff --git a/packages/linter/src/generators/convert-to-flat-config/schema.json b/packages/eslint/src/generators/convert-to-flat-config/schema.json similarity index 100% rename from packages/linter/src/generators/convert-to-flat-config/schema.json rename to packages/eslint/src/generators/convert-to-flat-config/schema.json diff --git a/packages/linter/src/generators/init/__snapshots__/init.spec.ts.snap b/packages/eslint/src/generators/init/__snapshots__/init.spec.ts.snap similarity index 100% rename from packages/linter/src/generators/init/__snapshots__/init.spec.ts.snap rename to packages/eslint/src/generators/init/__snapshots__/init.spec.ts.snap diff --git a/packages/linter/src/generators/init/global-eslint-config.ts b/packages/eslint/src/generators/init/global-eslint-config.ts similarity index 100% rename from packages/linter/src/generators/init/global-eslint-config.ts rename to packages/eslint/src/generators/init/global-eslint-config.ts diff --git a/packages/linter/src/generators/init/init-migration.ts b/packages/eslint/src/generators/init/init-migration.ts similarity index 98% rename from packages/linter/src/generators/init/init-migration.ts rename to packages/eslint/src/generators/init/init-migration.ts index 1e41d3fa5883b4..918d54023ed7d3 100644 --- a/packages/linter/src/generators/init/init-migration.ts +++ b/packages/eslint/src/generators/init/init-migration.ts @@ -69,6 +69,7 @@ export function findLintTarget( ): TargetConfiguration { return Object.values(project.targets ?? {}).find( (target) => + target.executor === '@nx/eslint:lint' || target.executor === '@nx/linter:eslint' || target.executor === '@nrwl/linter:eslint' ); diff --git a/packages/linter/src/generators/init/init.spec.ts b/packages/eslint/src/generators/init/init.spec.ts similarity index 97% rename from packages/linter/src/generators/init/init.spec.ts rename to packages/eslint/src/generators/init/init.spec.ts index 0b0c2aef641bf1..7529e63eb5ddc2 100644 --- a/packages/linter/src/generators/init/init.spec.ts +++ b/packages/eslint/src/generators/init/init.spec.ts @@ -3,7 +3,7 @@ import { readJson, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintInitGenerator } from './init'; -describe('@nx/linter:init', () => { +describe('@nx/eslint:init', () => { let tree: Tree; beforeEach(() => { diff --git a/packages/linter/src/generators/init/init.ts b/packages/eslint/src/generators/init/init.ts similarity index 96% rename from packages/linter/src/generators/init/init.ts rename to packages/eslint/src/generators/init/init.ts index 03e889b71bd8ef..521b2e3da77b94 100644 --- a/packages/linter/src/generators/init/init.ts +++ b/packages/eslint/src/generators/init/init.ts @@ -58,7 +58,7 @@ function initEsLint(tree: Tree, options: LinterInitOptions): GeneratorCallback { } if (!options.skipPackageJson) { - removeDependenciesFromPackageJson(tree, ['@nx/linter'], []); + removeDependenciesFromPackageJson(tree, ['@nx/eslint'], []); } writeJson( @@ -85,7 +85,7 @@ function initEsLint(tree: Tree, options: LinterInitOptions): GeneratorCallback { tree, {}, { - '@nx/linter': nxVersion, + '@nx/eslint': nxVersion, '@nx/eslint-plugin': nxVersion, '@typescript-eslint/parser': typescriptESLintVersion, '@typescript-eslint/eslint-plugin': typescriptESLintVersion, diff --git a/packages/linter/src/generators/lint-project/lint-project.spec.ts b/packages/eslint/src/generators/lint-project/lint-project.spec.ts similarity index 97% rename from packages/linter/src/generators/lint-project/lint-project.spec.ts rename to packages/eslint/src/generators/lint-project/lint-project.spec.ts index d384900cacbd5e..e2184561466db3 100644 --- a/packages/linter/src/generators/lint-project/lint-project.spec.ts +++ b/packages/eslint/src/generators/lint-project/lint-project.spec.ts @@ -10,7 +10,7 @@ import { Linter } from '../utils/linter'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintProjectGenerator } from './lint-project'; -describe('@nx/linter:lint-project', () => { +describe('@nx/eslint:lint-project', () => { let tree: Tree; const defaultOptions = { @@ -74,7 +74,7 @@ describe('@nx/linter:lint-project', () => { const projectConfig = readProjectConfiguration(tree, 'test-lib'); expect(projectConfig.targets.lint).toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/test-lib/**/*.ts", @@ -129,7 +129,7 @@ describe('@nx/linter:lint-project', () => { const projectConfig = readProjectConfiguration(tree, 'buildable-lib'); expect(projectConfig.targets.lint).toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "libs/buildable-lib/**/*.ts", diff --git a/packages/linter/src/generators/lint-project/lint-project.ts b/packages/eslint/src/generators/lint-project/lint-project.ts similarity index 99% rename from packages/linter/src/generators/lint-project/lint-project.ts rename to packages/eslint/src/generators/lint-project/lint-project.ts index c46646159f84e9..0f141d0d69082b 100644 --- a/packages/linter/src/generators/lint-project/lint-project.ts +++ b/packages/eslint/src/generators/lint-project/lint-project.ts @@ -74,7 +74,7 @@ export async function lintProjectGenerator( } projectConfig.targets['lint'] = { - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: lintFilePatterns, diff --git a/packages/linter/src/generators/utils/eslint-file.spec.ts b/packages/eslint/src/generators/utils/eslint-file.spec.ts similarity index 97% rename from packages/linter/src/generators/utils/eslint-file.spec.ts rename to packages/eslint/src/generators/utils/eslint-file.spec.ts index 0556f3c56a2574..12c4eb71602150 100644 --- a/packages/linter/src/generators/utils/eslint-file.spec.ts +++ b/packages/eslint/src/generators/utils/eslint-file.spec.ts @@ -8,7 +8,7 @@ import { import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -describe('@nx/linter:eslint-file', () => { +describe('@nx/eslint:lint-file', () => { let tree: Tree; beforeEach(() => { diff --git a/packages/linter/src/generators/utils/eslint-file.ts b/packages/eslint/src/generators/utils/eslint-file.ts similarity index 100% rename from packages/linter/src/generators/utils/eslint-file.ts rename to packages/eslint/src/generators/utils/eslint-file.ts diff --git a/packages/linter/src/generators/utils/eslint-targets.ts b/packages/eslint/src/generators/utils/eslint-targets.ts similarity index 81% rename from packages/linter/src/generators/utils/eslint-targets.ts rename to packages/eslint/src/generators/utils/eslint-targets.ts index c7a9fa91edb375..bfe9ba4aa36a5f 100644 --- a/packages/linter/src/generators/utils/eslint-targets.ts +++ b/packages/eslint/src/generators/utils/eslint-targets.ts @@ -3,6 +3,9 @@ import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-optio export function getEslintTargets(tree: Tree) { const eslintTargetNames = new Set(); + forEachExecutorOptions(tree, '@nx/eslint:lint', (_, __, target) => { + eslintTargetNames.add(target); + }); forEachExecutorOptions(tree, '@nx/linter:eslint', (_, __, target) => { eslintTargetNames.add(target); }); diff --git a/packages/linter/src/generators/utils/flat-config/ast-utils.spec.ts b/packages/eslint/src/generators/utils/flat-config/ast-utils.spec.ts similarity index 100% rename from packages/linter/src/generators/utils/flat-config/ast-utils.spec.ts rename to packages/eslint/src/generators/utils/flat-config/ast-utils.spec.ts diff --git a/packages/linter/src/generators/utils/flat-config/ast-utils.ts b/packages/eslint/src/generators/utils/flat-config/ast-utils.ts similarity index 100% rename from packages/linter/src/generators/utils/flat-config/ast-utils.ts rename to packages/eslint/src/generators/utils/flat-config/ast-utils.ts diff --git a/packages/linter/src/generators/utils/flat-config/path-utils.ts b/packages/eslint/src/generators/utils/flat-config/path-utils.ts similarity index 100% rename from packages/linter/src/generators/utils/flat-config/path-utils.ts rename to packages/eslint/src/generators/utils/flat-config/path-utils.ts diff --git a/packages/linter/src/generators/utils/linter.ts b/packages/eslint/src/generators/utils/linter.ts similarity index 100% rename from packages/linter/src/generators/utils/linter.ts rename to packages/eslint/src/generators/utils/linter.ts diff --git a/packages/linter/src/generators/workspace-rule/__snapshots__/workspace-rule.spec.ts.snap b/packages/eslint/src/generators/workspace-rule/__snapshots__/workspace-rule.spec.ts.snap similarity index 100% rename from packages/linter/src/generators/workspace-rule/__snapshots__/workspace-rule.spec.ts.snap rename to packages/eslint/src/generators/workspace-rule/__snapshots__/workspace-rule.spec.ts.snap diff --git a/packages/linter/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ b/packages/eslint/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ similarity index 100% rename from packages/linter/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ rename to packages/eslint/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ diff --git a/packages/linter/src/generators/workspace-rule/files/__name__.ts__tmpl__ b/packages/eslint/src/generators/workspace-rule/files/__name__.ts__tmpl__ similarity index 100% rename from packages/linter/src/generators/workspace-rule/files/__name__.ts__tmpl__ rename to packages/eslint/src/generators/workspace-rule/files/__name__.ts__tmpl__ diff --git a/packages/linter/src/generators/workspace-rule/schema.json b/packages/eslint/src/generators/workspace-rule/schema.json similarity index 100% rename from packages/linter/src/generators/workspace-rule/schema.json rename to packages/eslint/src/generators/workspace-rule/schema.json diff --git a/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts b/packages/eslint/src/generators/workspace-rule/workspace-rule.spec.ts similarity index 99% rename from packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts rename to packages/eslint/src/generators/workspace-rule/workspace-rule.spec.ts index ee4875fe82212b..92ded1d9d65d96 100644 --- a/packages/linter/src/generators/workspace-rule/workspace-rule.spec.ts +++ b/packages/eslint/src/generators/workspace-rule/workspace-rule.spec.ts @@ -2,7 +2,7 @@ import { NxJsonConfiguration, readJson, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { lintWorkspaceRuleGenerator } from './workspace-rule'; -describe('@nx/linter:workspace-rule', () => { +describe('@nx/eslint:workspace-rule', () => { let tree: Tree; beforeEach(async () => { diff --git a/packages/linter/src/generators/workspace-rule/workspace-rule.ts b/packages/eslint/src/generators/workspace-rule/workspace-rule.ts similarity index 100% rename from packages/linter/src/generators/workspace-rule/workspace-rule.ts rename to packages/eslint/src/generators/workspace-rule/workspace-rule.ts diff --git a/packages/linter/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap b/packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap rename to packages/eslint/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap diff --git a/packages/linter/src/generators/workspace-rules-project/files/index.ts__tmpl__ b/packages/eslint/src/generators/workspace-rules-project/files/index.ts__tmpl__ similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/files/index.ts__tmpl__ rename to packages/eslint/src/generators/workspace-rules-project/files/index.ts__tmpl__ diff --git a/packages/linter/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ b/packages/eslint/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ rename to packages/eslint/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ diff --git a/packages/linter/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ b/packages/eslint/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ rename to packages/eslint/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ diff --git a/packages/linter/src/generators/workspace-rules-project/schema.json b/packages/eslint/src/generators/workspace-rules-project/schema.json similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/schema.json rename to packages/eslint/src/generators/workspace-rules-project/schema.json diff --git a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts b/packages/eslint/src/generators/workspace-rules-project/workspace-rules-project.spec.ts similarity index 98% rename from packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts rename to packages/eslint/src/generators/workspace-rules-project/workspace-rules-project.spec.ts index 5525eacc6bd389..9368d0e3289107 100644 --- a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.spec.ts +++ b/packages/eslint/src/generators/workspace-rules-project/workspace-rules-project.spec.ts @@ -12,7 +12,7 @@ import { WORKSPACE_RULES_PROJECT_NAME, } from './workspace-rules-project'; -describe('@nx/linter:workspace-rules-project', () => { +describe('@nx/eslint:workspace-rules-project', () => { let tree: Tree; beforeEach(() => { diff --git a/packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts b/packages/eslint/src/generators/workspace-rules-project/workspace-rules-project.ts similarity index 100% rename from packages/linter/src/generators/workspace-rules-project/workspace-rules-project.ts rename to packages/eslint/src/generators/workspace-rules-project/workspace-rules-project.ts diff --git a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts b/packages/eslint/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts rename to packages/eslint/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.spec.ts diff --git a/packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts b/packages/eslint/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts similarity index 100% rename from packages/linter/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts rename to packages/eslint/src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules.ts diff --git a/packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts b/packages/eslint/src/migrations/update-12-9-0/add-outputs.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-12-9-0/add-outputs.spec.ts rename to packages/eslint/src/migrations/update-12-9-0/add-outputs.spec.ts diff --git a/packages/linter/src/migrations/update-12-9-0/add-outputs.ts b/packages/eslint/src/migrations/update-12-9-0/add-outputs.ts similarity index 100% rename from packages/linter/src/migrations/update-12-9-0/add-outputs.ts rename to packages/eslint/src/migrations/update-12-9-0/add-outputs.ts diff --git a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts b/packages/eslint/src/migrations/update-13-3-0/eslint-8-updates.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-13-3-0/eslint-8-updates.spec.ts rename to packages/eslint/src/migrations/update-13-3-0/eslint-8-updates.spec.ts diff --git a/packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts b/packages/eslint/src/migrations/update-13-3-0/eslint-8-updates.ts similarity index 100% rename from packages/linter/src/migrations/update-13-3-0/eslint-8-updates.ts rename to packages/eslint/src/migrations/update-13-3-0/eslint-8-updates.ts diff --git a/packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts b/packages/eslint/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts similarity index 100% rename from packages/linter/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts rename to packages/eslint/src/migrations/update-14-1-9/add-swc-deps-if-needed.ts diff --git a/packages/linter/src/migrations/update-14-4-4/__snapshots__/experimental-to-utils-deps.spec.ts.snap b/packages/eslint/src/migrations/update-14-4-4/__snapshots__/experimental-to-utils-deps.spec.ts.snap similarity index 100% rename from packages/linter/src/migrations/update-14-4-4/__snapshots__/experimental-to-utils-deps.spec.ts.snap rename to packages/eslint/src/migrations/update-14-4-4/__snapshots__/experimental-to-utils-deps.spec.ts.snap diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts b/packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts rename to packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-deps.spec.ts diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts b/packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-deps.ts similarity index 100% rename from packages/linter/src/migrations/update-14-4-4/experimental-to-utils-deps.ts rename to packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-deps.ts diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts b/packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts rename to packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-rules.spec.ts diff --git a/packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts b/packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-rules.ts similarity index 100% rename from packages/linter/src/migrations/update-14-4-4/experimental-to-utils-rules.ts rename to packages/eslint/src/migrations/update-14-4-4/experimental-to-utils-rules.ts diff --git a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts b/packages/eslint/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts rename to packages/eslint/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts diff --git a/packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts b/packages/eslint/src/migrations/update-15-0-0/add-eslint-inputs.ts similarity index 100% rename from packages/linter/src/migrations/update-15-0-0/add-eslint-inputs.ts rename to packages/eslint/src/migrations/update-15-0-0/add-eslint-inputs.ts diff --git a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts b/packages/eslint/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts rename to packages/eslint/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts diff --git a/packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts b/packages/eslint/src/migrations/update-15-7-1/add-eslint-ignore.ts similarity index 100% rename from packages/linter/src/migrations/update-15-7-1/add-eslint-ignore.ts rename to packages/eslint/src/migrations/update-15-7-1/add-eslint-ignore.ts diff --git a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts b/packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts similarity index 91% rename from packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts rename to packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts index 1c66d74de0c4e8..d1291161d6f608 100644 --- a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts +++ b/packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts @@ -29,8 +29,8 @@ describe('update-16-0-0-add-nx-packages', () => { const packageJson = readJson(tree, 'package.json'); const newDependencyVersion = - packageJson.devDependencies['@nx/linter'] ?? - packageJson.dependencies['@nx/linter']; + packageJson.devDependencies['@nx/eslint'] ?? + packageJson.dependencies['@nx/eslint']; expect(newDependencyVersion).toBeDefined(); }); diff --git a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts b/packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts similarity index 95% rename from packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts rename to packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts index 318e1816ffba8c..7ffac6b10a0d3c 100644 --- a/packages/linter/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts +++ b/packages/eslint/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts @@ -2,7 +2,7 @@ import { Tree, formatFiles } from '@nx/devkit'; import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; export default async function replacePackage(tree: Tree): Promise { - await replaceNrwlPackageWithNxPackage(tree, '@nrwl/linter', '@nx/linter'); + await replaceNrwlPackageWithNxPackage(tree, '@nrwl/linter', '@nx/eslint'); await formatFiles(tree); } diff --git a/packages/linter/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.spec.ts b/packages/eslint/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.spec.ts similarity index 100% rename from packages/linter/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.spec.ts rename to packages/eslint/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.spec.ts diff --git a/packages/linter/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.ts b/packages/eslint/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.ts similarity index 100% rename from packages/linter/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.ts rename to packages/eslint/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.ts diff --git a/packages/linter/src/utils/flat-config.ts b/packages/eslint/src/utils/flat-config.ts similarity index 100% rename from packages/linter/src/utils/flat-config.ts rename to packages/eslint/src/utils/flat-config.ts diff --git a/packages/linter/src/utils/rules-requiring-type-checking.ts b/packages/eslint/src/utils/rules-requiring-type-checking.ts similarity index 100% rename from packages/linter/src/utils/rules-requiring-type-checking.ts rename to packages/eslint/src/utils/rules-requiring-type-checking.ts diff --git a/packages/linter/src/utils/versions.ts b/packages/eslint/src/utils/versions.ts similarity index 100% rename from packages/linter/src/utils/versions.ts rename to packages/eslint/src/utils/versions.ts diff --git a/packages/linter/src/utils/workspace-lint-rules.ts b/packages/eslint/src/utils/workspace-lint-rules.ts similarity index 100% rename from packages/linter/src/utils/workspace-lint-rules.ts rename to packages/eslint/src/utils/workspace-lint-rules.ts diff --git a/packages/linter/tsconfig.json b/packages/eslint/tsconfig.json similarity index 100% rename from packages/linter/tsconfig.json rename to packages/eslint/tsconfig.json diff --git a/packages/linter/tsconfig.lib.json b/packages/eslint/tsconfig.lib.json similarity index 100% rename from packages/linter/tsconfig.lib.json rename to packages/eslint/tsconfig.lib.json diff --git a/packages/linter/tsconfig.spec.json b/packages/eslint/tsconfig.spec.json similarity index 100% rename from packages/linter/tsconfig.spec.json rename to packages/eslint/tsconfig.spec.json diff --git a/packages/expo/package.json b/packages/expo/package.json index d0fe2c5b6b9d39..97168133889813 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -40,7 +40,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/react": "file:../react", "@nx/webpack": "file:../webpack" }, diff --git a/packages/expo/src/generators/application/application.spec.ts b/packages/expo/src/generators/application/application.spec.ts index b19b193e5cd3e0..02e79876e6a4d8 100644 --- a/packages/expo/src/generators/application/application.spec.ts +++ b/packages/expo/src/generators/application/application.spec.ts @@ -5,7 +5,7 @@ import { Tree, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { expoApplicationGenerator } from './application'; describe('app', () => { diff --git a/packages/expo/src/generators/application/lib/add-detox.ts b/packages/expo/src/generators/application/lib/add-detox.ts index 93366950af1855..ffe8be1c9de74a 100644 --- a/packages/expo/src/generators/application/lib/add-detox.ts +++ b/packages/expo/src/generators/application/lib/add-detox.ts @@ -1,7 +1,7 @@ import { detoxApplicationGenerator } from '@nx/detox'; import { Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export async function addDetox(host: Tree, options: NormalizedSchema) { if (options?.e2eTestRunner !== 'detox') { diff --git a/packages/expo/src/generators/application/lib/nomalize-options.spec.ts b/packages/expo/src/generators/application/lib/nomalize-options.spec.ts index 393b162a7c80d8..780322fe777b23 100644 --- a/packages/expo/src/generators/application/lib/nomalize-options.spec.ts +++ b/packages/expo/src/generators/application/lib/nomalize-options.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/expo/src/generators/application/schema.d.ts b/packages/expo/src/generators/application/schema.d.ts index f1529d67f17eb5..549d7683ee4548 100644 --- a/packages/expo/src/generators/application/schema.d.ts +++ b/packages/expo/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/expo/src/generators/component/component.spec.ts b/packages/expo/src/generators/component/component.spec.ts index 17ae43f94ff73d..8c291a5e0d9202 100644 --- a/packages/expo/src/generators/component/component.spec.ts +++ b/packages/expo/src/generators/component/component.spec.ts @@ -1,6 +1,6 @@ import { logger, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import expoApplicationGenerator from '../application/application'; import expoLibraryGenerator from '../library/library'; import { expoComponentGenerator } from './component'; diff --git a/packages/expo/src/generators/library/library.spec.ts b/packages/expo/src/generators/library/library.spec.ts index 9742eb061c51ca..0664bc3749d0de 100644 --- a/packages/expo/src/generators/library/library.spec.ts +++ b/packages/expo/src/generators/library/library.spec.ts @@ -6,7 +6,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { expoLibraryGenerator } from './library'; import { Schema } from './schema'; @@ -40,7 +40,7 @@ describe('lib', () => { expect(projectConfiguration.root).toEqual('my-lib'); expect(projectConfiguration.targets.build).toBeUndefined(); expect(projectConfiguration.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx}'], @@ -149,7 +149,7 @@ describe('lib', () => { 'my-dir-my-lib' ); expect(projectConfiguration.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/my-lib/**/*.{ts,tsx,js,jsx}'], @@ -199,7 +199,7 @@ describe('lib', () => { const projectConfiguration = readProjectConfiguration(appTree, 'my-lib'); expect(projectConfiguration.targets.test).toBeUndefined(); expect(projectConfiguration.targets.lint).toMatchObject({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx}'], }, diff --git a/packages/expo/src/generators/library/schema.d.ts b/packages/expo/src/generators/library/schema.d.ts index 6407f8b80fd928..498a938462ecbe 100644 --- a/packages/expo/src/generators/library/schema.d.ts +++ b/packages/expo/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; /** * Same as the @nx/react library schema, except it removes keys: style, component, routing, appProject diff --git a/packages/expo/src/utils/add-linting.spec.ts b/packages/expo/src/utils/add-linting.spec.ts index 5d5d559b62ec22..7ca1407e855794 100644 --- a/packages/expo/src/utils/add-linting.spec.ts +++ b/packages/expo/src/utils/add-linting.spec.ts @@ -1,6 +1,6 @@ import { readProjectConfiguration, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { libraryGenerator } from '@nx/js'; import { addLinting } from './add-linting'; @@ -26,7 +26,7 @@ describe('Add Linting', () => { const project = readProjectConfiguration(tree, 'my-lib'); expect(project.targets.lint).toBeDefined(); - expect(project.targets.lint.executor).toEqual('@nx/linter:eslint'); + expect(project.targets.lint.executor).toEqual('@nx/eslint:lint'); }); it('should not add lint target when "none" is passed', async () => { diff --git a/packages/expo/src/utils/add-linting.ts b/packages/expo/src/utils/add-linting.ts index 884f822776eb90..70ee6f3e2e0782 100644 --- a/packages/expo/src/utils/add-linting.ts +++ b/packages/expo/src/utils/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { addDependenciesToPackageJson, GeneratorCallback, @@ -10,7 +10,7 @@ import { addExtendsToLintConfig, addIgnoresToLintConfig, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; interface NormalizedSchema { linter?: Linter; diff --git a/packages/express/.eslintrc.json b/packages/express/.eslintrc.json index cd27ca0d46d2aa..9d46a2130fead9 100644 --- a/packages/express/.eslintrc.json +++ b/packages/express/.eslintrc.json @@ -45,7 +45,7 @@ "buildTargets": ["build-base"], "ignoredDependencies": [ "nx", - "@nx/linter", + "@nx/eslint", "typescript", "eslint", "express" diff --git a/packages/express/src/generators/application/schema.d.ts b/packages/express/src/generators/application/schema.d.ts index 11b978cda9b38e..676b4172061a3f 100644 --- a/packages/express/src/generators/application/schema.d.ts +++ b/packages/express/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { UnitTestRunner } from '../../utils/test-runners'; export interface Schema { diff --git a/packages/jest/src/generators/configuration/configuration.spec.ts b/packages/jest/src/generators/configuration/configuration.spec.ts index 7d5446b94dbad2..95f2f048498b58 100644 --- a/packages/jest/src/generators/configuration/configuration.spec.ts +++ b/packages/jest/src/generators/configuration/configuration.spec.ts @@ -31,7 +31,7 @@ describe('jestProject', () => { sourceRoot: 'libs/lib1/src', targets: { lint: { - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: {}, }, }, diff --git a/packages/js/src/generators/library/library.spec.ts b/packages/js/src/generators/library/library.spec.ts index 1f1c4092d3ca0a..4f2d76b06ad56c 100644 --- a/packages/js/src/generators/library/library.spec.ts +++ b/packages/js/src/generators/library/library.spec.ts @@ -482,7 +482,7 @@ describe('lib', () => { const packageJson = readJson(tree, 'package.json'); expect(packageJson.devDependencies['eslint']).toBeDefined(); - expect(packageJson.devDependencies['@nx/linter']).toBeDefined(); + expect(packageJson.devDependencies['@nx/eslint']).toBeDefined(); expect(packageJson.devDependencies['@nx/eslint-plugin']).toBeDefined(); }); @@ -494,7 +494,7 @@ describe('lib', () => { projectNameAndRootFormat: 'as-provided', }); expect(readProjectConfiguration(tree, 'my-lib').targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.ts', 'my-lib/package.json'], @@ -567,7 +567,7 @@ describe('lib', () => { }); expect(readProjectConfiguration(tree, 'my-lib').targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: [ diff --git a/packages/js/src/generators/library/library.ts b/packages/js/src/generators/library/library.ts index 47560e74b2015d..26df4da57a2fea 100644 --- a/packages/js/src/generators/library/library.ts +++ b/packages/js/src/generators/library/library.ts @@ -243,7 +243,7 @@ export async function addLint( tree: Tree, options: AddLintOptions ): Promise { - const { lintProjectGenerator } = ensurePackage('@nx/linter', nxVersion); + const { lintProjectGenerator } = ensurePackage('@nx/eslint', nxVersion); const projectConfiguration = readProjectConfiguration(tree, options.name); const task = lintProjectGenerator(tree, { project: options.name, @@ -265,7 +265,7 @@ export async function addLint( isEslintConfigSupported, updateOverrideInLintConfig, // nx-ignore-next-line - } = require('@nx/linter/src/generators/utils/eslint-file'); + } = require('@nx/eslint/src/generators/utils/eslint-file'); // if config is not supported, we don't need to do anything if (!isEslintConfigSupported(tree)) { @@ -576,7 +576,7 @@ async function normalizeOptions( options.bundler = 'none'; } - const { Linter } = ensurePackage('@nx/linter', nxVersion); + const { Linter } = ensurePackage('@nx/eslint', nxVersion); if (options.config === 'npm-scripts') { options.unitTestRunner = 'none'; options.linter = Linter.None; diff --git a/packages/js/src/utils/schema.d.ts b/packages/js/src/utils/schema.d.ts index d4f1fda1711e88..8b43e000758e11 100644 --- a/packages/js/src/utils/schema.d.ts +++ b/packages/js/src/utils/schema.d.ts @@ -1,6 +1,6 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; // nx-ignore-next-line -const { Linter } = require('@nx/linter'); // use require to import to avoid circular dependency +const { Linter } = require('@nx/eslint'); // use require to import to avoid circular dependency import type { AssetGlob, FileInputOutput } from './assets/assets'; import { TransformerEntry } from './typescript/types'; diff --git a/packages/linter/executors.json b/packages/linter/executors.json deleted file mode 100644 index 684f49d0da77ad..00000000000000 --- a/packages/linter/executors.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "builders": { - "eslint": { - "implementation": "./src/executors/eslint/compat", - "schema": "./src/executors/eslint/schema.json", - "description": "Run ESLint on a project." - } - }, - "executors": { - "eslint": { - "implementation": "./src/executors/eslint/lint.impl", - "schema": "./src/executors/eslint/schema.json", - "hasher": "./src/executors/eslint/hasher", - "description": "Run ESLint on a project." - } - } -} diff --git a/packages/nest/package.json b/packages/nest/package.json index fb9eeac789a24e..6fe3086c6038c6 100644 --- a/packages/nest/package.json +++ b/packages/nest/package.json @@ -34,7 +34,7 @@ "enquirer": "~2.3.6", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/node": "file:../node", "@phenomnomnominal/tsquery": "~5.0.1", "semver": "7.5.3", diff --git a/packages/nest/project.json b/packages/nest/project.json index 098c84d405179a..7a5ef344ef5916 100644 --- a/packages/nest/project.json +++ b/packages/nest/project.json @@ -56,5 +56,5 @@ }, "lint": {} }, - "implicitDependencies": ["node", "linter"] + "implicitDependencies": ["node", "eslint"] } diff --git a/packages/nest/src/generators/application/lib/normalize-options.ts b/packages/nest/src/generators/application/lib/normalize-options.ts index 6116615458f144..3fee9ce4ff6bd1 100644 --- a/packages/nest/src/generators/application/lib/normalize-options.ts +++ b/packages/nest/src/generators/application/lib/normalize-options.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import type { Schema as NodeApplicationGeneratorOptions } from '@nx/node/src/generators/application/schema'; import type { ApplicationGeneratorOptions, NormalizedOptions } from '../schema'; diff --git a/packages/nest/src/generators/application/schema.d.ts b/packages/nest/src/generators/application/schema.d.ts index a0a18e5b197048..65ce8b821c58fb 100644 --- a/packages/nest/src/generators/application/schema.d.ts +++ b/packages/nest/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface ApplicationGeneratorOptions { name: string; diff --git a/packages/nest/src/generators/library/lib/normalize-options.ts b/packages/nest/src/generators/library/lib/normalize-options.ts index b7d515a97dd516..6c38f4e08612a3 100644 --- a/packages/nest/src/generators/library/lib/normalize-options.ts +++ b/packages/nest/src/generators/library/lib/normalize-options.ts @@ -2,7 +2,7 @@ import { Tree } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; import { getNpmScope } from '@nx/js/src/utils/package-json/get-npm-scope'; import type { LibraryGeneratorSchema as JsLibraryGeneratorSchema } from '@nx/js/src/utils/schema'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import type { LibraryGeneratorOptions, NormalizedOptions } from '../schema'; export async function normalizeOptions( diff --git a/packages/nest/src/generators/library/library.spec.ts b/packages/nest/src/generators/library/library.spec.ts index 7b6a719bc9b085..7a78e0126fe645 100644 --- a/packages/nest/src/generators/library/library.spec.ts +++ b/packages/nest/src/generators/library/library.spec.ts @@ -23,7 +23,7 @@ describe('lib', () => { expect(config.root).toEqual(`my-lib`); expect(config.targets.build).toBeUndefined(); expect(config.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: [`my-lib/**/*.ts`], @@ -219,7 +219,7 @@ describe('lib', () => { const project = readProjectConfiguration(tree, `my-lib`); expect(project.root).toEqual(`my-dir/my-lib`); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: [`my-dir/my-lib/**/*.ts`], diff --git a/packages/nest/src/generators/library/schema.d.ts b/packages/nest/src/generators/library/schema.d.ts index 0588a2bc93817c..fdce605ff5c70a 100644 --- a/packages/nest/src/generators/library/schema.d.ts +++ b/packages/nest/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { UnitTestRunner } from '../utils'; export interface LibraryGeneratorOptions { diff --git a/packages/next/package.json b/packages/next/package.json index c050f395619029..89a6fdc4a815ef 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -46,7 +46,7 @@ "webpack-merge": "^5.8.0", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/react": "file:../react", "@nx/web": "file:../web", "@nx/workspace": "file:../workspace" diff --git a/packages/next/src/generators/application/lib/add-e2e.ts b/packages/next/src/generators/application/lib/add-e2e.ts index 0f3f1857f70d98..b68e011d4fc00c 100644 --- a/packages/next/src/generators/application/lib/add-e2e.ts +++ b/packages/next/src/generators/application/lib/add-e2e.ts @@ -5,7 +5,7 @@ import { joinPathFragments, Tree, } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { nxVersion } from '../../../utils/versions'; import { NormalizedSchema } from './normalize-options'; diff --git a/packages/next/src/generators/application/lib/add-linting.spec.ts b/packages/next/src/generators/application/lib/add-linting.spec.ts index 1ccc352791e22e..0f22cae88556b4 100644 --- a/packages/next/src/generators/application/lib/add-linting.spec.ts +++ b/packages/next/src/generators/application/lib/add-linting.spec.ts @@ -6,7 +6,7 @@ import { } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { addLinting } from './add-linting'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { NormalizedSchema } from './normalize-options'; describe('updateEslint', () => { @@ -128,7 +128,7 @@ describe('updateEslint', () => { baseDirectory: __dirname, recommendedConfig: js.configs.recommended, }); - + module.exports = [ { diff --git a/packages/next/src/generators/application/lib/add-linting.ts b/packages/next/src/generators/application/lib/add-linting.ts index 56f5d37a12d4a0..8da83fec637888 100644 --- a/packages/next/src/generators/application/lib/add-linting.ts +++ b/packages/next/src/generators/application/lib/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { addDependenciesToPackageJson, GeneratorCallback, @@ -14,7 +14,7 @@ import { addOverrideToLintConfig, isEslintConfigSupported, updateOverrideInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; export async function addLinting( host: Tree, diff --git a/packages/next/src/generators/application/lib/normalize-options.ts b/packages/next/src/generators/application/lib/normalize-options.ts index 93425139a958cb..69fed4587c878b 100644 --- a/packages/next/src/generators/application/lib/normalize-options.ts +++ b/packages/next/src/generators/application/lib/normalize-options.ts @@ -1,6 +1,6 @@ import { joinPathFragments, names, Tree } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { assertValidStyle } from '@nx/react/src/utils/assertion'; import { Schema } from '../schema'; diff --git a/packages/next/src/generators/application/schema.d.ts b/packages/next/src/generators/application/schema.d.ts index 08d8283ca904dd..a83160ae6065d3 100644 --- a/packages/next/src/generators/application/schema.d.ts +++ b/packages/next/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '@nx/react'; export interface Schema { diff --git a/packages/next/src/generators/component/component.spec.ts b/packages/next/src/generators/component/component.spec.ts index 4de4b892e4fce4..2be24248203bca 100644 --- a/packages/next/src/generators/component/component.spec.ts +++ b/packages/next/src/generators/component/component.spec.ts @@ -3,7 +3,7 @@ import { componentGenerator } from './component'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { Tree } from '@nx/devkit'; import { libraryGenerator } from '@nx/react'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('component', () => { let tree: Tree; diff --git a/packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts b/packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts index 547730e77dbca8..e737f0992c5895 100644 --- a/packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts +++ b/packages/next/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts @@ -4,7 +4,7 @@ import { cypressComponentConfiguration } from './cypress-component-configuration import { applicationGenerator } from '../application/application'; import { libraryGenerator } from '../library/library'; import { setupTailwindGenerator } from '@nx/react'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('cypress-component-configuration generator', () => { let tree: Tree; diff --git a/packages/next/src/generators/library/lib/normalize-options.spec.ts b/packages/next/src/generators/library/lib/normalize-options.spec.ts index b15bba233259b1..d5ce9890f9d11a 100644 --- a/packages/next/src/generators/library/lib/normalize-options.spec.ts +++ b/packages/next/src/generators/library/lib/normalize-options.spec.ts @@ -1,5 +1,5 @@ import type { Tree } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/next/src/generators/library/library.spec.ts b/packages/next/src/generators/library/library.spec.ts index 566d07333c05c5..495defe63012ab 100644 --- a/packages/next/src/generators/library/library.spec.ts +++ b/packages/next/src/generators/library/library.spec.ts @@ -1,7 +1,7 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { readJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import libraryGenerator from './library'; import { Schema } from './schema'; diff --git a/packages/next/src/generators/library/schema.d.ts b/packages/next/src/generators/library/schema.d.ts index ca0d398c6a5871..08c05a2e0629b5 100644 --- a/packages/next/src/generators/library/schema.d.ts +++ b/packages/next/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-directory-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '@nx/react'; export interface Schema { diff --git a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts index d3c580dc3c412b..74cee8f1633071 100644 --- a/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts +++ b/packages/next/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.spec.ts @@ -1,6 +1,6 @@ import { readJson, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { libraryGenerator } from '../../generators/library/library'; import { removeStyledJsxBabelConfig } from './remove-styled-jsx-babel-plugin'; diff --git a/packages/node/package.json b/packages/node/package.json index e7d94a1a382d4b..06334d4d2d9586 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -34,7 +34,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/workspace": "file:../workspace" }, "publishConfig": { diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index 61dd038c57fff5..4ab6e7ab8f85a9 100644 --- a/packages/node/src/generators/application/application.spec.ts +++ b/packages/node/src/generators/application/application.spec.ts @@ -69,7 +69,7 @@ describe('app', () => { }) ); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-node-app/**/*.ts'], @@ -193,7 +193,7 @@ describe('app', () => { expect(project.root).toEqual('my-dir/my-node-app'); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/my-node-app/**/*.ts'], @@ -283,7 +283,7 @@ describe('app', () => { expect(project.targets.test).toBeUndefined(); expect(project.targets.lint).toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-node-app/**/*.ts", diff --git a/packages/node/src/generators/application/application.ts b/packages/node/src/generators/application/application.ts index a7349b4c059710..c3534bbf1d21a9 100644 --- a/packages/node/src/generators/application/application.ts +++ b/packages/node/src/generators/application/application.ts @@ -24,8 +24,8 @@ import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/pr import { configurationGenerator } from '@nx/jest'; import { getRelativePathToRootTsConfig, tsConfigBaseOptions } from '@nx/js'; import { esbuildVersion } from '@nx/js/src/utils/versions'; -import { Linter, lintProjectGenerator } from '@nx/linter'; -import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; +import { mapLintPattern } from '@nx/eslint/src/generators/lint-project/lint-project'; import { join } from 'path'; import { expressTypingsVersion, diff --git a/packages/node/src/generators/application/schema.d.ts b/packages/node/src/generators/application/schema.d.ts index 5f7de5dae1b58c..a38e4ed97f85aa 100644 --- a/packages/node/src/generators/application/schema.d.ts +++ b/packages/node/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/node/src/generators/e2e-project/e2e-project.ts b/packages/node/src/generators/e2e-project/e2e-project.ts index 6d977f1f818863..21ac37d76c40b2 100644 --- a/packages/node/src/generators/e2e-project/e2e-project.ts +++ b/packages/node/src/generators/e2e-project/e2e-project.ts @@ -13,11 +13,11 @@ import { Tree, } from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { javaScriptOverride, typeScriptOverride, -} from '@nx/linter/src/generators/init/global-eslint-config'; +} from '@nx/eslint/src/generators/init/global-eslint-config'; import * as path from 'path'; import { axiosVersion } from '../../utils/versions'; import { Schema } from './schema'; @@ -25,7 +25,7 @@ import { addPluginsToLintConfig, isEslintConfigSupported, replaceOverridesInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; export async function e2eProjectGenerator(host: Tree, options: Schema) { return await e2eProjectGeneratorInternal(host, { diff --git a/packages/node/src/generators/library/library.spec.ts b/packages/node/src/generators/library/library.spec.ts index a3e39f4a2bac93..57f5688f4b657a 100644 --- a/packages/node/src/generators/library/library.spec.ts +++ b/packages/node/src/generators/library/library.spec.ts @@ -29,7 +29,7 @@ describe('lib', () => { expect(configuration.root).toEqual('my-lib'); expect(configuration.targets.build).toBeUndefined(); expect(configuration.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.ts'], @@ -229,7 +229,7 @@ describe('lib', () => { const project = readProjectConfiguration(tree, 'my-lib'); expect(project.root).toEqual('my-dir/my-lib'); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/my-lib/**/*.ts'], diff --git a/packages/node/src/generators/library/schema.d.ts b/packages/node/src/generators/library/schema.d.ts index f277e7d848d58b..4994e127b9382c 100644 --- a/packages/node/src/generators/library/schema.d.ts +++ b/packages/node/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/nx/package.json b/packages/nx/package.json index 1beae3011ba916..bf57f93e7d5e25 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -99,7 +99,7 @@ "@nrwl/js", "@nx/jest", "@nrwl/jest", - "@nx/linter", + "@nx/eslint", "@nrwl/linter", "@nx/workspace", "@nrwl/workspace", diff --git a/packages/nx/src/adapter/ngcli-adapter.ts b/packages/nx/src/adapter/ngcli-adapter.ts index d88c92b88c1256..8f3b3bdaf6043c 100644 --- a/packages/nx/src/adapter/ngcli-adapter.ts +++ b/packages/nx/src/adapter/ngcli-adapter.ts @@ -805,7 +805,7 @@ let mockedSchematics = null; * overrideCollectionResolutionForTesting({ * '@nx/workspace': path.join(__dirname, '../../../../workspace/generators.json'), * '@nx/angular': path.join(__dirname, '../../../../angular/generators.json'), - * '@nx/linter': path.join(__dirname, '../../../../linter/generators.json') + * '@nx/eslint': path.join(__dirname, '../../../../linter/generators.json') * }); * * ``` diff --git a/packages/nx/src/command-line/init/implementation/add-nx-to-nest.ts b/packages/nx/src/command-line/init/implementation/add-nx-to-nest.ts index 201756c9f1a78d..1a1a3dc45a5cc3 100644 --- a/packages/nx/src/command-line/init/implementation/add-nx-to-nest.ts +++ b/packages/nx/src/command-line/init/implementation/add-nx-to-nest.ts @@ -235,7 +235,7 @@ function createProjectJson( // lint json.targets['lint'] = { - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['src/**/*.ts', 'test/**/*.ts'], diff --git a/packages/nx/src/utils/plugins/core-plugins.ts b/packages/nx/src/utils/plugins/core-plugins.ts index a2c473cde0861a..c545b7685483d5 100644 --- a/packages/nx/src/utils/plugins/core-plugins.ts +++ b/packages/nx/src/utils/plugins/core-plugins.ts @@ -37,7 +37,7 @@ export function fetchCorePlugins(): CorePlugin[] { capabilities: 'executors,generators', }, { - name: '@nx/linter', + name: '@nx/eslint', capabilities: 'executors,generators', }, { diff --git a/packages/playwright/package.json b/packages/playwright/package.json index ac5338062d8b5c..b5ba99daef10d5 100644 --- a/packages/playwright/package.json +++ b/packages/playwright/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@nx/devkit": "file:../devkit", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "tslib": "^2.3.0" }, "peerDependencies": { diff --git a/packages/playwright/src/generators/configuration/schema.d.ts b/packages/playwright/src/generators/configuration/schema.d.ts index f3e88dcf1a7e47..2701b8ae27bb77 100644 --- a/packages/playwright/src/generators/configuration/schema.d.ts +++ b/packages/playwright/src/generators/configuration/schema.d.ts @@ -1,4 +1,4 @@ -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface ConfigurationGeneratorSchema { project: string; diff --git a/packages/playwright/src/utils/add-linter.ts b/packages/playwright/src/utils/add-linter.ts index b14d133411991b..dc1354f891fd93 100644 --- a/packages/playwright/src/utils/add-linter.ts +++ b/packages/playwright/src/utils/add-linter.ts @@ -6,8 +6,8 @@ import { runTasksInSerial, Tree, } from '@nx/devkit'; -import { Linter, lintProjectGenerator } from '@nx/linter'; -import { javaScriptOverride } from '@nx/linter/src/generators/init/global-eslint-config'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; +import { javaScriptOverride } from '@nx/eslint/src/generators/init/global-eslint-config'; import { eslintPluginPlaywrightVersion } from './versions'; import { addExtendsToLintConfig, @@ -15,7 +15,7 @@ import { addPluginsToLintConfig, findEslintFile, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; export interface PlaywrightLinterOptions { project: string; diff --git a/packages/plugin/package.json b/packages/plugin/package.json index b52aca1e9e93fe..c952e0d27cae34 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -34,7 +34,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter" + "@nx/eslint": "file:../eslint" }, "publishConfig": { "access": "public" diff --git a/packages/plugin/src/generators/create-package/create-package.spec.ts b/packages/plugin/src/generators/create-package/create-package.spec.ts index 0b8a1f36c61754..8715a78ce2520c 100644 --- a/packages/plugin/src/generators/create-package/create-package.spec.ts +++ b/packages/plugin/src/generators/create-package/create-package.spec.ts @@ -5,7 +5,7 @@ import { Tree, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { PackageJson } from 'nx/src/utils/package-json'; import pluginGenerator from '../plugin/plugin'; import { createPackageGenerator } from './create-package'; diff --git a/packages/plugin/src/generators/create-package/schema.d.ts b/packages/plugin/src/generators/create-package/schema.d.ts index 1683b5f6e4a449..35acb9a68601cb 100644 --- a/packages/plugin/src/generators/create-package/schema.d.ts +++ b/packages/plugin/src/generators/create-package/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-directory-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface CreatePackageSchema { name: string; diff --git a/packages/plugin/src/generators/e2e-project/e2e.spec.ts b/packages/plugin/src/generators/e2e-project/e2e.spec.ts index c3fbd1da9f8bc3..6e8e0a1ec366c7 100644 --- a/packages/plugin/src/generators/e2e-project/e2e.spec.ts +++ b/packages/plugin/src/generators/e2e-project/e2e.spec.ts @@ -169,7 +169,7 @@ describe('NxPlugin e2e-project Generator', () => { const projectsConfigurations = getProjects(tree); expect(projectsConfigurations.get('my-plugin-e2e').targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['apps/my-plugin-e2e/**/*.ts'], diff --git a/packages/plugin/src/generators/e2e-project/e2e.ts b/packages/plugin/src/generators/e2e-project/e2e.ts index ca28e54602a230..d1f38aa508a4c4 100644 --- a/packages/plugin/src/generators/e2e-project/e2e.ts +++ b/packages/plugin/src/generators/e2e-project/e2e.ts @@ -21,7 +21,7 @@ import { addPropertyToJestConfig, configurationGenerator } from '@nx/jest'; import { getRelativePathToRootTsConfig } from '@nx/js'; import { setupVerdaccio } from '@nx/js/src/generators/setup-verdaccio/generator'; import { addLocalRegistryScripts } from '@nx/js/src/utils/add-local-registry-scripts'; -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { join } from 'path'; import type { Schema } from './schema'; diff --git a/packages/plugin/src/generators/e2e-project/schema.d.ts b/packages/plugin/src/generators/e2e-project/schema.d.ts index 2e2b5c437aecf7..ef0497c712ca90 100644 --- a/packages/plugin/src/generators/e2e-project/schema.d.ts +++ b/packages/plugin/src/generators/e2e-project/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-directory-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { pluginName: string; diff --git a/packages/plugin/src/generators/lint-checks/generator.spec.ts b/packages/plugin/src/generators/lint-checks/generator.spec.ts index 8ce875b7b789af..3b6c4afaa115d4 100644 --- a/packages/plugin/src/generators/lint-checks/generator.spec.ts +++ b/packages/plugin/src/generators/lint-checks/generator.spec.ts @@ -9,8 +9,8 @@ import { } from '@nx/devkit'; import type { Linter as ESLint } from 'eslint'; -import { Linter } from '@nx/linter'; -import { Schema as EsLintExecutorOptions } from '@nx/linter/src/executors/eslint/schema'; +import { Linter } from '@nx/eslint'; +import { Schema as EsLintExecutorOptions } from '@nx/eslint/src/executors/eslint/schema'; import generator from './generator'; import pluginGenerator from '../plugin/plugin'; diff --git a/packages/plugin/src/generators/lint-checks/generator.ts b/packages/plugin/src/generators/lint-checks/generator.ts index 16345f67153751..87a224b08c32c1 100644 --- a/packages/plugin/src/generators/lint-checks/generator.ts +++ b/packages/plugin/src/generators/lint-checks/generator.ts @@ -12,7 +12,7 @@ import { writeJson, } from '@nx/devkit'; -import type { Schema as EsLintExecutorOptions } from '@nx/linter/src/executors/eslint/schema'; +import type { Schema as EsLintExecutorOptions } from '@nx/eslint/src/executors/lint/schema'; import { PluginLintChecksGeneratorSchema } from './schema'; import { NX_PREFIX } from 'nx/src/utils/logger'; @@ -22,8 +22,8 @@ import { isEslintConfigSupported, lintConfigHasOverride, updateOverrideInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; -import { useFlatConfig } from '@nx/linter/src/utils/flat-config'; +} from '@nx/eslint/src/generators/utils/eslint-file'; +import { useFlatConfig } from '@nx/eslint/src/utils/flat-config'; export default async function pluginLintCheckGenerator( host: Tree, @@ -135,6 +135,7 @@ function updateProjectTarget( for (const [target, configuration] of Object.entries(project.targets)) { if ( + configuration.executor === '@nx/eslint:lint' || configuration.executor === '@nx/linter:eslint' || configuration.executor === '@nrwl/linter:eslint' ) { @@ -292,6 +293,8 @@ export function getEsLintOptions( ): [target: string, configuration: TargetConfiguration] { return Object.entries(project.targets || {}).find( ([, x]) => - x.executor === '@nx/linter:eslint' || x.executor === '@nrwl/linter:eslint' + x.executor === '@nx/eslint:lint' || + x.executor === '@nx/linter:eslint' || + x.executor === '@nrwl/linter:eslint' ); } diff --git a/packages/plugin/src/generators/plugin/plugin.spec.ts b/packages/plugin/src/generators/plugin/plugin.spec.ts index b00754dc14ed95..20ca43d2d73a4c 100644 --- a/packages/plugin/src/generators/plugin/plugin.spec.ts +++ b/packages/plugin/src/generators/plugin/plugin.spec.ts @@ -6,7 +6,7 @@ import { Tree, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { PackageJson } from 'nx/src/utils/package-json'; import { pluginGenerator } from './plugin'; import { Schema } from './schema'; @@ -68,7 +68,7 @@ describe('NxPlugin Plugin Generator', () => { }, }); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: expect.arrayContaining([ diff --git a/packages/plugin/src/generators/plugin/plugin.ts b/packages/plugin/src/generators/plugin/plugin.ts index 96f195e4450282..a78cb09c80258b 100644 --- a/packages/plugin/src/generators/plugin/plugin.ts +++ b/packages/plugin/src/generators/plugin/plugin.ts @@ -13,7 +13,7 @@ import { } from '@nx/devkit'; import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { addSwcDependencies } from '@nx/js/src/utils/swc/add-swc-dependencies'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import * as path from 'path'; import { e2eProjectGenerator } from '../e2e-project/e2e'; import pluginLintCheckGenerator from '../lint-checks/generator'; diff --git a/packages/plugin/src/generators/plugin/schema.d.ts b/packages/plugin/src/generators/plugin/schema.d.ts index 0b77a9be7fc56b..470fa7f14f3626 100644 --- a/packages/plugin/src/generators/plugin/schema.d.ts +++ b/packages/plugin/src/generators/plugin/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-directory-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/plugin/src/generators/preset/generator.ts b/packages/plugin/src/generators/preset/generator.ts index 47769716d5b06c..5f9478cbf8dcdc 100644 --- a/packages/plugin/src/generators/preset/generator.ts +++ b/packages/plugin/src/generators/preset/generator.ts @@ -8,7 +8,7 @@ import { GeneratorCallback, names, } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { PackageJson } from 'nx/src/utils/package-json'; import { pluginGenerator } from '../plugin/plugin'; import { PresetGeneratorSchema } from './schema'; diff --git a/packages/plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts b/packages/plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts index 6ec8486e616fb7..cc9167fc4bdae6 100644 --- a/packages/plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts +++ b/packages/plugin/src/migrations/update-15-0-0/specify-output-capture.spec.ts @@ -1,6 +1,6 @@ import { readJson, updateJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils'; import { ExecutorConfig } from 'nx/src/config/misc-interfaces'; import executorGenerator from '../../generators/executor/executor'; diff --git a/packages/plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts b/packages/plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts index 77c49e508bbd45..8e021a2463995e 100644 --- a/packages/plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts +++ b/packages/plugin/src/migrations/update-16-0-0/cli-in-schema-json.spec.ts @@ -10,7 +10,7 @@ import { writeJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { assertRunsAgainstNxRepo } from '@nx/devkit/internal-testing-utils'; import { PackageJson } from 'nx/src/utils/package-json'; import executorGenerator from '../../generators/executor/executor'; diff --git a/packages/react-native/package.json b/packages/react-native/package.json index a50cab6ab76aba..89c8d4f9cb9372 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -40,7 +40,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/react": "file:../react", "@nx/workspace": "file:../workspace" }, diff --git a/packages/react-native/src/generators/application/application.spec.ts b/packages/react-native/src/generators/application/application.spec.ts index eb234bee904896..450d2ed8a27d8f 100644 --- a/packages/react-native/src/generators/application/application.spec.ts +++ b/packages/react-native/src/generators/application/application.spec.ts @@ -5,7 +5,7 @@ import { readProjectConfiguration, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { reactNativeApplicationGenerator } from './application'; describe('app', () => { diff --git a/packages/react-native/src/generators/application/lib/add-detox.ts b/packages/react-native/src/generators/application/lib/add-detox.ts index 981a118169afc1..e3ebc558b25d16 100644 --- a/packages/react-native/src/generators/application/lib/add-detox.ts +++ b/packages/react-native/src/generators/application/lib/add-detox.ts @@ -1,7 +1,7 @@ import { detoxApplicationGenerator } from '@nx/detox'; import { Tree } from '@nx/devkit'; import { NormalizedSchema } from './normalize-options'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export async function addDetox(host: Tree, options: NormalizedSchema) { if (options?.e2eTestRunner !== 'detox') { diff --git a/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts b/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts index f2c7c13bb63392..c3075e9f65f410 100644 --- a/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts +++ b/packages/react-native/src/generators/application/lib/nomalize-options.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { Schema } from '../schema'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/react-native/src/generators/application/schema.d.ts b/packages/react-native/src/generators/application/schema.d.ts index fa553bc5c4dcde..749b5897f45cb8 100644 --- a/packages/react-native/src/generators/application/schema.d.ts +++ b/packages/react-native/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/react-native/src/generators/component-story/component-story.spec.ts b/packages/react-native/src/generators/component-story/component-story.spec.ts index 29a4e1b4caaa0a..dfb22bd2f8a612 100644 --- a/packages/react-native/src/generators/component-story/component-story.spec.ts +++ b/packages/react-native/src/generators/component-story/component-story.spec.ts @@ -1,7 +1,7 @@ import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import componentStoryGenerator from './component-story'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { formatFile } from '../../utils/format-file'; import libraryGenerator from '../library/library'; @@ -75,9 +75,9 @@ describe('react-native:component-story', () => { appTree.write( 'test-ui-lib/src/lib/test-ui-libplain.jsx', `import React from 'react'; - + import './test.scss'; - + export const Test = () => { return (
@@ -85,8 +85,8 @@ describe('react-native:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -117,7 +117,7 @@ describe('react-native:component-story', () => { `import React from 'react'; import { View, Text } from 'react-native'; - + export function Test() { return ( @@ -125,8 +125,8 @@ describe('react-native:component-story', () => { ); } - - export default Test; + + export default Test; ` ); await componentStoryGenerator(appTree, { @@ -178,14 +178,14 @@ describe('react-native:component-story', () => { `import React from 'react'; export type ButtonStyle = 'default' | 'primary' | 'warning'; - + export interface TestProps { name: string; displayAge: boolean; someAction: (e: unknown) => void; style: ButtonStyle; } - + export const Test = (props: TestProps) => { return (
@@ -194,8 +194,8 @@ describe('react-native:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -337,12 +337,12 @@ describe('react-native:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + export interface TestProps { name: string; displayAge: boolean; } - + ${config.src} ` ); diff --git a/packages/react-native/src/generators/library/library.spec.ts b/packages/react-native/src/generators/library/library.spec.ts index 32cfa2a57a761b..77eb8883ce35f7 100644 --- a/packages/react-native/src/generators/library/library.spec.ts +++ b/packages/react-native/src/generators/library/library.spec.ts @@ -6,7 +6,7 @@ import { } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import libraryGenerator from './library'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { Schema } from './schema'; describe('lib', () => { @@ -34,7 +34,7 @@ describe('lib', () => { expect(projectConfiguration.root).toEqual('my-lib'); expect(projectConfiguration.targets.build).toBeUndefined(); expect(projectConfiguration.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx}'], @@ -155,7 +155,7 @@ describe('lib', () => { expect(projectConfiguration.root).toEqual('my-dir'); expect(projectConfiguration.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/**/*.{ts,tsx,js,jsx}'], @@ -225,7 +225,7 @@ describe('lib', () => { const projectConfiguration = readProjectConfiguration(appTree, 'my-lib'); expect(projectConfiguration.targets.test).toBeUndefined(); expect(projectConfiguration.targets.lint).toMatchObject({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx}'], }, diff --git a/packages/react-native/src/generators/library/schema.d.ts b/packages/react-native/src/generators/library/schema.d.ts index b4ae7b807f59d1..e515465f19982b 100644 --- a/packages/react-native/src/generators/library/schema.d.ts +++ b/packages/react-native/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; /** * Same as the @nx/react library schema, except it removes keys: style, component, routing, appProject diff --git a/packages/react-native/src/generators/stories/stories-app.spec.ts b/packages/react-native/src/generators/stories/stories-app.spec.ts index 52a4ae7487b084..6b971efac5e3b4 100644 --- a/packages/react-native/src/generators/stories/stories-app.spec.ts +++ b/packages/react-native/src/generators/stories/stories-app.spec.ts @@ -2,7 +2,7 @@ import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { reactNativeComponentGenerator } from '../component/component'; describe('react:stories for applications', () => { diff --git a/packages/react-native/src/generators/stories/stories-lib.spec.ts b/packages/react-native/src/generators/stories/stories-lib.spec.ts index 8c16586ab63378..d9337b4069cd82 100644 --- a/packages/react-native/src/generators/stories/stories-lib.spec.ts +++ b/packages/react-native/src/generators/stories/stories-lib.spec.ts @@ -2,7 +2,7 @@ import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import libraryGenerator from '../library/library'; import reactNativeComponentGenerator from '../component/component'; diff --git a/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts b/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts index 98722e9af32ee8..ee57a0ac5effdb 100644 --- a/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts +++ b/packages/react-native/src/generators/storybook-configuration/configuration.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { logger } from '@nx/devkit'; import libraryGenerator from '../library/library'; diff --git a/packages/react-native/src/generators/storybook-configuration/schema.d.ts b/packages/react-native/src/generators/storybook-configuration/schema.d.ts index 74cb2eb7356302..6df0723281297c 100644 --- a/packages/react-native/src/generators/storybook-configuration/schema.d.ts +++ b/packages/react-native/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export interface StorybookConfigureSchema { name: string; diff --git a/packages/react-native/src/generators/upgrade-native/schema.d.ts b/packages/react-native/src/generators/upgrade-native/schema.d.ts index dd8403a234a5e3..a492a56913a7db 100644 --- a/packages/react-native/src/generators/upgrade-native/schema.d.ts +++ b/packages/react-native/src/generators/upgrade-native/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export interface UpgradeNativeConfigureSchema { name: string; diff --git a/packages/react-native/src/utils/add-linting.spec.ts b/packages/react-native/src/utils/add-linting.spec.ts index f233d7bf1307ff..03fa628105fa15 100644 --- a/packages/react-native/src/utils/add-linting.spec.ts +++ b/packages/react-native/src/utils/add-linting.spec.ts @@ -1,6 +1,6 @@ import { readProjectConfiguration, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { libraryGenerator } from '@nx/js'; import { addLinting } from './add-linting'; @@ -25,7 +25,7 @@ describe('Add Linting', () => { const project = readProjectConfiguration(tree, 'my-lib'); expect(project.targets.lint).toBeDefined(); - expect(project.targets.lint.executor).toEqual('@nx/linter:eslint'); + expect(project.targets.lint.executor).toEqual('@nx/eslint:lint'); }); it('should not add lint target when "none" is passed', async () => { diff --git a/packages/react-native/src/utils/add-linting.ts b/packages/react-native/src/utils/add-linting.ts index cc3617e4d5e270..332a7293bee4ee 100644 --- a/packages/react-native/src/utils/add-linting.ts +++ b/packages/react-native/src/utils/add-linting.ts @@ -1,4 +1,4 @@ -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { addDependenciesToPackageJson, GeneratorCallback, @@ -10,7 +10,7 @@ import { addExtendsToLintConfig, addIgnoresToLintConfig, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; interface NormalizedSchema { linter?: Linter; diff --git a/packages/react-native/src/utils/testing-generators.ts b/packages/react-native/src/utils/testing-generators.ts index ca6cb58f730b5d..883bfeca750d01 100644 --- a/packages/react-native/src/utils/testing-generators.ts +++ b/packages/react-native/src/utils/testing-generators.ts @@ -1,6 +1,6 @@ import { addProjectConfiguration, names, Tree } from '@nx/devkit'; import applicationGenerator from '../generators/application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export async function createApp(tree: Tree, appName: string): Promise { await applicationGenerator(tree, { diff --git a/packages/react/package.json b/packages/react/package.json index 2bc7c4d2e92251..4fab7cafa2e9d4 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -39,7 +39,7 @@ "tslib": "^2.3.0", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/web": "file:../web" }, "publishConfig": { diff --git a/packages/react/src/generators/application/application.spec.ts b/packages/react/src/generators/application/application.spec.ts index 2c04b808011aaa..7213abaefd60b7 100644 --- a/packages/react/src/generators/application/application.spec.ts +++ b/packages/react/src/generators/application/application.spec.ts @@ -8,7 +8,7 @@ import { updateNxJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { applicationGenerator } from './application'; import { Schema } from './schema'; // need to mock cypress otherwise it'll use the nx installed version from package.json @@ -463,7 +463,7 @@ describe('app', () => { const projectsConfigurations = getProjects(appTree); expect(projectsConfigurations.get('my-app').targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-app/**/*.{ts,tsx,js,jsx}'], @@ -487,7 +487,7 @@ describe('app', () => { expect(projectsConfigurations.get('my-app').targets.lint) .toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app/**/*.{ts,tsx,js,jsx}", @@ -570,7 +570,7 @@ describe('app', () => { const packageJson = readJson(appTree, '/package.json'); expect(packageJson.devDependencies.eslint).toBeDefined(); - expect(packageJson.devDependencies['@nx/linter']).toBeDefined(); + expect(packageJson.devDependencies['@nx/eslint']).toBeDefined(); expect(packageJson.devDependencies['@nx/eslint-plugin']).toBeDefined(); expect(packageJson.devDependencies['eslint-plugin-react']).toBeDefined(); expect( diff --git a/packages/react/src/generators/application/application.ts b/packages/react/src/generators/application/application.ts index de7aa3e5402bb9..6701edfc90b598 100644 --- a/packages/react/src/generators/application/application.ts +++ b/packages/react/src/generators/application/application.ts @@ -22,8 +22,8 @@ import { } from '@nx/devkit'; import reactInitGenerator from '../init/init'; -import { Linter, lintProjectGenerator } from '@nx/linter'; -import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; +import { mapLintPattern } from '@nx/eslint/src/generators/lint-project/lint-project'; import { babelLoaderVersion, nxRspackVersion, @@ -38,7 +38,7 @@ import { addE2e } from './lib/add-e2e'; import { addExtendsToLintConfig, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; async function addLinting(host: Tree, options: NormalizedSchema) { const tasks: GeneratorCallback[] = []; diff --git a/packages/react/src/generators/application/schema.d.ts b/packages/react/src/generators/application/schema.d.ts index 7889227778ac55..5b7421d540dc1a 100644 --- a/packages/react/src/generators/application/schema.d.ts +++ b/packages/react/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '../../../typings/style'; export interface Schema { diff --git a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts index 940b13ef5c67ac..42bb2ac866ebe0 100644 --- a/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts +++ b/packages/react/src/generators/component-cypress-spec/component-cypress-spec.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { formatFile } from '../../utils/format-file'; import applicationGenerator from '../application/application'; import libraryGenerator from '../library/library'; @@ -13,14 +13,14 @@ describe('react:component-cypress-spec', () => { { plainJS: false, testCmpSrcWithProps: `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + export const Test = (props: TestProps) => { return (
@@ -28,13 +28,13 @@ describe('react:component-cypress-spec', () => {
); }; - - export default Test; + + export default Test; `, testCmpSrcWithoutProps: `import React from 'react'; - + import './test.scss'; - + export const Test = () => { return (
@@ -42,15 +42,15 @@ describe('react:component-cypress-spec', () => {
); }; - - export default Test; + + export default Test; `, }, { plainJS: true, testCmpSrcWithProps: `import React from 'react'; - - import './test.scss'; + + import './test.scss'; export const Test = (props: TestProps) => { return (
@@ -58,8 +58,8 @@ describe('react:component-cypress-spec', () => {
); }; - - export default Test; + + export default Test; `, testCmpSrcWithoutProps: `import React from 'react'; import './test.scss'; @@ -70,8 +70,8 @@ describe('react:component-cypress-spec', () => { ); }; - - export default Test; + + export default Test; `, }, ].forEach((testConfig) => { @@ -106,7 +106,7 @@ describe('react:component-cypress-spec', () => { ) .toContain(formatFile`describe('test-ui-lib: Test component', () => { beforeEach(() => cy.visit('/iframe.html?id=test--primary&args=name;displayAge:false;')); - + it('should render the component', () => { cy.get('h1').should('contain', 'Welcome to Test!'); }); @@ -133,7 +133,7 @@ describe('react:component-cypress-spec', () => { expect(formatFile`${appTree.read(cypressStorySpecFilePath, 'utf-8')}`) .toContain(formatFile`describe('test-ui-lib: Test component', () => { beforeEach(() => cy.visit('/iframe.html?id=test--primary')); - + it('should render the component', () => { cy.get('h1').should('contain', 'Welcome to Test!'); }); diff --git a/packages/react/src/generators/component-story/component-story.spec.ts b/packages/react/src/generators/component-story/component-story.spec.ts index 0b7b3f73a107e4..e3e8a83e66233b 100644 --- a/packages/react/src/generators/component-story/component-story.spec.ts +++ b/packages/react/src/generators/component-story/component-story.spec.ts @@ -2,7 +2,7 @@ import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import libraryGenerator from '../library/library'; import componentStoryGenerator from './component-story'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('react:component-story', () => { let appTree: Tree; @@ -62,9 +62,9 @@ describe('react:component-story', () => { appTree.write( 'test-ui-lib/src/lib/test-ui-libplain.jsx', `import React from 'react'; - + import './test.scss'; - + export const Test = () => { return (
@@ -72,8 +72,8 @@ describe('react:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -97,9 +97,9 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + import './test.scss'; - + export const Test = () => { return (
@@ -107,8 +107,8 @@ describe('react:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -128,14 +128,14 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + export const Test = (props: TestProps) => { return (
@@ -143,8 +143,8 @@ describe('react:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -164,18 +164,18 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + import './test.scss'; export type ButtonStyle = 'default' | 'primary' | 'warning'; - + export interface TestProps { name: string; displayAge: boolean; someAction: (e: unknown) => void; style: ButtonStyle; } - + export const Test = (props: TestProps) => { return (
@@ -184,8 +184,8 @@ describe('react:component-story', () => {
); }; - - export default Test; + + export default Test; ` ); @@ -320,14 +320,14 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + ${src} ` ); @@ -435,14 +435,14 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + ${src} ` ); @@ -463,19 +463,19 @@ describe('react:component-story', () => { appTree.write( cmpPath, `import React from 'react'; - + function One() { return
Hello one
; } - + function Two() { return
Hello two
; } - + export interface ThreeProps { name: string; - } - + } + function Three(props: ThreeProps) { return (
@@ -483,8 +483,8 @@ describe('react:component-story', () => {
); } - - export { One, Two, Three }; + + export { One, Two, Three }; ` ); diff --git a/packages/react/src/generators/component-test/component-test.spec.ts b/packages/react/src/generators/component-test/component-test.spec.ts index 174faf4edda6bc..4b5fa164ec71cf 100644 --- a/packages/react/src/generators/component-test/component-test.spec.ts +++ b/packages/react/src/generators/component-test/component-test.spec.ts @@ -1,7 +1,7 @@ import { assertMinimumCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import libraryGenerator from '../library/library'; import { componentTestGenerator } from './component-test'; diff --git a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts index f721f7e910c52d..ecd17bd11ff14d 100644 --- a/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts +++ b/packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.spec.ts @@ -7,7 +7,7 @@ import { updateProjectConfiguration, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { applicationGenerator } from '../application/application'; import { componentGenerator } from '../component/component'; import { libraryGenerator } from '../library/library'; diff --git a/packages/react/src/generators/federate-module/federate-module.spec.ts b/packages/react/src/generators/federate-module/federate-module.spec.ts index 1ebce3f3681031..12ce7b19b87472 100644 --- a/packages/react/src/generators/federate-module/federate-module.spec.ts +++ b/packages/react/src/generators/federate-module/federate-module.spec.ts @@ -3,7 +3,7 @@ import { Schema } from './schema'; import { Schema as remoteSchma } from '../remote/schema'; import { federateModuleGenerator } from './federate-module'; import { createTreeWithEmptyWorkspace } from 'nx/src/devkit-testing-exports'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { remoteGeneratorInternal } from '../remote/remote'; describe('federate-module', () => { diff --git a/packages/react/src/generators/host/host.spec.ts b/packages/react/src/generators/host/host.spec.ts index e1298de59e7037..30172d8e975b95 100644 --- a/packages/react/src/generators/host/host.spec.ts +++ b/packages/react/src/generators/host/host.spec.ts @@ -2,7 +2,7 @@ import type { Tree } from '@nx/devkit'; import { readJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import hostGenerator from './host'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('hostGenerator', () => { let tree: Tree; diff --git a/packages/react/src/generators/host/schema.d.ts b/packages/react/src/generators/host/schema.d.ts index 51dc14d63b6881..6b399c2b076822 100644 --- a/packages/react/src/generators/host/schema.d.ts +++ b/packages/react/src/generators/host/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '../../../typings'; export interface Schema { diff --git a/packages/react/src/generators/library/lib/add-linting.ts b/packages/react/src/generators/library/lib/add-linting.ts index 0834a21f8665ba..610f83660a2a95 100644 --- a/packages/react/src/generators/library/lib/add-linting.ts +++ b/packages/react/src/generators/library/lib/add-linting.ts @@ -1,5 +1,5 @@ import { Tree } from 'nx/src/generators/tree'; -import { Linter, lintProjectGenerator } from '@nx/linter'; +import { Linter, lintProjectGenerator } from '@nx/eslint'; import { joinPathFragments } from 'nx/src/utils/path'; import { addDependenciesToPackageJson, runTasksInSerial } from '@nx/devkit'; @@ -8,7 +8,7 @@ import { extraEslintDependencies } from '../../../utils/lint'; import { addExtendsToLintConfig, isEslintConfigSupported, -} from '@nx/linter/src/generators/utils/eslint-file'; +} from '@nx/eslint/src/generators/utils/eslint-file'; export async function addLinting(host: Tree, options: NormalizedSchema) { if (options.linter === Linter.EsLint) { diff --git a/packages/react/src/generators/library/lib/normalize-options.spec.ts b/packages/react/src/generators/library/lib/normalize-options.spec.ts index fda0e2648fb758..0e1bafc067fbda 100644 --- a/packages/react/src/generators/library/lib/normalize-options.spec.ts +++ b/packages/react/src/generators/library/lib/normalize-options.spec.ts @@ -1,5 +1,5 @@ import type { Tree } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/react/src/generators/library/library.spec.ts b/packages/react/src/generators/library/library.spec.ts index 2420d6b64e499a..93583cd3de7479 100644 --- a/packages/react/src/generators/library/library.spec.ts +++ b/packages/react/src/generators/library/library.spec.ts @@ -7,7 +7,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { nxVersion } from '../../utils/versions'; import applicationGenerator from '../application/application'; import libraryGenerator from './library'; @@ -53,7 +53,7 @@ describe('lib', () => { expect(project.root).toEqual('my-lib'); expect(project.targets.build).toBeUndefined(); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx}'], @@ -316,7 +316,7 @@ describe('lib', () => { expect(config.root).toEqual('my-dir/my-lib'); expect(config.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/my-lib/**/*.{ts,tsx,js,jsx}'], @@ -418,7 +418,7 @@ describe('lib', () => { expect(config.targets.test).toBeUndefined(); expect(config.targets.lint).toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-lib/**/*.{ts,tsx,js,jsx}", diff --git a/packages/react/src/generators/library/schema.d.ts b/packages/react/src/generators/library/schema.d.ts index 21621995c024cc..8de7282dcde538 100644 --- a/packages/react/src/generators/library/schema.d.ts +++ b/packages/react/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '../../../typings/style'; export interface Schema { diff --git a/packages/react/src/generators/redux/redux.spec.ts b/packages/react/src/generators/redux/redux.spec.ts index f278fbc0d19b95..89bf93826d6978 100644 --- a/packages/react/src/generators/redux/redux.spec.ts +++ b/packages/react/src/generators/redux/redux.spec.ts @@ -1,6 +1,6 @@ import { readJson, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { applicationGenerator } from '../application/application'; import { libraryGenerator } from '../library/library'; import { reduxGenerator } from './redux'; diff --git a/packages/react/src/generators/remote/remote.spec.ts b/packages/react/src/generators/remote/remote.spec.ts index b4f5755f36b2d9..1d1e250d2fa798 100644 --- a/packages/react/src/generators/remote/remote.spec.ts +++ b/packages/react/src/generators/remote/remote.spec.ts @@ -1,6 +1,6 @@ import { readJson, readNxJson } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import remote from './remote'; import { getRootTsConfigPath, getRootTsConfigPathInTree } from '@nx/js'; diff --git a/packages/react/src/generators/remote/schema.d.ts b/packages/react/src/generators/remote/schema.d.ts index cbcb6a96f17c16..cb57362406bab4 100644 --- a/packages/react/src/generators/remote/schema.d.ts +++ b/packages/react/src/generators/remote/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '../../../typings'; import type { NormalizedSchema as ApplicationNormalizedSchema } from '../application/schema'; diff --git a/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts b/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts index 9da982b444af31..21d89d43fcd034 100644 --- a/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts +++ b/packages/react/src/generators/setup-ssr/setup-ssr.spec.ts @@ -2,7 +2,7 @@ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { readJson, Tree } from '@nx/devkit'; import applicationGenerator from '../application/application'; import setupSsrGenerator from './setup-ssr'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('setupSsrGenerator', () => { let tree: Tree; diff --git a/packages/react/src/generators/stories/stories.app.spec.ts b/packages/react/src/generators/stories/stories.app.spec.ts index 31302908f4c7ae..eff11ed002c5bd 100644 --- a/packages/react/src/generators/stories/stories.app.spec.ts +++ b/packages/react/src/generators/stories/stories.app.spec.ts @@ -1,7 +1,7 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import applicationGenerator from '../application/application'; import storiesGenerator from './stories'; // need to mock cypress otherwise it'll use the nx installed version from package.json @@ -112,14 +112,14 @@ describe('react:stories for applications', () => { appTree.write( 'test-ui-app/src/app/test-path/ignore-it/another-one.tsx', `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + export const Test = (props: TestProps) => { return (
@@ -127,7 +127,7 @@ describe('react:stories for applications', () => {
); }; - + export default Test; ` ); @@ -135,14 +135,14 @@ describe('react:stories for applications', () => { appTree.write( 'test-ui-app/src/app/anothercmp/another-cmp-test.skip.tsx', `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + export const Test = (props: TestProps) => { return (
@@ -150,7 +150,7 @@ describe('react:stories for applications', () => {
); }; - + export default Test; ` ); @@ -268,14 +268,14 @@ describe('react:stories for applications', () => { appTree.write( 'test-ui-app/src/app/anothercmp/comp-a/comp-a.tsx', `import React from 'react'; - + import './test.scss'; - + export interface TestProps { name: string; displayAge: boolean; } - + export const Test = (props: TestProps) => { return (
@@ -283,7 +283,7 @@ describe('react:stories for applications', () => {
); }; - + export default Test; ` ); diff --git a/packages/react/src/generators/stories/stories.lib.spec.ts b/packages/react/src/generators/stories/stories.lib.spec.ts index 958124e9ad0865..ad89c17b7d9628 100644 --- a/packages/react/src/generators/stories/stories.lib.spec.ts +++ b/packages/react/src/generators/stories/stories.lib.spec.ts @@ -2,7 +2,7 @@ import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import libraryGenerator from '../library/library'; describe('react:stories for libraries', () => { @@ -92,12 +92,12 @@ describe('react:stories for libraries', () => { appTree.write( 'test-ui-lib/src/lib/test-path/ignore-it/another-one.tsx', `import React from 'react'; - + export interface IgnoreProps { name: string; displayAge: boolean; } - + export const Ignored = (props: IgnoreProps) => { return (
@@ -105,7 +105,7 @@ describe('react:stories for libraries', () => {
); }; - + export default Ignored; ` ); @@ -113,12 +113,12 @@ describe('react:stories for libraries', () => { appTree.write( 'test-ui-lib/src/lib/anothercmp/another-cmp.skip.tsx', `import React from 'react'; - + export interface OtherTestProps { name: string; displayAge: boolean; } - + export const OtherTest = (props: OtherTestProps) => { return (
@@ -126,7 +126,7 @@ describe('react:stories for libraries', () => {
); }; - + export default OtherTest; ` ); diff --git a/packages/react/src/generators/stories/stories.nextjs.spec.ts b/packages/react/src/generators/stories/stories.nextjs.spec.ts index 1b02328f0e0100..8b7ba5908d34e9 100644 --- a/packages/react/src/generators/stories/stories.nextjs.spec.ts +++ b/packages/react/src/generators/stories/stories.nextjs.spec.ts @@ -6,7 +6,7 @@ import { import storiesGenerator from './stories'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import applicationGenerator from '../application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('nextjs:stories for applications', () => { let tree: Tree; diff --git a/packages/react/src/generators/storybook-configuration/configuration.spec.ts b/packages/react/src/generators/storybook-configuration/configuration.spec.ts index 595bcd6b8c1056..7fed7a85c48942 100644 --- a/packages/react/src/generators/storybook-configuration/configuration.spec.ts +++ b/packages/react/src/generators/storybook-configuration/configuration.spec.ts @@ -2,7 +2,7 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { logger, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import applicationGenerator from '../application/application'; import componentGenerator from '../component/component'; import libraryGenerator from '../library/library'; diff --git a/packages/react/src/generators/storybook-configuration/schema.d.ts b/packages/react/src/generators/storybook-configuration/schema.d.ts index 8d28fc92939889..ddfd30192f2171 100644 --- a/packages/react/src/generators/storybook-configuration/schema.d.ts +++ b/packages/react/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export interface StorybookConfigureSchema { name: string; diff --git a/packages/react/src/utils/testing-generators.ts b/packages/react/src/utils/testing-generators.ts index fa459b927a1c6f..e495057985a638 100644 --- a/packages/react/src/utils/testing-generators.ts +++ b/packages/react/src/utils/testing-generators.ts @@ -1,6 +1,6 @@ import { addProjectConfiguration, names, Tree } from '@nx/devkit'; import applicationGenerator from '../generators/application/application'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export async function createApp(tree: Tree, appName: string): Promise { await applicationGenerator(tree, { diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 7828c521f8c09f..c5904139d95207 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -36,7 +36,7 @@ "@nx/cypress": "file:../cypress", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/workspace": "file:../workspace" }, "publishConfig": { diff --git a/packages/storybook/src/generators/configuration/configuration.spec.ts b/packages/storybook/src/generators/configuration/configuration.spec.ts index 29f3adad089ed5..ad4d72d9f15f84 100644 --- a/packages/storybook/src/generators/configuration/configuration.spec.ts +++ b/packages/storybook/src/generators/configuration/configuration.spec.ts @@ -11,7 +11,7 @@ import { } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { libraryGenerator } from '@nx/js'; import { TsConfig } from '../../utils/utilities'; import { storybookVersion } from '../../utils/versions'; diff --git a/packages/storybook/src/generators/configuration/configuration.ts b/packages/storybook/src/generators/configuration/configuration.ts index 85d81e3d79c1ef..1bf5160a049694 100644 --- a/packages/storybook/src/generators/configuration/configuration.ts +++ b/packages/storybook/src/generators/configuration/configuration.ts @@ -29,7 +29,7 @@ import { projectIsRootProjectInStandaloneWorkspace, updateLintConfig, } from './lib/util-functions'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { findStorybookAndBuildTargetsAndCompiler, pleaseUpgrade, @@ -70,14 +70,14 @@ export async function configurationGenerator( if (viteBuildTarget) { if (schema.uiFramework === '@storybook/react-webpack5') { logger.info( - `Your project ${schema.name} uses Vite as a bundler. + `Your project ${schema.name} uses Vite as a bundler. Nx will configure Storybook for this project to use Vite as well.` ); schema.uiFramework = '@storybook/react-vite'; } if (schema.uiFramework === '@storybook/web-components-webpack5') { logger.info( - `Your project ${schema.name} uses Vite as a bundler. + `Your project ${schema.name} uses Vite as a bundler. Nx will configure Storybook for this project to use Vite as well.` ); schema.uiFramework = '@storybook/web-components-vite'; diff --git a/packages/storybook/src/generators/configuration/lib/util-functions.ts b/packages/storybook/src/generators/configuration/lib/util-functions.ts index f4f2654e09ae81..2188f5b5d13a14 100644 --- a/packages/storybook/src/generators/configuration/lib/util-functions.ts +++ b/packages/storybook/src/generators/configuration/lib/util-functions.ts @@ -18,7 +18,7 @@ import { writeJson, } from '@nx/devkit'; import { forEachExecutorOptions } from '@nx/devkit/src/generators/executor-options-utils'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { join, relative } from 'path'; import { dedupe, @@ -28,8 +28,8 @@ import { import { StorybookConfigureSchema } from '../schema'; import { UiFramework7 } from '../../../utils/models'; import { nxVersion } from '../../../utils/versions'; -import { findEslintFile } from '@nx/linter/src/generators/utils/eslint-file'; -import { useFlatConfig } from '@nx/linter/src/utils/flat-config'; +import { findEslintFile } from '@nx/eslint/src/generators/utils/eslint-file'; +import { useFlatConfig } from '@nx/eslint/src/utils/flat-config'; const DEFAULT_PORT = 4400; diff --git a/packages/storybook/src/generators/configuration/schema.d.ts b/packages/storybook/src/generators/configuration/schema.d.ts index 715148a762e190..c349cac10b53e8 100644 --- a/packages/storybook/src/generators/configuration/schema.d.ts +++ b/packages/storybook/src/generators/configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { UiFramework7, UiFramework } from '../../utils/models'; export interface StorybookConfigureSchema { diff --git a/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts b/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts index 0dc2fb7533af89..3365702123f05e 100644 --- a/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts +++ b/packages/storybook/src/generators/cypress-project/cypress-project.spec.ts @@ -1,7 +1,7 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import { readJson, readProjectConfiguration, Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { libraryGenerator } from '@nx/js'; import { cypressProjectGenerator } from './cypress-project'; diff --git a/packages/storybook/src/generators/cypress-project/cypress-project.ts b/packages/storybook/src/generators/cypress-project/cypress-project.ts index 40b2bacc57d9eb..c5678e09f30055 100644 --- a/packages/storybook/src/generators/cypress-project/cypress-project.ts +++ b/packages/storybook/src/generators/cypress-project/cypress-project.ts @@ -19,7 +19,7 @@ import { updateJson, updateProjectConfiguration, } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { join } from 'path'; import { safeFileDelete } from '../../utils/utilities'; diff --git a/packages/storybook/src/utils/testing.ts b/packages/storybook/src/utils/testing.ts index c89f80f34e16e6..c09e372f988641 100644 --- a/packages/storybook/src/utils/testing.ts +++ b/packages/storybook/src/utils/testing.ts @@ -1,7 +1,7 @@ import { Tree } from '@nx/devkit'; import { libraryGenerator } from '@nx/js'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export async function createTestUILibNoNgDevkit( appTree: Tree, diff --git a/packages/vue/package.json b/packages/vue/package.json index c76961e9f0f9ed..76bd27f6d9f77c 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -33,7 +33,7 @@ "@nx/devkit": "file:../devkit", "@nx/jest": "file:../jest", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/vite": "file:../vite", "@nx/web": "file:../web", "@phenomnomnominal/tsquery": "~5.0.1" diff --git a/packages/vue/src/generators/application/application.ts b/packages/vue/src/generators/application/application.ts index bc45d0367c705d..35134638b647b1 100644 --- a/packages/vue/src/generators/application/application.ts +++ b/packages/vue/src/generators/application/application.ts @@ -6,7 +6,7 @@ import { toJS, Tree, } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { Schema } from './schema'; import { normalizeOptions } from './lib/normalize-options'; import { vueInitGenerator } from '../init/init'; diff --git a/packages/vue/src/generators/application/schema.d.ts b/packages/vue/src/generators/application/schema.d.ts index 3ce0654f7236a5..7df31a02a396dd 100644 --- a/packages/vue/src/generators/application/schema.d.ts +++ b/packages/vue/src/generators/application/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap b/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap index f5b244e52dca41..70f3d30e030643 100644 --- a/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap @@ -39,7 +39,7 @@ exports[`lib should add correct jest.config.ts and dependencies to package.json "@nx/eslint-plugin": "0.0.1", "@nx/jest": "0.0.1", "@nx/js": "0.0.1", - "@nx/linter": "0.0.1", + "@nx/eslint": "0.0.1", "@nx/rollup": "0.0.1", "@nx/vite": "0.0.1", "@nx/vue": "0.0.1", @@ -234,7 +234,7 @@ exports[`lib should add vue, vite and vitest to package.json 1`] = ` "@nx/cypress": "0.0.1", "@nx/eslint-plugin": "0.0.1", "@nx/js": "0.0.1", - "@nx/linter": "0.0.1", + "@nx/eslint": "0.0.1", "@nx/rollup": "0.0.1", "@nx/vite": "0.0.1", "@nx/vue": "0.0.1", diff --git a/packages/vue/src/generators/library/lib/normalize-options.spec.ts b/packages/vue/src/generators/library/lib/normalize-options.spec.ts index c126e30d8db320..6378029e200990 100644 --- a/packages/vue/src/generators/library/lib/normalize-options.spec.ts +++ b/packages/vue/src/generators/library/lib/normalize-options.spec.ts @@ -1,5 +1,5 @@ import type { Tree } from '@nx/devkit'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { normalizeOptions } from './normalize-options'; diff --git a/packages/vue/src/generators/library/library.spec.ts b/packages/vue/src/generators/library/library.spec.ts index 9d5d6bde90dfe4..2713f20d5e7a89 100644 --- a/packages/vue/src/generators/library/library.spec.ts +++ b/packages/vue/src/generators/library/library.spec.ts @@ -6,7 +6,7 @@ import { updateJson, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { nxVersion } from '../../utils/versions'; import libraryGenerator from './library'; import { Schema } from './schema'; @@ -42,7 +42,7 @@ describe('lib', () => { expect(project.root).toEqual('my-lib'); expect(project.targets.build).toBeUndefined(); expect(project.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-lib/**/*.{ts,tsx,js,jsx,vue}'], @@ -214,7 +214,7 @@ describe('lib', () => { expect(config.root).toEqual('my-dir/my-lib'); expect(config.targets.lint).toEqual({ - executor: '@nx/linter:eslint', + executor: '@nx/eslint:lint', outputs: ['{options.outputFile}'], options: { lintFilePatterns: ['my-dir/my-lib/**/*.{ts,tsx,js,jsx,vue}'], @@ -261,7 +261,7 @@ describe('lib', () => { expect(config.targets.test).toBeUndefined(); expect(config.targets.lint).toMatchInlineSnapshot(` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-lib/**/*.{ts,tsx,js,jsx,vue}", diff --git a/packages/vue/src/generators/library/schema.d.ts b/packages/vue/src/generators/library/schema.d.ts index 6b08f31cb153a0..dca9062124bc1e 100644 --- a/packages/vue/src/generators/library/schema.d.ts +++ b/packages/vue/src/generators/library/schema.d.ts @@ -1,5 +1,5 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils'; -import type { Linter } from '@nx/linter'; +import type { Linter } from '@nx/eslint'; import type { SupportedStyles } from '../../../typings/style'; export interface Schema { diff --git a/packages/vue/src/generators/stories/lib/component-story.spec.ts b/packages/vue/src/generators/stories/lib/component-story.spec.ts index e000fbaef974ab..6e68c1cb07e9d0 100644 --- a/packages/vue/src/generators/stories/lib/component-story.spec.ts +++ b/packages/vue/src/generators/stories/lib/component-story.spec.ts @@ -2,7 +2,7 @@ import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import libraryGenerator from '../../library/library'; import { createComponentStories } from './component-story'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('vue:component-story', () => { let appTree: Tree; @@ -42,11 +42,11 @@ describe('vue:component-story', () => { age: number; }>(); - + - + ` @@ -81,11 +81,11 @@ describe('vue:component-story', () => { } } - + - + ` diff --git a/packages/vue/src/generators/stories/stories.app.spec.ts b/packages/vue/src/generators/stories/stories.app.spec.ts index b9a327d573f47f..dded11aaa60fd3 100644 --- a/packages/vue/src/generators/stories/stories.app.spec.ts +++ b/packages/vue/src/generators/stories/stories.app.spec.ts @@ -1,6 +1,6 @@ import { Tree } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import applicationGenerator from '../application/application'; import storiesGenerator from './stories'; diff --git a/packages/vue/src/generators/stories/stories.lib.spec.ts b/packages/vue/src/generators/stories/stories.lib.spec.ts index d0b48c27fbdaf7..55cf9a5ac02f98 100644 --- a/packages/vue/src/generators/stories/stories.lib.spec.ts +++ b/packages/vue/src/generators/stories/stories.lib.spec.ts @@ -1,7 +1,7 @@ import { Tree } from '@nx/devkit'; import storiesGenerator from './stories'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import libraryGenerator from '../library/library'; const componentContent = `