From 210b5284900f55ad797429ea002937d7f6a149d9 Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Tue, 10 Oct 2023 20:43:19 +0200 Subject: [PATCH] feat(nx-dev): add linter redirects --- .../automate-updating-dependencies.md | 2 +- .../tips-n-tricks/migrating-to-flat-eslint.md | 2 +- nx-dev/nx-dev/redirect-rules.js | 19 +++++++++++++------ nx-dev/ui-references/src/lib/icons-map.ts | 2 +- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/shared/core-features/automate-updating-dependencies.md b/docs/shared/core-features/automate-updating-dependencies.md index 1f320e04983f1d..0e3f70dae8bb73 100644 --- a/docs/shared/core-features/automate-updating-dependencies.md +++ b/docs/shared/core-features/automate-updating-dependencies.md @@ -17,7 +17,7 @@ title="How Automated Code Migrations Work" Nx knows where its configuration files are and can therefore make sure they match the expected format. This automated update process, commonly referred to as "migration," becomes even more powerful when you leverage [Nx plugins](/nx-api). Nx plugins, which are NPM packages with a range of capabilities (code generation, task automation...), offer targeted updates based on their specific areas of responsibility. -For example, the [Nx ESLint plugin](/nx-api/linter) excels at configuring linting in your workspace. With its understanding of the configuration file locations, this plugin can provide precise migration scripts to update ESLint packages in your `package.json` and corresponding configuration files in your workspace when a new version is released. +For example, the [Nx ESLint plugin](/nx-api/eslint) excels at configuring linting in your workspace. With its understanding of the configuration file locations, this plugin can provide precise migration scripts to update ESLint packages in your `package.json` and corresponding configuration files in your workspace when a new version is released. Updating happens in three steps: diff --git a/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md b/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md index 391af0a892d88d..6d254d91749e76 100644 --- a/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md +++ b/docs/shared/recipes/tips-n-tricks/migrating-to-flat-eslint.md @@ -156,7 +156,7 @@ module.exports = { For additional details, head over to [ESLint's official blog post](https://eslint.org/blog/2022/08/new-config-system-part-2/). -Since version 16.8.0, Nx supports the usage of flat config in the [@nx/eslint:lint](/nx-api/eslint/executors/eslint) executor and `@nx/*` generators, and provides an automated config conversion from `.eslintrc.json` config files. +Since version 16.8.0, Nx supports the usage of flat config in the [@nx/eslint:lint](/nx-api/eslint/executors/lint) executor and `@nx/*` generators, and provides an automated config conversion from `.eslintrc.json` config files. ## Converting workspace from .eslintrc.json to flat config diff --git a/nx-dev/nx-dev/redirect-rules.js b/nx-dev/nx-dev/redirect-rules.js index a4855abced7673..a81c22990e7cf0 100644 --- a/nx-dev/nx-dev/redirect-rules.js +++ b/nx-dev/nx-dev/redirect-rules.js @@ -88,9 +88,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', @@ -309,7 +308,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', @@ -544,7 +543,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', @@ -650,7 +649,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', @@ -900,6 +899,13 @@ const aiChat = { '/ai': '/ai-chat', }; +// rename nx/linter to eslint +const eslintRename = { + '/nx-api/linter': '/nx-api/eslint', + '/packages/linter': '/packages/eslint', + '/nx-api/linter/executors/eslint': '/nx-api/eslint/executors/lint', +}; + /** * Public export API */ @@ -926,4 +932,5 @@ module.exports = { latestRecipesRefactoring, coreFeatureRefactoring, aiChat, + eslintRename, }; diff --git a/nx-dev/ui-references/src/lib/icons-map.ts b/nx-dev/ui-references/src/lib/icons-map.ts index 0827c58c2822e9..a54170d5361b75 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',