Skip to content

Commit

Permalink
feat(nx-dev): add linter redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Oct 10, 2023
1 parent 00b830a commit 210b528
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
19 changes: 13 additions & 6 deletions nx-dev/nx-dev/redirect-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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
*/
Expand All @@ -926,4 +932,5 @@ module.exports = {
latestRecipesRefactoring,
coreFeatureRefactoring,
aiChat,
eslintRename,
};
2 changes: 1 addition & 1 deletion nx-dev/ui-references/src/lib/icons-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const iconsMap: Record<string, string> = {
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',
Expand Down

0 comments on commit 210b528

Please sign in to comment.