From 0bc693342ef321495c979bac6900fcc9df13700a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Jona=C5=A1?= Date: Mon, 16 Oct 2023 17:52:19 +0200 Subject: [PATCH] feat(linter): rename @nx/linter to @nx/eslint (#19515) --- .github/workflows/e2e-matrix.yml | 8 +- .github/workflows/e2e-windows.yml | 8 +- CODEOWNERS | 4 +- docs/generated/manifests/menus.json | 135 ++++++++---------- docs/generated/manifests/nx-api.json | 112 +++++++-------- docs/generated/packages-metadata.json | 110 +++++++------- .../documents/dependency-checks.md | 2 +- .../eslint-plugin/documents/overview.md | 2 +- .../packages/linter/documents/overview.md | 39 ----- .../packages/linter/executors/eslint.json | 6 +- .../generators/convert-to-flat-config.json | 4 +- .../linter/generators/workspace-rule.json | 4 +- .../generators/workspace-rules-project.json | 6 +- .../3-task-running.md | 2 +- .../4-task-pipelines.md | 2 +- .../node-server-tutorial/3-task-running.md | 2 +- .../node-server-tutorial/4-task-pipelines.md | 2 +- .../packages/linter/dependency-checks.md | 2 +- docs/shared/packages/linter/linter-plugin.md | 8 +- .../reduce-repetitive-configuration.md | 8 +- docs/shared/recipes/rescope.md | 7 +- .../tips-n-tricks/migrating-to-flat-eslint.md | 4 +- docs/shared/reference/sitemap.md | 16 +-- e2e/angular-core/src/config.test.ts | 4 +- e2e/angular-core/src/ng-add.test.ts | 2 +- e2e/{linter => eslint}/jest.config.ts | 2 +- e2e/{linter => eslint}/project.json | 10 +- e2e/{linter => eslint}/src/linter.test.ts | 6 +- e2e/{linter => eslint}/tsconfig.json | 0 e2e/{linter => eslint}/tsconfig.spec.json | 0 e2e/utils/create-project-utils.ts | 2 +- nx-dev/nx-dev-e2e/src/packages.spec.ts | 2 +- nx-dev/nx-dev/redirect-rules.js | 20 ++- .../extensible-and-integrated/plugins-tab.tsx | 2 +- nx-dev/ui-references/src/lib/icons-map.ts | 2 +- packages-legacy/linter-nx/README.md | 13 ++ packages-legacy/linter-nx/executors.json | 17 +++ packages-legacy/linter-nx/generators.json | 4 + packages-legacy/linter-nx/index.ts | 1 + packages-legacy/linter-nx/package.json | 37 +++++ packages-legacy/linter-nx/project.json | 38 +++++ packages-legacy/linter-nx/tsconfig.json | 6 + packages-legacy/linter/executors.json | 10 +- packages-legacy/linter/generators.json | 2 +- packages-legacy/linter/index.ts | 2 +- packages-legacy/linter/package.json | 4 +- packages-legacy/nest/project.json | 2 +- packages/angular/package.json | 2 +- .../add-linting/add-linting.spec.ts | 6 +- .../src/generators/add-linting/add-linting.ts | 6 +- .../lib/create-eslint-configuration.ts | 2 +- .../__snapshots__/application.spec.ts.snap | 16 +-- .../application/application.spec.ts | 6 +- .../generators/application/lib/add-linting.ts | 2 +- .../application/lib/normalize-options.ts | 2 +- .../application/lib/normalized-schema.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../__snapshots__/component-test.spec.ts.snap | 12 +- .../component-test/component-test.spec.ts | 8 +- .../files/__componentFileName__.cy.ts__tpl__ | 4 +- .../federate-module/federate-module.spec.ts | 4 +- .../angular/src/generators/host/schema.d.ts | 2 +- .../angular/src/generators/init/init.spec.ts | 2 +- packages/angular/src/generators/init/init.ts | 2 +- .../angular/src/generators/init/schema.d.ts | 2 +- .../library/lib/normalize-options.ts | 2 +- .../library/lib/normalized-schema.ts | 2 +- .../src/generators/library/library.spec.ts | 4 +- .../angular/src/generators/library/library.ts | 2 +- .../src/generators/library/schema.d.ts | 2 +- .../angular/src/generators/move/move.spec.ts | 2 +- .../builders/angular-eslint-lint.migrator.ts | 4 +- .../migrators/projects/app.migrator.spec.ts | 8 +- .../ng-add/migrators/projects/e2e.migrator.ts | 2 +- .../migrators/projects/lib.migrator.spec.ts | 8 +- .../angular/src/generators/ng-add/schema.d.ts | 2 +- .../generators/ng-add/utilities/workspace.ts | 2 +- .../angular/src/generators/remote/schema.d.ts | 2 +- .../storybook-configuration/schema.d.ts | 2 +- .../storybook-configuration.spec.ts | 2 +- .../storybook-utilities.spec.ts | 6 +- .../angular/src/generators/utils/testing.ts | 10 +- packages/cypress/package.json | 2 +- .../generators/configuration/configuration.ts | 2 +- .../cypress-project.spec.ts.snap | 12 +- .../cypress-project/cypress-project.spec.ts | 2 +- .../cypress-project/cypress-project.ts | 2 +- .../generators/cypress-project/schema.d.ts | 2 +- .../migrate-to-cypress-11.spec.ts.snap | 4 +- packages/cypress/src/utils/add-linter.ts | 6 +- packages/detox/package.json | 2 +- .../application/application.spec.ts | 2 +- .../application/lib/add-linting.spec.ts | 4 +- .../generators/application/lib/add-linting.ts | 4 +- .../application/lib/add-project.spec.ts | 2 +- .../application/lib/create-files.spec.ts | 2 +- .../application/lib/normalize-options.spec.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- packages/{linter => eslint}/.eslintrc.json | 0 packages/{linter => eslint}/README.md | 0 .../docs/eslint-examples.md | 0 .../docs/workspace-rule-examples.md | 0 packages/eslint/executors.json | 10 ++ packages/{linter => eslint}/generators.json | 2 +- packages/{linter => eslint}/index.ts | 2 +- packages/{linter => eslint}/jest.config.ts | 2 +- packages/{linter => eslint}/migrations.json | 0 .../{linter => eslint}/migrations.spec.ts | 0 packages/{linter => eslint}/package.json | 6 +- packages/{linter => eslint}/project.json | 20 +-- .../src/executors/lint}/hasher.ts | 0 .../src/executors/lint}/lint.impl.spec.ts | 0 .../src/executors/lint}/lint.impl.ts | 0 .../src/executors/lint}/schema.d.ts | 0 .../src/executors/lint}/schema.json | 0 .../lint}/utility/eslint-utils.spec.ts | 0 .../executors/lint}/utility/eslint-utils.ts | 0 .../__snapshots__/generator.spec.ts.snap | 0 .../converters/json-converter.spec.ts | 0 .../converters/json-converter.ts | 0 .../convert-to-flat-config/generator.spec.ts | 0 .../convert-to-flat-config/generator.ts | 14 +- .../convert-to-flat-config/schema.d.ts | 0 .../convert-to-flat-config/schema.json | 0 .../init/__snapshots__/init.spec.ts.snap | 2 +- .../generators/init/global-eslint-config.ts | 0 .../src/generators/init/init-migration.ts | 1 + .../src/generators/init/init.spec.ts | 2 +- .../src/generators/init/init.ts | 4 +- .../lint-project/lint-project.spec.ts | 6 +- .../generators/lint-project/lint-project.ts | 2 +- .../src/generators/utils/eslint-file.spec.ts | 2 +- .../src/generators/utils/eslint-file.ts | 0 .../src/generators/utils/eslint-targets.ts | 3 + .../utils/flat-config/ast-utils.spec.ts | 0 .../generators/utils/flat-config/ast-utils.ts | 0 .../utils/flat-config/path-utils.ts | 0 .../src/generators/utils/linter.ts | 0 .../__snapshots__/workspace-rule.spec.ts.snap | 16 +-- .../files/__name__.spec.ts__tmpl__ | 0 .../workspace-rule/files/__name__.ts__tmpl__ | 0 .../src/generators/workspace-rule/schema.json | 0 .../workspace-rule/workspace-rule.spec.ts | 4 +- .../workspace-rule/workspace-rule.ts | 0 .../workspace-rules-project.spec.ts.snap | 12 +- .../files/index.ts__tmpl__ | 2 +- .../files/tsconfig.json__tmpl__ | 0 .../files/tsconfig.lint.json__tmpl__ | 0 .../workspace-rules-project/schema.json | 2 +- .../workspace-rules-project.spec.ts | 2 +- .../workspace-rules-project.ts | 0 .../update-15-0-0/add-eslint-inputs.spec.ts | 0 .../update-15-0-0/add-eslint-inputs.ts | 0 .../update-15-7-1/add-eslint-ignore.spec.ts | 0 .../update-15-7-1/add-eslint-ignore.ts | 0 .../update-16-0-0-add-nx-packages.spec.ts | 0 .../update-16-0-0-add-nx-packages.ts | 0 .../update-16-8-0-add-ignored-files.spec.ts | 0 .../update-16-8-0-add-ignored-files.ts | 0 .../update-17-0-0-rename-to-eslint.spec.ts | 75 ++++++++++ .../update-17-0-0-rename-to-eslint.ts | 66 +++++++++ .../src/utils/flat-config.ts | 0 .../utils/rules-requiring-type-checking.ts | 0 .../{linter => eslint}/src/utils/versions.ts | 0 .../src/utils/workspace-lint-rules.ts | 0 packages/{linter => eslint}/tsconfig.json | 0 packages/{linter => eslint}/tsconfig.lib.json | 0 .../{linter => eslint}/tsconfig.spec.json | 0 packages/expo/package.json | 2 +- .../application/application.spec.ts | 2 +- .../generators/application/lib/add-detox.ts | 2 +- .../application/lib/nomalize-options.spec.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../generators/component/component.spec.ts | 2 +- .../src/generators/library/library.spec.ts | 8 +- .../expo/src/generators/library/schema.d.ts | 2 +- packages/expo/src/utils/add-linting.spec.ts | 4 +- packages/expo/src/utils/add-linting.ts | 4 +- packages/express/.eslintrc.json | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../configuration/configuration.spec.ts | 2 +- .../js/src/generators/library/library.spec.ts | 6 +- packages/js/src/generators/library/library.ts | 8 +- packages/js/src/utils/schema.d.ts | 2 +- packages/linter/executors.json | 10 -- packages/nest/package.json | 2 +- packages/nest/project.json | 2 +- .../application/lib/normalize-options.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../__snapshots__/library.spec.ts.snap | 2 +- .../library/lib/normalize-options.ts | 2 +- .../src/generators/library/library.spec.ts | 4 +- .../nest/src/generators/library/schema.d.ts | 2 +- packages/next/package.json | 2 +- .../src/generators/application/lib/add-e2e.ts | 2 +- .../application/lib/add-linting.spec.ts | 2 +- .../generators/application/lib/add-linting.ts | 6 +- .../application/lib/normalize-options.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../generators/component/component.spec.ts | 2 +- .../cypress-component-configuration.spec.ts | 2 +- .../library/lib/normalize-options.spec.ts | 2 +- .../src/generators/library/library.spec.ts | 2 +- .../next/src/generators/library/schema.d.ts | 2 +- packages/node/package.json | 2 +- .../application/application.spec.ts | 6 +- .../src/generators/application/application.ts | 4 +- .../src/generators/application/schema.d.ts | 2 +- .../src/generators/e2e-project/e2e-project.ts | 6 +- .../src/generators/library/library.spec.ts | 4 +- .../node/src/generators/library/schema.d.ts | 2 +- packages/nuxt/package.json | 2 +- .../__snapshots__/application.spec.ts.snap | 2 +- .../src/generators/application/application.ts | 2 +- .../src/generators/application/lib/add-e2e.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../configuration.spec.ts | 2 +- .../storybook-configuration/schema.d.ts | 2 +- packages/nuxt/src/utils/add-linting.ts | 2 +- packages/nx/package.json | 2 +- .../init/implementation/add-nx-to-nest.ts | 2 +- .../update-15-0-0/migrate-to-inputs.ts | 2 +- packages/nx/src/utils/plugins/core-plugins.ts | 2 +- packages/playwright/package.json | 2 +- .../src/generators/configuration/schema.d.ts | 2 +- packages/playwright/src/utils/add-linter.ts | 6 +- packages/plugin/package.json | 2 +- .../create-package/create-package.spec.ts | 2 +- .../src/generators/create-package/schema.d.ts | 2 +- .../src/generators/e2e-project/e2e.spec.ts | 2 +- .../plugin/src/generators/e2e-project/e2e.ts | 2 +- .../src/generators/e2e-project/schema.d.ts | 2 +- .../src/generators/executor/executor.spec.ts | 2 +- .../generators/generator/generator.spec.ts | 2 +- .../generators/lint-checks/generator.spec.ts | 4 +- .../src/generators/lint-checks/generator.ts | 11 +- .../generators/migration/migration.spec.ts | 2 +- .../src/generators/plugin/plugin.spec.ts | 4 +- .../plugin/src/generators/plugin/plugin.ts | 2 +- .../plugin/src/generators/plugin/schema.d.ts | 2 +- .../plugin/src/generators/preset/generator.ts | 2 +- .../specify-output-capture.spec.ts | 2 +- .../update-16-0-0/cli-in-schema-json.spec.ts | 2 +- packages/react-native/package.json | 2 +- .../application/application.spec.ts | 2 +- .../generators/application/lib/add-detox.ts | 2 +- .../application/lib/nomalize-options.spec.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../component-story/component-story.spec.ts | 28 ++-- .../src/generators/library/library.spec.ts | 8 +- .../src/generators/library/schema.d.ts | 2 +- .../generators/stories/stories-app.spec.ts | 2 +- .../generators/stories/stories-lib.spec.ts | 2 +- .../configuration.spec.ts | 2 +- .../storybook-configuration/schema.d.ts | 2 +- .../src/generators/upgrade-native/schema.d.ts | 2 +- .../src/utils/add-linting.spec.ts | 4 +- .../react-native/src/utils/add-linting.ts | 4 +- .../src/utils/testing-generators.ts | 2 +- packages/react/package.json | 2 +- .../application/application.spec.ts | 8 +- .../src/generators/application/application.ts | 6 +- .../src/generators/application/schema.d.ts | 2 +- .../component-cypress-spec.spec.ts | 36 ++--- .../component-story/component-story.spec.ts | 64 ++++----- .../component-test/component-test.spec.ts | 2 +- .../cypress-component-configuration.spec.ts | 2 +- .../federate-module/federate-module.spec.ts | 2 +- .../react/src/generators/host/host.spec.ts | 2 +- .../react/src/generators/host/schema.d.ts | 2 +- .../src/generators/library/lib/add-linting.ts | 4 +- .../library/lib/normalize-options.spec.ts | 2 +- .../src/generators/library/library.spec.ts | 8 +- .../react/src/generators/library/schema.d.ts | 2 +- .../react/src/generators/redux/redux.spec.ts | 2 +- .../src/generators/remote/remote.spec.ts | 2 +- .../react/src/generators/remote/schema.d.ts | 2 +- .../generators/setup-ssr/setup-ssr.spec.ts | 2 +- .../generators/stories/stories.app.spec.ts | 26 ++-- .../generators/stories/stories.lib.spec.ts | 14 +- .../generators/stories/stories.nextjs.spec.ts | 2 +- .../configuration.spec.ts | 2 +- .../storybook-configuration/schema.d.ts | 2 +- packages/react/src/utils/lint.ts | 2 +- .../react/src/utils/testing-generators.ts | 2 +- packages/storybook/package.json | 2 +- .../__snapshots__/configuration.spec.ts.snap | 2 +- .../configuration/configuration.spec.ts | 2 +- .../generators/configuration/configuration.ts | 6 +- .../configuration/lib/util-functions.ts | 6 +- .../src/generators/configuration/schema.d.ts | 2 +- .../cypress-project/cypress-project.spec.ts | 2 +- .../cypress-project/cypress-project.ts | 2 +- packages/storybook/src/utils/testing.ts | 2 +- packages/vue/package.json | 2 +- .../__snapshots__/application.spec.ts.snap | 2 +- .../src/generators/application/application.ts | 2 +- .../src/generators/application/schema.d.ts | 2 +- .../__snapshots__/library.spec.ts.snap | 4 +- .../library/lib/normalize-options.spec.ts | 2 +- .../src/generators/library/library.spec.ts | 8 +- .../vue/src/generators/library/schema.d.ts | 2 +- .../stories/lib/component-story.spec.ts | 10 +- .../generators/stories/stories.app.spec.ts | 2 +- .../generators/stories/stories.lib.spec.ts | 2 +- .../configuration.spec.ts | 2 +- .../storybook-configuration/schema.d.ts | 2 +- packages/vue/src/utils/add-linting.ts | 6 +- packages/vue/src/utils/test-utils.ts | 2 +- packages/web/.eslintrc.json | 2 +- .../application/application.spec.ts | 4 +- .../src/generators/application/application.ts | 4 +- .../src/generators/application/schema.d.ts | 2 +- ...t-configuration-in-new-destination.spec.ts | 4 +- .../move/lib/extract-base-configs.ts | 6 +- .../move/lib/update-eslint-config.ts | 4 +- .../src/generators/move/move.spec.ts | 2 +- ...ve-workspace-generators-to-local-plugin.ts | 2 +- scripts/copy-readme.js | 6 +- .../package-schemas/package-metadata.ts | 20 ++- tools/eslint-rules/index.ts | 2 +- tsconfig.base.json | 4 +- 322 files changed, 981 insertions(+), 774 deletions(-) delete mode 100644 docs/generated/packages/linter/documents/overview.md rename e2e/{linter => eslint}/jest.config.ts (92%) rename e2e/{linter => eslint}/project.json (59%) rename e2e/{linter => eslint}/src/linter.test.ts (99%) rename e2e/{linter => eslint}/tsconfig.json (100%) rename e2e/{linter => eslint}/tsconfig.spec.json (100%) create mode 100644 packages-legacy/linter-nx/README.md create mode 100644 packages-legacy/linter-nx/executors.json create mode 100644 packages-legacy/linter-nx/generators.json create mode 100644 packages-legacy/linter-nx/index.ts create mode 100644 packages-legacy/linter-nx/package.json create mode 100644 packages-legacy/linter-nx/project.json create mode 100644 packages-legacy/linter-nx/tsconfig.json rename packages/{linter => eslint}/.eslintrc.json (100%) rename packages/{linter => eslint}/README.md (100%) rename packages/{linter => eslint}/docs/eslint-examples.md (100%) rename packages/{linter => eslint}/docs/workspace-rule-examples.md (100%) create mode 100644 packages/eslint/executors.json rename packages/{linter => eslint}/generators.json (97%) rename packages/{linter => eslint}/index.ts (86%) rename packages/{linter => eslint}/jest.config.ts (91%) rename packages/{linter => eslint}/migrations.json (100%) rename packages/{linter => eslint}/migrations.spec.ts (100%) rename packages/{linter => eslint}/package.json (88%) rename packages/{linter => eslint}/project.json (70%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/hasher.ts (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/lint.impl.spec.ts (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/lint.impl.ts (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/schema.d.ts (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/schema.json (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/utility/eslint-utils.spec.ts (100%) rename packages/{linter/src/executors/eslint => eslint/src/executors/lint}/utility/eslint-utils.ts (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/__snapshots__/generator.spec.ts.snap (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/converters/json-converter.spec.ts (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/converters/json-converter.ts (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/generator.spec.ts (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/generator.ts (89%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/schema.d.ts (100%) rename packages/{linter => eslint}/src/generators/convert-to-flat-config/schema.json (100%) rename packages/{linter => eslint}/src/generators/init/__snapshots__/init.spec.ts.snap (93%) rename packages/{linter => eslint}/src/generators/init/global-eslint-config.ts (100%) rename packages/{linter => eslint}/src/generators/init/init-migration.ts (98%) rename packages/{linter => eslint}/src/generators/init/init.spec.ts (97%) rename packages/{linter => eslint}/src/generators/init/init.ts (96%) rename packages/{linter => eslint}/src/generators/lint-project/lint-project.spec.ts (97%) rename packages/{linter => eslint}/src/generators/lint-project/lint-project.ts (99%) rename packages/{linter => eslint}/src/generators/utils/eslint-file.spec.ts (97%) rename packages/{linter => eslint}/src/generators/utils/eslint-file.ts (100%) rename packages/{linter => eslint}/src/generators/utils/eslint-targets.ts (81%) rename packages/{linter => eslint}/src/generators/utils/flat-config/ast-utils.spec.ts (100%) rename packages/{linter => eslint}/src/generators/utils/flat-config/ast-utils.ts (100%) rename packages/{linter => eslint}/src/generators/utils/flat-config/path-utils.ts (100%) rename packages/{linter => eslint}/src/generators/utils/linter.ts (100%) rename packages/{linter => eslint}/src/generators/workspace-rule/__snapshots__/workspace-rule.spec.ts.snap (91%) rename packages/{linter => eslint}/src/generators/workspace-rule/files/__name__.spec.ts__tmpl__ (100%) rename packages/{linter => eslint}/src/generators/workspace-rule/files/__name__.ts__tmpl__ (100%) rename packages/{linter => eslint}/src/generators/workspace-rule/schema.json (100%) rename packages/{linter => eslint}/src/generators/workspace-rule/workspace-rule.spec.ts (97%) rename packages/{linter => eslint}/src/generators/workspace-rule/workspace-rule.ts (100%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/__snapshots__/workspace-rules-project.spec.ts.snap (82%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/files/index.ts__tmpl__ (90%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/files/tsconfig.json__tmpl__ (100%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/files/tsconfig.lint.json__tmpl__ (100%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/schema.json (89%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/workspace-rules-project.spec.ts (98%) rename packages/{linter => eslint}/src/generators/workspace-rules-project/workspace-rules-project.ts (100%) rename packages/{linter => eslint}/src/migrations/update-15-0-0/add-eslint-inputs.spec.ts (100%) rename packages/{linter => eslint}/src/migrations/update-15-0-0/add-eslint-inputs.ts (100%) rename packages/{linter => eslint}/src/migrations/update-15-7-1/add-eslint-ignore.spec.ts (100%) rename packages/{linter => eslint}/src/migrations/update-15-7-1/add-eslint-ignore.ts (100%) rename packages/{linter => eslint}/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts (100%) rename packages/{linter => eslint}/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.ts (100%) rename packages/{linter => eslint}/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.spec.ts (100%) rename packages/{linter => eslint}/src/migrations/update-16-8-0-add-ignored-files/update-16-8-0-add-ignored-files.ts (100%) create mode 100644 packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.spec.ts create mode 100644 packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts rename packages/{linter => eslint}/src/utils/flat-config.ts (100%) rename packages/{linter => eslint}/src/utils/rules-requiring-type-checking.ts (100%) rename packages/{linter => eslint}/src/utils/versions.ts (100%) rename packages/{linter => eslint}/src/utils/workspace-lint-rules.ts (100%) rename packages/{linter => eslint}/tsconfig.json (100%) rename packages/{linter => eslint}/tsconfig.lib.json (100%) rename packages/{linter => eslint}/tsconfig.spec.json (100%) delete mode 100644 packages/linter/executors.json diff --git a/.github/workflows/e2e-matrix.yml b/.github/workflows/e2e-matrix.yml index 7b37e38a7a403..1377eadbd1a5e 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 6be6b5c8bf6fd..0143a35c6278a 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/CODEOWNERS b/CODEOWNERS index 5975b703598bb..9bf00f1c1329f 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -116,8 +116,8 @@ rust-toolchain @nrwl/nx-native-reviewers /docs/generated/packages/linter/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers /docs/shared/packages/linter/** @nrwl/nx-linter-reviewers @nrwl/nx-docs-reviewers /packages/eslint-plugin/** @nrwl/nx-linter-reviewers -/packages/linter/** @nrwl/nx-linter-reviewers -/e2e/linter/** @nrwl/nx-linter-reviewers +/packages/eslint/** @nrwl/nx-linter-reviewers +/e2e/eslint/** @nrwl/nx-linter-reviewers .eslint* @nrwl/nx-linter-reviewers # Storybook diff --git a/docs/generated/manifests/menus.json b/docs/generated/manifests/menus.json index ec062b4a8ced4..7e49fb8718db4 100644 --- a/docs/generated/manifests/menus.json +++ b/docs/generated/manifests/menus.json @@ -6559,6 +6559,65 @@ "isExternal": false, "disableCollapsible": false }, + { + "id": "linter", + "path": "/nx-api/linter", + "name": "linter", + "children": [ + { + "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": "eslint-plugin", "path": "/nx-api/eslint-plugin", @@ -7016,82 +7075,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 134288a6af0a2..48b0a0e07292e 100644 --- a/docs/generated/manifests/nx-api.json +++ b/docs/generated/manifests/nx-api.json @@ -650,6 +650,56 @@ }, "path": "/nx-api/esbuild" }, + "linter": { + "githubRoot": "https://github.com/nrwl/nx/blob/master", + "name": "linter", + "packageName": "@nx/linter", + "description": "The ESLint plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.", + "documents": {}, + "root": "/packages/eslint", + "source": "/packages/eslint/src", + "executors": { + "/nx-api/linter/executors/eslint": { + "description": "Run ESLint on a project.", + "file": "generated/packages/linter/executors/eslint.json", + "hidden": false, + "name": "eslint", + "originalFilePath": "/packages/eslint/src/executors/lint/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/eslint/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/eslint/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/eslint/src/generators/convert-to-flat-config/schema.json", + "path": "/nx-api/linter/generators/convert-to-flat-config", + "type": "generator" + } + }, + "path": "/nx-api/linter" + }, "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 701d8f6c1f3e1..56234c61572c6 100644 --- a/docs/generated/packages-metadata.json +++ b/docs/generated/packages-metadata.json @@ -643,6 +643,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/linter/executors/eslint.json", + "hidden": false, + "name": "eslint", + "originalFilePath": "/packages/eslint/src/executors/lint/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/eslint/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/eslint/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/eslint/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/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 aaa8998a457c7..6e8aae7bf9294 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/linter:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ diff --git a/docs/generated/packages/eslint-plugin/documents/overview.md b/docs/generated/packages/eslint-plugin/documents/overview.md index dcab3273d9a5e..751e5efbb12d1 100644 --- a/docs/generated/packages/eslint-plugin/documents/overview.md +++ b/docs/generated/packages/eslint-plugin/documents/overview.md @@ -1,4 +1,4 @@ -The `@nx/eslint-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as the following Nx-specific ESLint rules: +The `@nx/linter-plugin` package is an ESLint plugin that contains a collection of recommended ESLint rule configurations which you can extend from in your own ESLint configs, as well as the following Nx-specific ESLint rules: - [enforce-module-boundaries](#enforce-module-boundaries-rule) - [dependency-checks](#dependency-checks-rule) diff --git a/docs/generated/packages/linter/documents/overview.md b/docs/generated/packages/linter/documents/overview.md deleted file mode 100644 index f987ba1a7cb9c..0000000000000 --- 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/generated/packages/linter/executors/eslint.json b/docs/generated/packages/linter/executors/eslint.json index 82d84942d39d5..77173d5a0928b 100644 --- a/docs/generated/packages/linter/executors/eslint.json +++ b/docs/generated/packages/linter/executors/eslint.json @@ -1,6 +1,6 @@ { "name": "eslint", - "implementation": "/packages/linter/src/executors/eslint/lint.impl.ts", + "implementation": "/packages/eslint/src/executors/lint/lint.impl.ts", "schema": { "version": 2, "outputCapture": "direct-nodejs", @@ -139,10 +139,10 @@ "examplesFile": "Linter can be configured in multiple ways. The basic way is to provide only `lintFilePatterns`, which is a mandatory property. This tells us where to look for files to lint.\n\n`project.json`:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\n## Examples\n\n{% tabs %}\n{% tab label=\"Fixing linter issues\" %}\n\nLinter provides an automated way of fixing known issues. To ensure that those changes are properly cached, we need to add an `outputs` property to the `lint` target. Omitting the `outputs` property would produce an invalid cache record. Both of these properties are set by default when scaffolding a new project.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"]\n }\n}\n```\n\nWith these settings, we can run the command with a `--fix` flag:\n\n```bash\nnx run frontend:lint --fix\n```\n\nWe can also set this flag via project configuration to always fix files when running lint:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"fix\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Custom output format\" %}\n\nESLint executor uses the `stylish` output format by default. You can change this by specifying the `format` property:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"format\": \"compact\"\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Silence warnings\" %}\n\nMigrated or legacy projects tend to have an overwhelming amount of lint errors. We might want to change those temporarily to be warnings so they don't block the development. But they would still clutter the report. We can run the command with `--quiet` to hide warning (errors would still break the lint):\n\n```bash\nnx run frontend:lint --quiet\n```\n\nWe can also set this via project configuration as a default option.\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"quiet\": true\n }\n}\n```\n\n{% /tab %}\n{% tab label=\"Flat Config file\" %}\n\n`ESLint` provides several ways of specifying the configuration. The default one is using `.eslintrc.json` but you can override it by setting the `eslintConfig` flag. The new `Flat Config` is now also supported:\n\n```json\n\"lint\": {\n \"executor\": \"@nx/linter:eslint\",\n \"outputs\": [\"{options.outputFile}\"],\n \"options\": {\n \"lintFilePatterns\": [\"apps/frontend/**/*.ts\"],\n \"eslintConfig\": \"eslint.config.js\"\n }\n}\n```\n\n**Note:** In contrast to other configuration formats, the `Flat Config` requires that all configuration files are converted to `eslint.config.js`. Built-in migrations and generators support only `.eslintrc.json` at the moment.\n\n{% /tab %}\n{% /tabs %}\n\n---\n", "presets": [] }, - "hasher": "./src/executors/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/linter/generators/convert-to-flat-config.json index 0bbddebb1d165..0658338d09861 100644 --- a/docs/generated/packages/linter/generators/convert-to-flat-config.json +++ b/docs/generated/packages/linter/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/linter/generators/workspace-rule.json index e80e3eff5dd16..10e513eb0a64b 100644 --- a/docs/generated/packages/linter/generators/workspace-rule.json +++ b/docs/generated/packages/linter/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/linter/generators/workspace-rules-project.json index 571bb3c5802da..ae89e0913ce94 100644 --- a/docs/generated/packages/linter/generators/workspace-rules-project.json +++ b/docs/generated/packages/linter/generators/workspace-rules-project.json @@ -10,7 +10,7 @@ "type": "object", "examples": [ { - "command": "nx g @nx/linter:workspace-rules-project", + "command": "nx g @nx/eslint:workspace-rules-project", "description": "Create the Workspace Lint Rules Project" } ], @@ -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/shared/angular-standalone-tutorial/3-task-running.md b/docs/shared/angular-standalone-tutorial/3-task-running.md index 8f2f7d9b7f119..89126ea47f712 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 580479c42e97f..84e5c4c0375a5 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 0ff128d3c7dde..39ca6e52ea4a7 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 961477fdcc6a3..d75c660bb5a62 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 aaa8998a457c7..1a571d8a4dd5d 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/packages/linter/linter-plugin.md b/docs/shared/packages/linter/linter-plugin.md index f987ba1a7cb9c..c8f105fff55f3 100644 --- a/docs/shared/packages/linter/linter-plugin.md +++ b/docs/shared/packages/linter/linter-plugin.md @@ -5,17 +5,17 @@ The Linter plugin contains executors, generator, plugin and utilities used for l ### 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). +Make sure to install the `@nx/eslint` version that matches the version of `nx` in your repository. If the version numbers get out of sync, you can encounter some difficult to debug errors. You can [fix Nx version mismatches with this recipe](/recipes/tips-n-tricks/keep-nx-versions-in-sync). {% /callout %} -In any Nx workspace, you can install `@nx/linter` by running the following commands if `@nx/linter` package is not installed: +In any Nx workspace, you can install `@nx/eslint` by running the following commands if `@nx/eslint` package is not installed: ```shell -npm i --save-dev @nx/linter +npm i --save-dev @nx/eslint ``` ```shell -yarn add --dev @nx/linter +yarn add --dev @nx/eslint ``` ## Lint diff --git a/docs/shared/recipes/reduce-repetitive-configuration.md b/docs/shared/recipes/reduce-repetitive-configuration.md index 2320a401b9a1e..4aa70664e4e9e 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/rescope.md b/docs/shared/recipes/rescope.md index a4c3b18a0f548..5813786f37b55 100644 --- a/docs/shared/recipes/rescope.md +++ b/docs/shared/recipes/rescope.md @@ -26,11 +26,15 @@ The following packages were not simply rescoped `@nrwl` to `@nx`. | @nrwl/eslint-plugin-nx | @nx/eslint-plugin | | @nrwl/nx-plugin | @nx/plugin | +| Nx 15 and lower | Nx 16 | Nx 17 | +| --------------- | ---------- | ---------- | +| @nrwl/linter | @nx/linter | @nx/eslint | + ### Rescope Only All other packages keep the same name, but change scope from `@nrwl` to `@nx`. -| Nx 15 and lower | Nx 16 and higher | +| Nx 15 and lower | Nx 16 | | ------------------ | ---------------- | | @nrwl/angular | @nx/angular | | @nrwl/aws-lambda | @nx/aws-lambda | @@ -44,7 +48,6 @@ All other packages keep the same name, but change scope from `@nrwl` to `@nx`. | @nrwl/gatsby | @nx/gatsby | | @nrwl/jest | @nx/jest | | @nrwl/js | @nx/js | -| @nrwl/linter | @nx/linter | | @nrwl/nest | @nx/nest | | @nrwl/netlify | @nx/netlify | | @nrwl/next | @nx/next | 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 641f4332a187a..f9e9adb84e250 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,14 +156,14 @@ 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/lint:eslint](/nx-api/linter/executors/eslint) executor and `@nx/*` generators, and provides an automated config conversion from `.eslintrc.json` config files. ## Converting workspace from .eslintrc.json to flat config To convert workspace ESLint configurations from the default `.eslintrc.json` to the new flat config you need to run: ```shell - nx g @nx/linter:convert-to-flat-config + nx g @nx/eslint:convert-to-flat-config ``` The generator will go through all the projects and convert their configurations to the new format. It will also convert the base `.eslintrc.json` and `.eslintignore`. diff --git a/docs/shared/reference/sitemap.md b/docs/shared/reference/sitemap.md index d993c6e4b3ca5..ed15552c49b96 100644 --- a/docs/shared/reference/sitemap.md +++ b/docs/shared/reference/sitemap.md @@ -373,6 +373,13 @@ - [generators](/nx-api/esbuild/generators) - [init](/nx-api/esbuild/generators/init) - [configuration](/nx-api/esbuild/generators/configuration) + - [linter](/nx-api/linter) + - [executors](/nx-api/linter/executors) + - [eslint](/nx-api/linter/executors/eslint) + - [generators](/nx-api/linter/generators) + - [workspace-rules-project](/nx-api/linter/generators/workspace-rules-project) + - [workspace-rule](/nx-api/linter/generators/workspace-rule) + - [convert-to-flat-config](/nx-api/linter/generators/convert-to-flat-config) - [eslint-plugin](/nx-api/eslint-plugin) - [documents](/nx-api/eslint-plugin/documents) - [Overview](/nx-api/eslint-plugin/documents/overview) @@ -428,15 +435,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 663bd42631fe0..b64a5fa307fda 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 cb6433b88ab33..33733d6ed2785 100644 --- a/e2e/angular-core/src/ng-add.test.ts +++ b/e2e/angular-core/src/ng-add.test.ts @@ -407,7 +407,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 95190f4488706..d04ab1546a328 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 7b61e586005dc..b9e741dac4215 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 99% rename from e2e/linter/src/linter.test.ts rename to e2e/eslint/src/linter.test.ts index 719cbdb424457..1df212e0ec286 100644 --- a/e2e/linter/src/linter.test.ts +++ b/e2e/eslint/src/linter.test.ts @@ -153,7 +153,7 @@ describe('Linter', () => { // Generate a new rule (should also scaffold the required workspace project and tests) const newRuleName = 'e2e-test-rule-name'; - runCLI(`generate @nx/linter:workspace-rule ${newRuleName}`); + runCLI(`generate @nx/eslint:workspace-rule ${newRuleName}`); // Ensure that the unit tests for the new rule are runnable const unitTestsOutput = runCLI(`test eslint-rules`); @@ -563,7 +563,7 @@ describe('Linter', () => { ); // migrate to flat structure - runCLI(`generate @nx/linter:convert-to-flat-config`); + runCLI(`generate @nx/eslint:convert-to-flat-config`); checkFilesExist( 'eslint.config.js', `apps/${myapp}/eslint.config.js`, @@ -596,7 +596,7 @@ describe('Linter', () => { runCLI(`generate @nx/js:lib ${mylib}`); // migrate to flat structure - runCLI(`generate @nx/linter:convert-to-flat-config`); + runCLI(`generate @nx/eslint:convert-to-flat-config`); checkFilesExist( 'eslint.config.js', `${mylib}/eslint.config.js`, 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/e2e/utils/create-project-utils.ts b/e2e/utils/create-project-utils.ts index b60e256e23e66..efcec24270566 100644 --- a/e2e/utils/create-project-utils.ts +++ b/e2e/utils/create-project-utils.ts @@ -77,7 +77,7 @@ export function newProject({ `@nx/esbuild`, `@nx/jest`, `@nx/js`, - `@nx/linter`, + `@nx/eslint`, `@nx/nest`, `@nx/next`, `@nx/node`, diff --git a/nx-dev/nx-dev-e2e/src/packages.spec.ts b/nx-dev/nx-dev-e2e/src/packages.spec.ts index af89b984bdeb5..bbb634455f0b8 100644 --- a/nx-dev/nx-dev-e2e/src/packages.spec.ts +++ b/nx-dev/nx-dev-e2e/src/packages.spec.ts @@ -169,7 +169,7 @@ 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/linter', path: '/packages/eslint' }, { title: '@nx/linter:workspace-rules-project', path: '/packages/linter/generators/workspace-rules-project', diff --git a/nx-dev/nx-dev/redirect-rules.js b/nx-dev/nx-dev/redirect-rules.js index bedbe912c3bc9..a7bd264d311d4 100644 --- a/nx-dev/nx-dev/redirect-rules.js +++ b/nx-dev/nx-dev/redirect-rules.js @@ -86,9 +86,8 @@ const schemaUrls = { '/storybook/executors-storybook': '/packages/storybook/executors/storybook', '/storybook/extra-topics-for-angular-projects': '/storybook/overview-angular#more-documentation', - '/linter/eslint': '/packages/linter/executors/eslint', - '/linter/lint': '/packages/linter/executors/lint', - '/linter/workspace-rule': '/packages/linter/generators/workspace-rule', + '/linter/eslint': '/packages/eslint/executors/lint', + '/linter/workspace-rule': '/packages/eslint/generators/workspace-rule', '/node/application': '/packages/node/generators/application', '/node/library': '/packages/node/generators/library', '/node/webpack': '/packages/node/executors/webpack', @@ -307,7 +306,7 @@ const overviewUrls = { '/react/overview': '/packages/react', '/jest/overview': '/packages/jest', '/cypress/overview': '/packages/cypress', - '/linter/overview': '/packages/linter', + '/linter/overview': '/packages/eslint', '/node/overview': '/packages/node', '/express/overview': '/packages/express', '/nest/overview': '/packages/nest', @@ -540,7 +539,7 @@ const packagesIndexes = { '/express': '/packages/express', '/jest': '/packages/jest', '/js': '/packages/js', - '/linter': '/packages/linter', + '/linter': '/packages/eslint', '/nest': '/packages/nest', '/next': '/packages/next', '/node': '/packages/node', @@ -645,7 +644,7 @@ const packagesDocuments = { '/deprecated/storybook/upgrade-storybook-v6-react', '/packages/storybook/documents/migrate-storybook-7': '/packages/storybook/generators/migrate-7', - '/linter/eslint-plugin-nx': '/packages/linter/documents/eslint-plugin-nx', + '/linter/eslint-plugin-nx': '/packages/eslint/documents/eslint-plugin-nx', '/packages/add-nx-to-monorepo': '/packages/nx/documents/init', '/packages/cra-to-nx': '/packages/nx/documents/init', '/packages/make-angular-cli-faster': '/packages/nx/documents/init', @@ -895,6 +894,14 @@ const aiChat = { '/ai': '/ai-chat', }; +// rename nx/linter to eslint +// TODO(v17) invert these redirects +const eslintRename = { + '/nx-api/eslint': '/nx-api/linter', + '/packages/eslint': '/packages/linter', + '/nx-api/eslint/executors/lint': '/nx-api/linter/executors/eslint', +}; + /** * Public export API */ @@ -921,4 +928,5 @@ module.exports = { latestRecipesRefactoring, coreFeatureRefactoring, aiChat, + eslintRename, }; diff --git a/nx-dev/ui-home/src/lib/extensible-and-integrated/plugins-tab.tsx b/nx-dev/ui-home/src/lib/extensible-and-integrated/plugins-tab.tsx index fc024d992ef1e..1708a84187e76 100644 --- a/nx-dev/ui-home/src/lib/extensible-and-integrated/plugins-tab.tsx +++ b/nx-dev/ui-home/src/lib/extensible-and-integrated/plugins-tab.tsx @@ -239,7 +239,7 @@ export function PluginsTab(): JSX.Element { Installed plugins:

@nx/js (executors,generators)
- @nx/linter (executors,generators)
+ @nx/eslint (executors,generators)
@nx/next (executors,generators)

diff --git a/nx-dev/ui-references/src/lib/icons-map.ts b/nx-dev/ui-references/src/lib/icons-map.ts index 0827c58c2822e..a54170d5361b7 100644 --- a/nx-dev/ui-references/src/lib/icons-map.ts +++ b/nx-dev/ui-references/src/lib/icons-map.ts @@ -10,7 +10,7 @@ export const iconsMap: Record = { express: '/images/icons/express.svg', jest: '/images/icons/jest.svg', js: '/images/icons/javascript.svg', - linter: '/images/icons/eslint.svg', + eslint: '/images/icons/eslint.svg', 'module-federation': '/images/icons/module-federation.svg', nest: '/images/icons/nestjs.svg', next: '/images/icons/nextdotjs.svg', diff --git a/packages-legacy/linter-nx/README.md b/packages-legacy/linter-nx/README.md new file mode 100644 index 0000000000000..9d5d0bd34d1c5 --- /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 0000000000000..82ea0a29287b7 --- /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 0000000000000..0ff8e21d46272 --- /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 0000000000000..e320f1b0c99aa --- /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 0000000000000..f902d3ea2a1fc --- /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 0000000000000..4c6533fa9717d --- /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 0000000000000..133314b126cff --- /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 ba70860fa5761..82ea0a29287b7 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 331f10e4586c6..0ff8e21d46272 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 ef67cd24cb9b4..e320f1b0c99aa 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 c920961a36145..ef0ca3de89597 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 b961e9a140b59..d6891825bb9ce 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 e2f0af305d566..0d11748b7f895 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 b23fa88464c68..f298773d34dad 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 1500a0007b94c..fc531abe75933 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/add-linting/lib/create-eslint-configuration.ts b/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts index eed5f8f3ad672..cbf93ac02ea54 100644 --- a/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts +++ b/packages/angular/src/generators/add-linting/lib/create-eslint-configuration.ts @@ -9,7 +9,7 @@ type EslintExtensionSchema = { }; /** - * @deprecated Use tools from `@nx/linter/src/generators/utils/eslint-file` instead + * @deprecated Use tools from `@nx/eslint/src/generators/utils/eslint-file` instead */ export const extendAngularEslintJson = ( json: Linter.Config, diff --git a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap index f465f87b27ae6..f0bf73bb2bbb0 100644 --- a/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/angular/src/generators/application/__snapshots__/application.spec.ts.snap @@ -272,7 +272,7 @@ exports[`app --project-name-and-root-format=derived should generate correctly wh }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/my-dir/my-app/**/*.ts", @@ -350,7 +350,7 @@ exports[`app --project-name-and-root-format=derived should generate correctly wh }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/my-dir/my-app-e2e/**/*.{js,ts}", @@ -512,7 +512,7 @@ exports[`app --project-name-and-root-format=derived should generate correctly wh }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/my-app/**/*.ts", @@ -590,7 +590,7 @@ exports[`app --project-name-and-root-format=derived should generate correctly wh }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "apps/my-app-e2e/**/*.{js,ts}", @@ -963,7 +963,7 @@ exports[`app nested should create project configs 1`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-dir/my-app/**/*.ts", @@ -1041,7 +1041,7 @@ exports[`app nested should create project configs 2`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-dir/my-app-e2e/**/*.{js,ts}", @@ -1121,7 +1121,7 @@ exports[`app not nested should create project configs 1`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app/**/*.ts", @@ -1199,7 +1199,7 @@ exports[`app not nested should create project configs 2`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", diff --git a/packages/angular/src/generators/application/application.spec.ts b/packages/angular/src/generators/application/application.spec.ts index 299f297ef7fb3..cd2dd979c5502 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 f1ff025624e86..8f6983f0aae1f 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 04b9b9eeddaab..d3e481b744a84 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 5eb30bdb724e3..dbfd8f83fa740 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 c13a0ec15825a..cdb84fd5f505a 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/__snapshots__/component-test.spec.ts.snap b/packages/angular/src/generators/component-test/__snapshots__/component-test.spec.ts.snap index a97fea5bfc370..254127ac2925d 100644 --- a/packages/angular/src/generators/component-test/__snapshots__/component-test.spec.ts.snap +++ b/packages/angular/src/generators/component-test/__snapshots__/component-test.spec.ts.snap @@ -8,11 +8,11 @@ describe(MyLibComponent.name, () => { beforeEach(() => { TestBed.overrideComponent(MyLibComponent, { - add: { + add: { imports: [], providers: [] } - }) + }) }) it('renders', () => { @@ -38,11 +38,11 @@ describe(MyLibComponent.name, () => { beforeEach(() => { TestBed.overrideComponent(MyLibComponent, { - add: { + add: { imports: [], providers: [] } - }) + }) }) it('renders', () => { @@ -61,11 +61,11 @@ describe(MyLibComponent.name, () => { beforeEach(() => { TestBed.overrideComponent(MyLibComponent, { - add: { + add: { imports: [], providers: [] } - }) + }) }) it('renders', () => { 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 cfaf435717298..08e6998a9bb21 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/component-test/files/__componentFileName__.cy.ts__tpl__ b/packages/angular/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ index 1aa79b4ca2224..71f3c2f3d9c3f 100644 --- a/packages/angular/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ +++ b/packages/angular/src/generators/component-test/files/__componentFileName__.cy.ts__tpl__ @@ -5,11 +5,11 @@ describe(<%= componentName %>.name, () => { beforeEach(() => { TestBed.overrideComponent(<%= componentName %>, { - add: { + add: { imports: [], providers: [] } - }) + }) }) it('renders', () => { diff --git a/packages/angular/src/generators/federate-module/federate-module.spec.ts b/packages/angular/src/generators/federate-module/federate-module.spec.ts index 3180291799c15..b9912463850c1 100644 --- a/packages/angular/src/generators/federate-module/federate-module.spec.ts +++ b/packages/angular/src/generators/federate-module/federate-module.spec.ts @@ -1,9 +1,9 @@ -import { getProjects, Tree } from '@nx/devkit'; +import { getProjects } from '@nx/devkit'; 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 remoteGenerator from '../remote/remote'; import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners'; diff --git a/packages/angular/src/generators/host/schema.d.ts b/packages/angular/src/generators/host/schema.d.ts index 4e77dceaabcf4..ed2193a5e2549 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 dfc3ea4a2a90e..47babcef7a8a4 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 100847d840ffe..d8a34f1e9bd75 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 3c0cacfbb1cd7..1530d8691d70e 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 9fb8c6fa82171..583438f99afec 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 920652d5ce2c5..5524bc66ae996 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 aa17cb797cada..7670aaf6b9d5d 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 7a70d7a56232b..3d96504c33cde 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 a5398670d6b30..242fd8e48ef57 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 1212117148239..ec73ac120e4fb 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 eabbd9808c5d9..92672d179ff60 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 92970b3b3fda4..93c0d0deedc41 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 4f39e9bdedd0e..c180bb46dab47 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 ad221f9b80625..302520deb51ad 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 457bc2c0d1019..c8b70ab4f93bb 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 94a7603befb04..1248088cf799f 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 a1fe31e6f2f94..9f294fd2c75bd 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 517f376627a05..e474621e9a819 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/storybook-configuration/storybook-configuration.spec.ts b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts index 9564540748a4b..86ea613c709f3 100644 --- a/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts +++ b/packages/angular/src/generators/storybook-configuration/storybook-configuration.spec.ts @@ -1,7 +1,7 @@ import { installedCypressVersion } from '@nx/cypress/src/utils/cypress-version'; import type { Tree } from '@nx/devkit'; import { writeJson } from '@nx/devkit'; -import { Linter } from 'packages/linter/src/generators/utils/linter'; +import { Linter } from '@nx/eslint/src/generators/utils/linter'; import { componentGenerator } from '../component/component'; import { librarySecondaryEntryPointGenerator } from '../library-secondary-entry-point/library-secondary-entry-point'; import { createStorybookTestWorkspaceForLib } from '../utils/testing'; diff --git a/packages/angular/src/generators/storybook-configuration/storybook-utilities.spec.ts b/packages/angular/src/generators/storybook-configuration/storybook-utilities.spec.ts index 5b42d24f0c624..ee1e0cc2ac8f7 100644 --- a/packages/angular/src/generators/storybook-configuration/storybook-utilities.spec.ts +++ b/packages/angular/src/generators/storybook-configuration/storybook-utilities.spec.ts @@ -9,7 +9,7 @@ import * as targetVariations from '@nx/storybook/src/utils/test-configs/differen import libraryGenerator from '../library/library'; import componentGenerator from '../component/component'; import storybookConfigurationGenerator from '../storybook-configuration/storybook-configuration'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; // nested code imports graph from the repo, which might have innacurate graph version jest.mock('nx/src/project-graph/project-graph', () => ({ @@ -75,13 +75,13 @@ describe('testing utilities', () => { ` import type { Meta } from '@storybook/react'; import { Button } from './button'; - + const Story: Meta = { component: Button, title: 'Layout/Texts/Button', }; export default Story; - + export const Primary = { args: {}, }; diff --git a/packages/angular/src/generators/utils/testing.ts b/packages/angular/src/generators/utils/testing.ts index a7574681990cc..45cae6efd45da 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 82310de6cc385..ab61b22396e79 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 7973c4c922647..9c226839b86d5 100644 --- a/packages/cypress/src/generators/configuration/configuration.ts +++ b/packages/cypress/src/generators/configuration/configuration.ts @@ -14,7 +14,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/__snapshots__/cypress-project.spec.ts.snap b/packages/cypress/src/generators/cypress-project/__snapshots__/cypress-project.spec.ts.snap index b835d0e29afe7..1a049b8af058c 100644 --- a/packages/cypress/src/generators/cypress-project/__snapshots__/cypress-project.spec.ts.snap +++ b/packages/cypress/src/generators/cypress-project/__snapshots__/cypress-project.spec.ts.snap @@ -49,7 +49,7 @@ exports[`Cypress Project < v7 nested should update configuration 1`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-dir/my-app-e2e/**/*.{js,ts}", @@ -95,7 +95,7 @@ exports[`Cypress Project < v7 project with directory in its name should update c }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-dir/my-app-e2e/**/*.{js,ts}", @@ -120,7 +120,7 @@ exports[`Cypress Project < v7 should update project configuration (baseUrl) 1`] }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", @@ -150,7 +150,7 @@ exports[`Cypress Project < v7 should update project configuration 1`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", @@ -180,7 +180,7 @@ exports[`Cypress Project < v7 should update target configurations 1`] = ` }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", @@ -267,7 +267,7 @@ exports[`Cypress Project > v10 should set right path names in \`tsconfig.e2e.jso exports[`Cypress Project > v10 should update configuration when eslint is passed 1`] = ` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-app-e2e/**/*.{js,ts}", 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 590939d292ee3..52e24948b9dd2 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 7fd389de55943..c5a54bdc9ce53 100644 --- a/packages/cypress/src/generators/cypress-project/cypress-project.ts +++ b/packages/cypress/src/generators/cypress-project/cypress-project.ts @@ -19,7 +19,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 8d480818e407b..6abafe7f11c3e 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/generators/migrate-to-cypress-11/__snapshots__/migrate-to-cypress-11.spec.ts.snap b/packages/cypress/src/generators/migrate-to-cypress-11/__snapshots__/migrate-to-cypress-11.spec.ts.snap index bb695109dc3f5..b8843b9698a9c 100644 --- a/packages/cypress/src/generators/migrate-to-cypress-11/__snapshots__/migrate-to-cypress-11.spec.ts.snap +++ b/packages/cypress/src/generators/migrate-to-cypress-11/__snapshots__/migrate-to-cypress-11.spec.ts.snap @@ -181,7 +181,7 @@ exports[`convertToCypressTen convertCypressProject should infer targets with --a }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "app-e2e/**/*.{js,ts}", @@ -246,7 +246,7 @@ exports[`convertToCypressTen convertCypressProject should not break when an inva }, }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "app-e2e/**/*.{js,ts}", diff --git a/packages/cypress/src/utils/add-linter.ts b/packages/cypress/src/utils/add-linter.ts index 7f333f7b5c96d..add4b4d513a3b 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 fcc63ca1dc80b..6e9cb27b973bb 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/application.spec.ts b/packages/detox/src/generators/application/application.spec.ts index 93570aebf33a8..d6c2fb4fc6008 100644 --- a/packages/detox/src/generators/application/application.spec.ts +++ b/packages/detox/src/generators/application/application.spec.ts @@ -5,7 +5,7 @@ import { Tree, } from '@nx/devkit'; import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Linter } from 'packages/linter/src/generators/utils/linter'; +import { Linter } from '@nx/eslint/src/generators/utils/linter'; import detoxApplicationGenerator from './application'; 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 c2658f764c098..80653dd5d6279 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 180ecc0d7f124..2f4235741403c 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 17032dfb560ed..989e0c763aafd 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 d6b13ae193fd2..603a02f6f4fdc 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 55a95f0c15adc..50f8d36fa57f2 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 2fa7b27118db4..81bddc9df49b6 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 100% rename from packages/linter/docs/eslint-examples.md rename to packages/eslint/docs/eslint-examples.md 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 0000000000000..95b4499d2631b --- /dev/null +++ b/packages/eslint/executors.json @@ -0,0 +1,10 @@ +{ + "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 97% rename from packages/linter/generators.json rename to packages/eslint/generators.json index dde511249dbad..ef3e328ff19c7 100644 --- a/packages/linter/generators.json +++ b/packages/eslint/generators.json @@ -1,5 +1,5 @@ { - "name": "nx/linter", + "name": "nx/eslint", "version": "0.1", "generators": { "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 46439d120412c..6d96077a6428f 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 283d0b3928810..d666bd199e136 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 88% rename from packages/linter/package.json rename to packages/eslint/package.json index 962a62047e708..1d592af1d982d 100644 --- a/packages/linter/package.json +++ b/packages/eslint/package.json @@ -1,12 +1,12 @@ { - "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", - "directory": "packages/linter" + "directory": "packages/eslint" }, "keywords": [ "Monorepo", 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 283dda3fbf766..0eae5d6432500 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 @nx/linter @nrwl/linter" }, "lint": {} }, 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 8047e18cf76ee..09d24233d2fe9 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 93% rename from packages/linter/src/generators/init/__snapshots__/init.spec.ts.snap rename to packages/eslint/src/generators/init/__snapshots__/init.spec.ts.snap index d44db176e7af7..5ffca0bd965ff 100644 --- a/packages/linter/src/generators/init/__snapshots__/init.spec.ts.snap +++ b/packages/eslint/src/generators/init/__snapshots__/init.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`@nx/linter:init --linter eslint should generate the global eslint config 1`] = ` +exports[`@nx/eslint:init --linter eslint should generate the global eslint config 1`] = ` "{ "root": true, "ignorePatterns": [ 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 1e41d3fa5883b..918d54023ed7d 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 4bc20d56a5616..95f5a44d53a4c 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 03e889b71bd8e..521b2e3da77b9 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 d384900cacbd5..e2184561466db 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 dd631df918753..bdac4b251696b 100644 --- a/packages/linter/src/generators/lint-project/lint-project.ts +++ b/packages/eslint/src/generators/lint-project/lint-project.ts @@ -77,7 +77,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 0556f3c56a257..12c4eb7160215 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 c7a9fa91edb37..bfe9ba4aa36a5 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 91% 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 index af1a6ab027f52..da178f1e17fb6 100644 --- 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 @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`@nx/linter:workspace-rule --dir should support creating the rule in a nested directory 1`] = ` +exports[`@nx/eslint:workspace-rule --dir should support creating the rule in a nested directory 1`] = ` "/** * This file sets you up with structure needed for an ESLint rule. * @@ -41,7 +41,7 @@ export const rule = ESLintUtils.RuleCreator(() => __filename)({ " `; -exports[`@nx/linter:workspace-rule --dir should support creating the rule in a nested directory 2`] = ` +exports[`@nx/eslint:workspace-rule --dir should support creating the rule in a nested directory 2`] = ` "import { TSESLint } from '@typescript-eslint/utils'; import { rule, RULE_NAME } from './another-rule'; @@ -56,7 +56,7 @@ ruleTester.run(RULE_NAME, rule, { " `; -exports[`@nx/linter:workspace-rule --dir should support creating the rule in a nested directory with multiple levels of nesting 1`] = ` +exports[`@nx/eslint:workspace-rule --dir should support creating the rule in a nested directory with multiple levels of nesting 1`] = ` "/** * This file sets you up with structure needed for an ESLint rule. * @@ -97,7 +97,7 @@ export const rule = ESLintUtils.RuleCreator(() => __filename)({ " `; -exports[`@nx/linter:workspace-rule --dir should support creating the rule in a nested directory with multiple levels of nesting 2`] = ` +exports[`@nx/eslint:workspace-rule --dir should support creating the rule in a nested directory with multiple levels of nesting 2`] = ` "import { TSESLint } from '@typescript-eslint/utils'; import { rule, RULE_NAME } from './one-more-rule'; @@ -112,7 +112,7 @@ ruleTester.run(RULE_NAME, rule, { " `; -exports[`@nx/linter:workspace-rule should generate the required files 1`] = ` +exports[`@nx/eslint:workspace-rule should generate the required files 1`] = ` "/** * This file sets you up with structure needed for an ESLint rule. * @@ -153,7 +153,7 @@ export const rule = ESLintUtils.RuleCreator(() => __filename)({ " `; -exports[`@nx/linter:workspace-rule should generate the required files 2`] = ` +exports[`@nx/eslint:workspace-rule should generate the required files 2`] = ` "import { TSESLint } from '@typescript-eslint/utils'; import { rule, RULE_NAME } from './my-rule'; @@ -168,7 +168,7 @@ ruleTester.run(RULE_NAME, rule, { " `; -exports[`@nx/linter:workspace-rule should update the plugin index.ts with the new rule 1`] = ` +exports[`@nx/eslint:workspace-rule should update the plugin index.ts with the new rule 1`] = ` "import { RULE_NAME as myRuleName, rule as myRule } from './rules/my-rule'; /** * Import your custom workspace rules at the top of this file. @@ -181,7 +181,7 @@ exports[`@nx/linter:workspace-rule should update the plugin index.ts with the ne * following generator command and provide your desired rule name: * * \`\`\`sh - * npx nx g @nx/linter:workspace-rule {{ NEW_RULE_NAME }} + * npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }} * \`\`\` */ 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 97% 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 ee4875fe82212..110ba3783cfaa 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 () => { @@ -66,7 +66,7 @@ describe('@nx/linter:workspace-rule', () => { * following generator command and provide your desired rule name: * * \`\`\`sh - * npx nx g @nx/linter:workspace-rule {{ NEW_RULE_NAME }} + * npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }} * \`\`\` */ 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 82% 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 index 5eeef76a58bb3..d391e2f6eec17 100644 --- 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 @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`@nx/linter:workspace-rules-project should generate the required files 1`] = ` +exports[`@nx/eslint:workspace-rules-project should generate the required files 1`] = ` "/** * Import your custom workspace rules at the top of this file. * @@ -12,7 +12,7 @@ exports[`@nx/linter:workspace-rules-project should generate the required files 1 * following generator command and provide your desired rule name: * * \`\`\`sh - * npx nx g @nx/linter:workspace-rule {{ NEW_RULE_NAME }} + * npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }} * \`\`\` */ @@ -31,7 +31,7 @@ module.exports = { " `; -exports[`@nx/linter:workspace-rules-project should generate the required files 2`] = ` +exports[`@nx/eslint:workspace-rules-project should generate the required files 2`] = ` "{ "extends": "../../tsconfig.base.json", "compilerOptions": { @@ -51,7 +51,7 @@ exports[`@nx/linter:workspace-rules-project should generate the required files 2 " `; -exports[`@nx/linter:workspace-rules-project should generate the required files 3`] = ` +exports[`@nx/eslint:workspace-rules-project should generate the required files 3`] = ` "{ "extends": "./tsconfig.json", "compilerOptions": { @@ -64,7 +64,7 @@ exports[`@nx/linter:workspace-rules-project should generate the required files 3 " `; -exports[`@nx/linter:workspace-rules-project should generate the required files 4`] = ` +exports[`@nx/eslint:workspace-rules-project should generate the required files 4`] = ` "{ "extends": "./tsconfig.json", "compilerOptions": { @@ -77,7 +77,7 @@ exports[`@nx/linter:workspace-rules-project should generate the required files 4 " `; -exports[`@nx/linter:workspace-rules-project should generate the required files 5`] = ` +exports[`@nx/eslint:workspace-rules-project should generate the required files 5`] = ` "/* eslint-disable */ export default { displayName: 'eslint-rules', 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 90% 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__ index 192a7d8448526..2d4a622c2077e 100644 --- a/packages/linter/src/generators/workspace-rules-project/files/index.ts__tmpl__ +++ b/packages/eslint/src/generators/workspace-rules-project/files/index.ts__tmpl__ @@ -9,7 +9,7 @@ * following generator command and provide your desired rule name: * * ```sh - * npx nx g @nx/linter:workspace-rule {{ NEW_RULE_NAME }} + * npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }} * ``` */ 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 89% rename from packages/linter/src/generators/workspace-rules-project/schema.json rename to packages/eslint/src/generators/workspace-rules-project/schema.json index 1b64f43a4de13..32f2d6fd91bb8 100644 --- a/packages/linter/src/generators/workspace-rules-project/schema.json +++ b/packages/eslint/src/generators/workspace-rules-project/schema.json @@ -7,7 +7,7 @@ "type": "object", "examples": [ { - "command": "nx g @nx/linter:workspace-rules-project", + "command": "nx g @nx/eslint:workspace-rules-project", "description": "Create the Workspace Lint Rules Project" } ], 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 5525eacc6bd38..9368d0e328910 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-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 100% 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 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 100% 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 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/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.spec.ts b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.spec.ts new file mode 100644 index 0000000000000..b3a05ec241b24 --- /dev/null +++ b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.spec.ts @@ -0,0 +1,75 @@ +import { + Tree, + addProjectConfiguration, + readJson, + updateJson, +} from '@nx/devkit'; +import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; +import replacePackage from './update-17-0-0-rename-to-eslint'; + +describe('update-17-0-0-rename-to-eslint', () => { + let tree: Tree; + beforeEach(() => { + tree = createTreeWithEmptyWorkspace(); + + updateJson(tree, 'package.json', (json) => { + json.devDependencies['@nx/linter'] = '17.0.0'; + return json; + }); + + updateJson(tree, 'nx.json', (json) => { + json.targetDefaults = { + lint: { + executor: '@nx/linter:eslint', + }, + }; + return json; + }); + }); + + it('should remove the dependency on @nx/linter', async () => { + await replacePackage(tree); + + expect( + readJson(tree, 'package.json').dependencies['@nx/linter'] + ).not.toBeDefined(); + expect( + readJson(tree, 'package.json').devDependencies['@nx/linter'] + ).not.toBeDefined(); + }); + + it('should add a dependency on @nx/eslint', async () => { + await replacePackage(tree); + + const packageJson = readJson(tree, 'package.json'); + const newDependencyVersion = + packageJson.devDependencies['@nx/eslint'] ?? + packageJson.dependencies['@nx/eslint']; + + expect(newDependencyVersion).toBeDefined(); + }); + + it('should update the targetDefaults', async () => { + await replacePackage(tree); + + const nxJson = readJson(tree, 'nx.json'); + expect(nxJson.targetDefaults.lint.executor).toEqual('@nx/eslint:lint'); + }); + + it('should update the target executor', async () => { + addProjectConfiguration(tree, 'test-lib', { + root: 'libs/test-lib', + projectType: 'library', + targets: { + lint: { + executor: '@nx/linter:eslint', + }, + }, + }); + + await replacePackage(tree); + + const projJson = readJson(tree, 'libs/test-lib/project.json'); + expect(projJson.targets.lint.executor).toEqual('@nx/eslint:lint'); + }); +}); diff --git a/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts new file mode 100644 index 0000000000000..b9dce789ba830 --- /dev/null +++ b/packages/eslint/src/migrations/update-17-0-0-rename-to-eslint/update-17-0-0-rename-to-eslint.ts @@ -0,0 +1,66 @@ +import { + NxJsonConfiguration, + Tree, + formatFiles, + getProjects, + readNxJson, + updateNxJson, + updateProjectConfiguration, +} from '@nx/devkit'; +import { replaceNrwlPackageWithNxPackage } from '@nx/devkit/src/utils/replace-package'; + +export default async function replacePackage(tree: Tree): Promise { + await replaceNrwlPackageWithNxPackage(tree, '@nx/linter', '@nx/eslint'); + + // executor name change from :eslint to :lint + updateNxJsonExecutor(tree); + updateProjectExecutor(tree); + + await formatFiles(tree); +} + +function updateNxJsonExecutor(tree: Tree) { + if (!tree.exists('nx.json')) { + return; + } + + const nxJson: NxJsonConfiguration = readNxJson(tree); + let needsUpdate = false; + + for (const [targetName, targetConfig] of Object.entries( + nxJson.targetDefaults ?? {} + )) { + if (targetConfig.executor !== '@nx/eslint:eslint') { + continue; + } + needsUpdate = true; + nxJson.targetDefaults[targetName].executor = '@nx/eslint:lint'; + } + + if (needsUpdate) { + updateNxJson(tree, nxJson); + } +} + +function updateProjectExecutor(tree: Tree) { + const projects = getProjects(tree); + + for (const [projectName, projectConfiguration] of projects) { + let needsUpdate = false; + + for (const [targetName, targetConfig] of Object.entries( + projectConfiguration.targets ?? {} + )) { + if (targetConfig.executor !== '@nx/eslint:eslint') { + continue; + } + + needsUpdate = true; + projectConfiguration.targets[targetName].executor = '@nx/eslint:lint'; + } + + if (needsUpdate) { + updateProjectConfiguration(tree, projectName, projectConfiguration); + } + } +} 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 dca29c2fa0af6..f1132c184d93c 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -38,7 +38,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 b19b193e5cd3e..02e79876e6a4d 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 93366950af185..ffe8be1c9de74 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 393b162a7c80d..780322fe777b2 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 f1529d67f17eb..549d7683ee454 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 17ae43f94ff73..8c291a5e0d920 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 9742eb061c51c..0664bc3749d0d 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 6407f8b80fd92..498a938462ecb 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 5d5d559b62ec2..7ca1407e85579 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 884f822776eb9..70ee6f3e2e078 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 cd27ca0d46d2a..9d46a2130fead 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 11b978cda9b38..676b4172061a3 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 7d5446b94dbad..95f2f048498b5 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 1f1c4092d3ca0..4f2d76b06ad56 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 b9488428ca106..8aa6483bb7ecc 100644 --- a/packages/js/src/generators/library/library.ts +++ b/packages/js/src/generators/library/library.ts @@ -243,10 +243,10 @@ export async function addLint( tree: Tree, options: AddLintOptions ): Promise { - const { lintProjectGenerator } = ensurePackage('@nx/linter', nxVersion); + const { lintProjectGenerator } = ensurePackage('@nx/eslint', nxVersion); const { mapLintPattern } = // nx-ignore-next-line - require('@nx/linter/src/generators/lint-project/lint-project'); + require('@nx/eslint/src/generators/lint-project/lint-project'); const projectConfiguration = readProjectConfiguration(tree, options.name); const task = lintProjectGenerator(tree, { project: options.name, @@ -272,7 +272,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)) { @@ -583,7 +583,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 f02915696d0df..c6ef695061f56 100644 --- a/packages/js/src/utils/schema.d.ts +++ b/packages/js/src/utils/schema.d.ts @@ -2,7 +2,7 @@ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project import type { AssetGlob, FileInputOutput } from './assets/assets'; import { TransformerEntry } from './typescript/types'; // 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 export type Compiler = 'tsc' | 'swc'; export type Bundler = 'swc' | 'tsc' | 'rollup' | 'vite' | 'esbuild' | 'none'; diff --git a/packages/linter/executors.json b/packages/linter/executors.json deleted file mode 100644 index ef774305dbbf1..0000000000000 --- a/packages/linter/executors.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "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 5f2fe8b66d79e..4323724313d93 100644 --- a/packages/nest/package.json +++ b/packages/nest/package.json @@ -33,7 +33,7 @@ "@nestjs/schematics": "^9.1.0", "@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", "tslib": "^2.3.0" diff --git a/packages/nest/project.json b/packages/nest/project.json index 098c84d405179..7a5ef344ef591 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 6116615458f14..3fee9ce4ff6bd 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 a0a18e5b19704..65ce8b821c58f 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/__snapshots__/library.spec.ts.snap b/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap index 1659a1618cac8..0027a19b0884e 100644 --- a/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/nest/src/generators/library/__snapshots__/library.spec.ts.snap @@ -53,7 +53,7 @@ exports[`lib --unit-test-runner none should not generate test configuration 1`] exports[`lib --unit-test-runner none should not generate test configuration 2`] = ` { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "my-lib/**/*.ts", diff --git a/packages/nest/src/generators/library/lib/normalize-options.ts b/packages/nest/src/generators/library/lib/normalize-options.ts index b7d515a97dd51..6c38f4e08612a 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 7b6a719bc9b08..7a78e0126fe64 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 0588a2bc93817..fdce605ff5c70 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 c4af16631c677..9da4307ea2ee3 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 0f3f1857f70d9..b68e011d4fc00 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 1ccc352791e22..61f0e62998902 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', () => { diff --git a/packages/next/src/generators/application/lib/add-linting.ts b/packages/next/src/generators/application/lib/add-linting.ts index 4ee945c296265..71ab2fa282844 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,8 +14,8 @@ import { addOverrideToLintConfig, isEslintConfigSupported, updateOverrideInLintConfig, -} from '@nx/linter/src/generators/utils/eslint-file'; -import { mapLintPattern } from '@nx/linter/src/generators/lint-project/lint-project'; +} from '@nx/eslint/src/generators/utils/eslint-file'; +import { mapLintPattern } from '@nx/eslint/src/generators/lint-project/lint-project'; 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 3c7238d8bd59e..d4b1850293e3d 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 08d8283ca904d..a83160ae6065d 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 4de4b892e4fce..2be24248203bc 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 547730e77dbca..e737f0992c589 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 b15bba233259b..d5ce9890f9d11 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 cd9a878e32075..b8992922e457e 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 ca0d398c6a587..08c05a2e0629b 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/node/package.json b/packages/node/package.json index fb042aca55f20..034d3f158324b 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" }, "publishConfig": { "access": "public" diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index 61dd038c57fff..4ab6e7ab8f85a 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 195fa6230e600..939ce5b14429c 100644 --- a/packages/node/src/generators/application/application.ts +++ b/packages/node/src/generators/application/application.ts @@ -23,8 +23,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 5f7de5dae1b58..a38e4ed97f85a 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 3acac02165a74..aa84f6ac95b7f 100644 --- a/packages/node/src/generators/e2e-project/e2e-project.ts +++ b/packages/node/src/generators/e2e-project/e2e-project.ts @@ -12,11 +12,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'; @@ -24,7 +24,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 a3e39f4a2bac9..57f5688f4b657 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 f277e7d848d58..4994e127b9382 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/nuxt/package.json b/packages/nuxt/package.json index 7d4fb2b170167..e53639262b7e2 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -33,7 +33,7 @@ "tslib": "^2.3.0", "@nx/devkit": "file:../devkit", "@nx/js": "file:../js", - "@nx/linter": "file:../linter", + "@nx/eslint": "file:../eslint", "@nx/vue": "file:../vue", "@nx/cypress": "file:../cypress", "@nx/playwright": "file:../playwright", diff --git a/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap b/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap index 39ed8c070a82b..95a0a6c7dc23e 100644 --- a/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/nuxt/src/generators/application/__snapshots__/application.spec.ts.snap @@ -67,7 +67,7 @@ exports[`app generated files content - as-provided should configure tsconfig and } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["my-app/**/*.{ts,tsx,js,jsx,vue}"] diff --git a/packages/nuxt/src/generators/application/application.ts b/packages/nuxt/src/generators/application/application.ts index 383386ddb3cf5..909ec9b7ab9e2 100644 --- a/packages/nuxt/src/generators/application/application.ts +++ b/packages/nuxt/src/generators/application/application.ts @@ -17,7 +17,7 @@ import { createTsConfig } from '../../utils/create-ts-config'; import { getRelativePathToRootTsConfig } from '@nx/js'; import { updateGitIgnore } from '../../utils/update-gitignore'; import { addBuildTarget, addServeTarget } from './lib/add-targets'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { addJest } from '@nx/vue'; import { addE2e } from './lib/add-e2e'; import { nxVersion } from '../../utils/versions'; diff --git a/packages/nuxt/src/generators/application/lib/add-e2e.ts b/packages/nuxt/src/generators/application/lib/add-e2e.ts index ca95def54d010..54bd212c35da8 100644 --- a/packages/nuxt/src/generators/application/lib/add-e2e.ts +++ b/packages/nuxt/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 '../schema'; diff --git a/packages/nuxt/src/generators/application/schema.d.ts b/packages/nuxt/src/generators/application/schema.d.ts index 208da79b35ee7..f5525a2ed0651 100644 --- a/packages/nuxt/src/generators/application/schema.d.ts +++ b/packages/nuxt/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/nuxt/src/generators/storybook-configuration/configuration.spec.ts b/packages/nuxt/src/generators/storybook-configuration/configuration.spec.ts index 6ebc14fdc8d0b..2c18fc206ac6e 100644 --- a/packages/nuxt/src/generators/storybook-configuration/configuration.spec.ts +++ b/packages/nuxt/src/generators/storybook-configuration/configuration.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 applicationGenerator from '../application/application'; import componentGenerator from '../component/component'; import storybookConfigurationGenerator from './configuration'; diff --git a/packages/nuxt/src/generators/storybook-configuration/schema.d.ts b/packages/nuxt/src/generators/storybook-configuration/schema.d.ts index bfab779db2beb..fa17f844b9f0a 100644 --- a/packages/nuxt/src/generators/storybook-configuration/schema.d.ts +++ b/packages/nuxt/src/generators/storybook-configuration/schema.d.ts @@ -1,4 +1,4 @@ -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; export interface Schema { name: string; diff --git a/packages/nuxt/src/utils/add-linting.ts b/packages/nuxt/src/utils/add-linting.ts index 416c365f78068..a9d4cc1e77bac 100644 --- a/packages/nuxt/src/utils/add-linting.ts +++ b/packages/nuxt/src/utils/add-linting.ts @@ -1,5 +1,5 @@ import { Tree } from 'nx/src/generators/tree'; -import { lintProjectGenerator, Linter } from '@nx/linter'; +import { lintProjectGenerator, Linter } from '@nx/eslint'; import { joinPathFragments } from 'nx/src/utils/path'; import { GeneratorCallback, diff --git a/packages/nx/package.json b/packages/nx/package.json index a2d5acd0f541a..cc13a901ad2a7 100644 --- a/packages/nx/package.json +++ b/packages/nx/package.json @@ -100,7 +100,7 @@ "@nrwl/js", "@nx/jest", "@nrwl/jest", - "@nx/linter", + "@nx/eslint", "@nrwl/linter", "@nx/workspace", "@nrwl/workspace", 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 8d9dab0119d33..aa647d07cb160 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/migrations/update-15-0-0/migrate-to-inputs.ts b/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts index bbd9f4205578d..89b84d3af7f0b 100644 --- a/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts +++ b/packages/nx/src/migrations/update-15-0-0/migrate-to-inputs.ts @@ -16,7 +16,7 @@ const skippedFiles = [ 'karma.conf.js', // Will be handled by @nx/angular 'jest.preset.js', // Will be handled by @nx/jest '.storybook', // Will be handled by @nx/storybook - // Will be handled by @nx/linter + // Will be handled by @nx/eslint '.eslintrc.json', '.eslintrc.js', ]; diff --git a/packages/nx/src/utils/plugins/core-plugins.ts b/packages/nx/src/utils/plugins/core-plugins.ts index a2c473cde0861..c545b7685483d 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 ac5338062d8b5..b5ba99daef10d 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 f3e88dcf1a7e4..2701b8ae27bb7 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 b14d133411991..dc1354f891fd9 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 c4270f0d1ab0a..44823b513cf94 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 d2aca60feb035..b76013fca5ff3 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 1683b5f6e4a44..35acb9a68601c 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 c3fbd1da9f8bc..6e8e0a1ec366c 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 11811296957f2..b4a50e7809527 100644 --- a/packages/plugin/src/generators/e2e-project/e2e.ts +++ b/packages/plugin/src/generators/e2e-project/e2e.ts @@ -20,7 +20,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 2e2b5c437aecf..ef0497c712ca9 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/executor/executor.spec.ts b/packages/plugin/src/generators/executor/executor.spec.ts index 5af728505ae47..3215fef82ad50 100644 --- a/packages/plugin/src/generators/executor/executor.spec.ts +++ b/packages/plugin/src/generators/executor/executor.spec.ts @@ -4,7 +4,7 @@ import { executorGenerator } from './executor'; import { pluginGenerator } from '../plugin/plugin'; import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { setCwd } from '@nx/devkit/internal-testing-utils'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('NxPlugin Executor Generator', () => { let tree: Tree; diff --git a/packages/plugin/src/generators/generator/generator.spec.ts b/packages/plugin/src/generators/generator/generator.spec.ts index 722fa0eacbc45..b2543f6c377ee 100644 --- a/packages/plugin/src/generators/generator/generator.spec.ts +++ b/packages/plugin/src/generators/generator/generator.spec.ts @@ -8,7 +8,7 @@ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { libraryGenerator as jsLibraryGenerator } from '@nx/js'; import { pluginGenerator } from '../plugin/plugin'; import { generatorGenerator } from './generator'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { setCwd } from '@nx/devkit/internal-testing-utils'; describe('NxPlugin Generator Generator', () => { diff --git a/packages/plugin/src/generators/lint-checks/generator.spec.ts b/packages/plugin/src/generators/lint-checks/generator.spec.ts index 8ce875b7b789a..685c3db078f3d 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/lint/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 16345f6715375..87a224b08c32c 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/migration/migration.spec.ts b/packages/plugin/src/generators/migration/migration.spec.ts index a518124f385d2..2e1d0ac3f4599 100644 --- a/packages/plugin/src/generators/migration/migration.spec.ts +++ b/packages/plugin/src/generators/migration/migration.spec.ts @@ -3,7 +3,7 @@ import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; import { migrationGenerator } from './migration'; import { pluginGenerator } from '../plugin/plugin'; import { setCwd } from '@nx/devkit/internal-testing-utils'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; describe('NxPlugin migration generator', () => { let tree: Tree; diff --git a/packages/plugin/src/generators/plugin/plugin.spec.ts b/packages/plugin/src/generators/plugin/plugin.spec.ts index b00754dc14ed9..20ca43d2d73a4 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 bab8142284d0b..cbdeca0d85782 100644 --- a/packages/plugin/src/generators/plugin/plugin.ts +++ b/packages/plugin/src/generators/plugin/plugin.ts @@ -12,7 +12,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 0b77a9be7fc56..470fa7f14f362 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 47769716d5b06..5f9478cbf8dcd 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 6ec8486e616fb..cc9167fc4bdae 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 77c49e508bbd4..8e021a2463995 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 a2053e828e42c..750392fb29158 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 eb234bee90489..450d2ed8a27d8 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 981a118169afc..e3ebc558b25d1 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 f2c7c13bb6339..c3075e9f65f41 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 fa553bc5c4dcd..749b5897f45cb 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 29a4e1b4caaa0..dfb22bd2f8a61 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 32cfa2a57a761..77eb8883ce35f 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 b4ae7b807f59d..e515465f19982 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 52a4ae7487b08..6b971efac5e3b 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 8c16586ab6337..d9337b4069cd8 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 98722e9af32ee..ee57a0ac5effd 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 74cb2eb735630..6df0723281297 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 dd8403a234a5e..a492a56913a7d 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 f233d7bf1307f..03fa628105fa1 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 cc3617e4d5e27..332a7293bee4e 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 ca6cb58f730b5..883bfeca750d0 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 21b6a5b45caa4..72e72e444bbc5 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 ac1f42bea53ec..82735dc73959d 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 4fc587c915780..83c8c4b1422d2 100644 --- a/packages/react/src/generators/application/application.ts +++ b/packages/react/src/generators/application/application.ts @@ -21,8 +21,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, @@ -37,7 +37,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 7889227778ac5..5b7421d540dc1 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 940b13ef5c67a..42bb2ac866ebe 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 0b7b3f73a107e..e3e8a83e66233 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 174faf4edda6b..4b5fa164ec71c 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 f721f7e910c52..ecd17bd11ff14 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 1ebce3f368103..12ce7b19b8747 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 9c6aa8bb70be8..5ef088edc1a5c 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 51dc14d63b688..6b399c2b07682 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 0834a21f8665b..610f83660a2a9 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 fda0e2648fb75..0e1bafc067fbd 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 6837396688e30..3f6235bb9e8d0 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}'], @@ -414,7 +414,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 21621995c024c..8de7282dcde53 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 f278fbc0d19b9..89bf93826d697 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 b4f5755f36b2d..1d1e250d2fa79 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 cbcb6a96f17c1..cb57362406bab 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 9da982b444af3..21d89d43fcd03 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 31302908f4c7a..eff11ed002c5b 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 958124e9ad086..ad89c17b7d962 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 1b02328f0e010..8b7ba5908d34e 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 9b6b0a7509571..ea4a1df2bfa96 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 8d28fc9293988..ddfd30192f217 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/lint.ts b/packages/react/src/utils/lint.ts index 05e8641d6fafb..c4ba31bcc2bc5 100644 --- a/packages/react/src/utils/lint.ts +++ b/packages/react/src/utils/lint.ts @@ -17,7 +17,7 @@ export const extraEslintDependencies = { }; /** - * @deprecated Use `addExtendsToLintConfig` from `@nx/linter` instead. + * @deprecated Use `addExtendsToLintConfig` from `@nx/eslint` instead. */ export const extendReactEslintJson = (json: Linter.Config) => { const { extends: pluginExtends, ...config } = json; diff --git a/packages/react/src/utils/testing-generators.ts b/packages/react/src/utils/testing-generators.ts index fa459b927a1c6..e495057985a63 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 6893fdfa4c1af..6398706697fca 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" }, "publishConfig": { "access": "public" diff --git a/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap b/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap index f507baeef469d..a029d2c82219d 100644 --- a/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap +++ b/packages/storybook/src/generators/configuration/__snapshots__/configuration.spec.ts.snap @@ -47,7 +47,7 @@ exports[`@nx/storybook:configuration for Storybook v7 basic functionalities shou ], }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "options": { "lintFilePatterns": [ "test-ui-lib/**/*.ts", diff --git a/packages/storybook/src/generators/configuration/configuration.spec.ts b/packages/storybook/src/generators/configuration/configuration.spec.ts index 29f3adad089ed..ad4d72d9f15f8 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 606c1e297bb85..ab8edae9eaced 100644 --- a/packages/storybook/src/generators/configuration/configuration.ts +++ b/packages/storybook/src/generators/configuration/configuration.ts @@ -28,7 +28,7 @@ import { projectIsRootProjectInStandaloneWorkspace, updateLintConfig, } from './lib/util-functions'; -import { Linter } from '@nx/linter'; +import { Linter } from '@nx/eslint'; import { findStorybookAndBuildTargetsAndCompiler, pleaseUpgrade, @@ -69,14 +69,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 5bb38a7d98b52..67e525de3f014 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 { UiFramework } 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 809f733919348..8aeee29c89dcc 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 { 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 0dc2fb7533af8..3365702123f05 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 f43b85f802b60..0b7246091cf4d 100644 --- a/packages/storybook/src/generators/cypress-project/cypress-project.ts +++ b/packages/storybook/src/generators/cypress-project/cypress-project.ts @@ -17,7 +17,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 c89f80f34e16e..c09e372f98864 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 14adaf42e9dab..be32b1d2c354c 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/__snapshots__/application.spec.ts.snap b/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap index 2ed6146f2055e..c81e60e6cb6b4 100644 --- a/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap +++ b/packages/vue/src/generators/application/__snapshots__/application.spec.ts.snap @@ -83,7 +83,7 @@ exports[`application generator should set up project correctly with given option "sourceRoot": "test/src", "targets": { "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["test/**/*.{ts,tsx,js,jsx,vue}"] diff --git a/packages/vue/src/generators/application/application.ts b/packages/vue/src/generators/application/application.ts index 01a699e88be70..d6faa7b31184b 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 3ce0654f7236a..7df31a02a396d 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 b9ab33d354d6d..81f40b0fc17bb 100644 --- a/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap +++ b/packages/vue/src/generators/library/__snapshots__/library.spec.ts.snap @@ -36,10 +36,10 @@ exports[`lib should add correct jest.config.ts and dependencies to package.json }, "devDependencies": { "@nx/cypress": "0.0.1", + "@nx/eslint": "0.0.1", "@nx/eslint-plugin": "0.0.1", "@nx/jest": "0.0.1", "@nx/js": "0.0.1", - "@nx/linter": "0.0.1", "@nx/rollup": "0.0.1", "@nx/vite": "0.0.1", "@nx/vue": "0.0.1", @@ -232,9 +232,9 @@ exports[`lib should add vue, vite and vitest to package.json 1`] = ` }, "devDependencies": { "@nx/cypress": "0.0.1", + "@nx/eslint": "0.0.1", "@nx/eslint-plugin": "0.0.1", "@nx/js": "0.0.1", - "@nx/linter": "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 c126e30d8db32..6378029e20099 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 9d5d6bde90dfe..2713f20d5e7a8 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 6b08f31cb153a..dca9062124bc1 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 e000fbaef974a..6e68c1cb07e9d 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 b9a327d573f47..dded11aaa60fd 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 d0b48c27fbdaf..55cf9a5ac02f9 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 = `