Skip to content

Commit

Permalink
feat(linter): rename @nx/eslint-plugin-nx to @nx/eslint-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Apr 20, 2023
1 parent d544102 commit 6af5e2e
Show file tree
Hide file tree
Showing 93 changed files with 252 additions and 226 deletions.
4 changes: 2 additions & 2 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ yarn.lock @FrozenPandaz @vsavkin @AgentEnder @jaysoo @JamesHenry
/e2e/jest/** @barbados-clemens @FrozenPandaz

# Linter
/docs/generated/packages/eslint-plugin-nx/** @meeroslav @FrozenPandaz @JamesHenry
/docs/generated/packages/eslint-plugin/** @meeroslav @FrozenPandaz @JamesHenry
/docs/generated/packages/linter/** @meeroslav @FrozenPandaz @JamesHenry
/docs/shared/packages/linter/** @meeroslav @FrozenPandaz @isaacplmann @juristr
/packages/eslint-plugin-nx/** @meeroslav @FrozenPandaz @JamesHenry
/packages/eslint-plugin/** @meeroslav @FrozenPandaz @JamesHenry
/packages/linter/** @meeroslav @FrozenPandaz @JamesHenry
/e2e/linter/** @meeroslav @FrozenPandaz
.eslint* @meeroslav @FrozenPandaz @JamesHenry
Expand Down
12 changes: 6 additions & 6 deletions docs/generated/manifests/menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -4405,26 +4405,26 @@
"disableCollapsible": false
},
{
"id": "eslint-plugin-nx",
"path": "/packages/eslint-plugin-nx",
"name": "eslint-plugin-nx",
"id": "eslint-plugin",
"path": "/packages/eslint-plugin",
"name": "eslint-plugin",
"children": [
{
"id": "documents",
"path": "/packages/eslint-plugin-nx/documents",
"path": "/packages/eslint-plugin/documents",
"name": "documents",
"children": [
{
"name": "Overview",
"path": "/packages/eslint-plugin-nx/documents/overview",
"path": "/packages/eslint-plugin/documents/overview",
"id": "overview",
"isExternal": false,
"children": [],
"disableCollapsible": false
},
{
"name": "The `enforce-module-boundaries` rule",
"path": "/packages/eslint-plugin-nx/documents/enforce-module-boundaries",
"path": "/packages/eslint-plugin/documents/enforce-module-boundaries",
"id": "enforce-module-boundaries",
"isExternal": false,
"children": [],
Expand Down
32 changes: 16 additions & 16 deletions docs/generated/manifests/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -645,40 +645,40 @@
},
"path": "/packages/esbuild"
},
"eslint-plugin-nx": {
"eslint-plugin": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "eslint-plugin-nx",
"packageName": "@nrwl/eslint-plugin-nx",
"description": "The eslint-plugin-nx 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.",
"name": "eslint-plugin",
"packageName": "@nrwl/eslint-plugin",
"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": {
"/packages/eslint-plugin-nx/documents/overview": {
"/packages/eslint-plugin/documents/overview": {
"id": "overview",
"name": "Overview",
"description": "The eslint-plugin-nx 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.",
"file": "generated/packages/eslint-plugin-nx/documents/overview",
"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.",
"file": "generated/packages/eslint-plugin/documents/overview",
"itemList": [],
"isExternal": false,
"path": "/packages/eslint-plugin-nx/documents/overview",
"path": "/packages/eslint-plugin/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/linter/eslint-plugin-nx"
"originalFilePath": "shared/packages/linter/eslint-plugin"
},
"/packages/eslint-plugin-nx/documents/enforce-module-boundaries": {
"/packages/eslint-plugin/documents/enforce-module-boundaries": {
"id": "enforce-module-boundaries",
"name": "The `enforce-module-boundaries` rule",
"description": "The eslint-plugin-nx 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.",
"file": "generated/packages/eslint-plugin-nx/documents/enforce-module-boundaries",
"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.",
"file": "generated/packages/eslint-plugin/documents/enforce-module-boundaries",
"itemList": [],
"isExternal": false,
"path": "/packages/eslint-plugin-nx/documents/enforce-module-boundaries",
"path": "/packages/eslint-plugin/documents/enforce-module-boundaries",
"tags": [],
"originalFilePath": "shared/packages/linter/enforce-module-boundaries"
}
},
"root": "/packages/eslint-plugin-nx",
"source": "/packages/eslint-plugin-nx/src",
"root": "/packages/eslint-plugin",
"source": "/packages/eslint-plugin/src",
"executors": {},
"generators": {},
"path": "/packages/eslint-plugin-nx"
"path": "/packages/eslint-plugin"
},
"expo": {
"githubRoot": "https://github.com/nrwl/nx/blob/master",
Expand Down
24 changes: 12 additions & 12 deletions docs/generated/packages-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,38 +639,38 @@
"source": "/packages/esbuild/src"
},
{
"description": "The eslint-plugin-nx 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.",
"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": [
{
"id": "overview",
"name": "Overview",
"description": "The eslint-plugin-nx 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.",
"file": "generated/packages/eslint-plugin-nx/documents/overview",
"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.",
"file": "generated/packages/eslint-plugin/documents/overview",
"itemList": [],
"isExternal": false,
"path": "eslint-plugin-nx/documents/overview",
"path": "eslint-plugin/documents/overview",
"tags": [],
"originalFilePath": "shared/packages/linter/eslint-plugin-nx"
"originalFilePath": "shared/packages/linter/eslint-plugin"
},
{
"id": "enforce-module-boundaries",
"name": "The `enforce-module-boundaries` rule",
"description": "The eslint-plugin-nx 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.",
"file": "generated/packages/eslint-plugin-nx/documents/enforce-module-boundaries",
"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.",
"file": "generated/packages/eslint-plugin/documents/enforce-module-boundaries",
"itemList": [],
"isExternal": false,
"path": "eslint-plugin-nx/documents/enforce-module-boundaries",
"path": "eslint-plugin/documents/enforce-module-boundaries",
"tags": [],
"originalFilePath": "shared/packages/linter/enforce-module-boundaries"
}
],
"executors": [],
"generators": [],
"githubRoot": "https://github.com/nrwl/nx/blob/master",
"name": "eslint-plugin-nx",
"packageName": "@nrwl/eslint-plugin-nx",
"root": "/packages/eslint-plugin-nx",
"source": "/packages/eslint-plugin-nx/src"
"name": "eslint-plugin",
"packageName": "@nrwl/eslint-plugin",
"root": "/packages/eslint-plugin",
"source": "/packages/eslint-plugin/src"
},
{
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ You can also use `@nrwl/nx/react` which includes all three `@nrwl/nx/react-*` pl

### Enforce Module Boundaries rule

The `enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps keep prevent unplanned cross-dependencies. Read more about it on a [dedicated page](/packages/eslint-plugin-nx/documents/enforce-module-boundaries)
The `enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps keep prevent unplanned cross-dependencies. Read more about it on a [dedicated page](/packages/eslint-plugin/documents/enforce-module-boundaries)
2 changes: 1 addition & 1 deletion docs/generated/packages/linter/documents/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ nx lint my-lib

## ESLint plugin

Read about our dedicated ESLint plugin - [eslint-plugin-nx](/packages/eslint-plugin-nx/documents/overview).
Read about our dedicated ESLint plugin - [eslint-plugin-nx](/packages/eslint-plugin/documents/overview).
10 changes: 5 additions & 5 deletions docs/map.json
Original file line number Diff line number Diff line change
Expand Up @@ -1926,20 +1926,20 @@
]
},
{
"name": "eslint-plugin-nx",
"id": "eslint-plugin-nx",
"name": "eslint-plugin",
"id": "eslint-plugin",
"description": "ESLint plugin package.",
"itemList": [
{
"id": "overview",
"name": "Overview",
"path": "/packages/eslint-plugin-nx",
"file": "shared/packages/linter/eslint-plugin-nx"
"path": "/packages/eslint-plugin",
"file": "shared/packages/linter/eslint-plugin"
},
{
"id": "enforce-module-boundaries",
"name": "The `enforce-module-boundaries` rule",
"path": "/packages/eslint-plugin-nx",
"path": "/packages/eslint-plugin",
"file": "shared/packages/linter/enforce-module-boundaries"
}
]
Expand Down
8 changes: 4 additions & 4 deletions docs/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@
}
},
{
"name": "eslint-plugin-nx",
"packageName": "eslint-plugin-nx",
"description": "The eslint-plugin-nx 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.",
"path": "generated/packages/eslint-plugin-nx.json",
"name": "eslint-plugin",
"packageName": "eslint-plugin",
"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.",
"path": "generated/packages/eslint-plugin.json",
"schemas": { "executors": [], "generators": [] }
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ You can also use `@nrwl/nx/react` which includes all three `@nrwl/nx/react-*` pl

### Enforce Module Boundaries rule

The `enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps keep prevent unplanned cross-dependencies. Read more about it on a [dedicated page](/packages/eslint-plugin-nx/documents/enforce-module-boundaries)
The `enforce-module-boundaries` ESLint rule enables you to define strict rules for accessing resources between different projects in the repository. Enforcing strict boundaries helps keep prevent unplanned cross-dependencies. Read more about it on a [dedicated page](/packages/eslint-plugin/documents/enforce-module-boundaries)
2 changes: 1 addition & 1 deletion docs/shared/packages/linter/linter-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ nx lint my-lib

## ESLint plugin

Read about our dedicated ESLint plugin - [eslint-plugin-nx](/packages/eslint-plugin-nx/documents/overview).
Read about our dedicated ESLint plugin - [eslint-plugin-nx](/packages/eslint-plugin/documents/overview).
14 changes: 7 additions & 7 deletions e2e/linter/src/linter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('Linter', () => {
);
updateFile(newRulePath, updatedRuleContents);

const newRuleNameForUsage = `@nx/nx/workspace/${newRuleName}`;
const newRuleNameForUsage = `@nx/workspace/${newRuleName}`;

// Add the new workspace rule to the lint config and run linting
const eslintrc = readJson('.eslintrc.json');
Expand Down Expand Up @@ -199,10 +199,10 @@ describe('Linter', () => {

const eslint = readJson('.eslintrc.json');
eslint.overrides[0].rules[
'@nx/nx/enforce-module-boundaries'
'@nx/enforce-module-boundaries'
][1].depConstraints = [
{ sourceTag: 'validtag', onlyDependOnLibsWithTags: ['validtag'] },
...eslint.overrides[0].rules['@nx/nx/enforce-module-boundaries'][1]
...eslint.overrides[0].rules['@nx/enforce-module-boundaries'][1]
.depConstraints,
];
updateFile('.eslintrc.json', JSON.stringify(eslint, null, 2));
Expand Down Expand Up @@ -454,8 +454,8 @@ describe('Linter', () => {
const e2eEslint = readJson('e2e/.eslintrc.json');

// should directly refer to nx plugin
expect(rootEslint.plugins).toEqual(['@nx/nx']);
expect(e2eEslint.plugins).toEqual(['@nx/nx']);
expect(rootEslint.plugins).toEqual(['@nx']);
expect(e2eEslint.plugins).toEqual(['@nx']);
}

function verifySuccessfulMigratedSetup(myapp: string, mylib: string) {
Expand All @@ -476,7 +476,7 @@ describe('Linter', () => {
const libEslint = readJson(`libs/${mylib}/.eslintrc.json`);

// should directly refer to nx plugin
expect(rootEslint.plugins).toEqual(['@nx/nx']);
expect(rootEslint.plugins).toEqual(['@nx']);
expect(appEslint.plugins).toBeUndefined();
expect(e2eEslint.plugins).toBeUndefined();
expect(libEslint.plugins).toBeUndefined();
Expand Down Expand Up @@ -541,7 +541,7 @@ describe('Linter', () => {

// should have no plugin extends
expect(appEslint.overrides[0].extends).toEqual([
'plugin:@nx/nx/angular',
'plugin:@nx/angular',
'plugin:@angular-eslint/template/process-inline-templates',
]);
expect(e2eEslint.overrides[0].extends).toBeUndefined();
Expand Down
2 changes: 1 addition & 1 deletion nx-dev/nx-dev-e2e/src/e2e/packages.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('nx-dev: Packages Section', () => {
title: '@nrwl/esbuild:esbuild',
path: '/packages/esbuild/executors/esbuild',
},
{ title: '@nrwl/eslint-plugin-nx', path: '/packages/eslint-plugin-nx' },
{ title: '@nrwl/eslint-plugin', path: '/packages/eslint-plugin' },
{ title: '@nrwl/expo', path: '/packages/expo' },
{
title: '@nrwl/expo:init',
Expand Down
7 changes: 6 additions & 1 deletion nx-dev/nx-dev/redirect-rules.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ const packagesIndexes = {
'/cypress': '/packages/cypress',
'/detox': '/packages/detox',
'/esbuild': '/packages/esbuild',
'/eslint-plugin-nx': '/packages/eslint',
'/eslint-plugin-nx': '/packages/eslint-plugin-nx',
'/expo': '/packages/expo',
'/express': '/packages/express',
'/jest': '/packages/jest',
Expand Down Expand Up @@ -518,6 +518,11 @@ const packagesDocuments = {
'/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',
'/packages/eslint-plugin-nx': '/packages/eslint-plugin',
'/packages/eslint-plugin-nx/documents/enforce-module-boundaries':
'/packages/eslint-plugin/documents/enforce-module-boundaries',
'/packages/eslint-plugin-nx/documents/overview':
'/packages/eslint-plugin/documents/overview',
};

/**
Expand Down
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 @@ -5,7 +5,7 @@ export const iconsMap: Record<string, string> = {
detox: '/images/icons/react.svg',
devkit: '/images/icons/nx.svg',
esbuild: '/images/icons/esbuild.svg',
'eslint-plugin-nx': '/images/icons/eslint.svg',
'eslint-plugin': '/images/icons/eslint.svg',
expo: '/images/icons/expo.svg',
express: '/images/icons/express.svg',
jest: '/images/icons/jest.svg',
Expand Down
2 changes: 1 addition & 1 deletion packages-legacy/eslint-plugin-nx/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## @nrwl/eslint-plugin-nx has been deprecated!

@nrwl/eslint-plugin-nx has been deprecated in favor of [@nx/eslint-plugin-nx](https://www.npmjs.com/package/@nx/eslint-plugin-nx). Please use that instead.
@nrwl/eslint-plugin-nx has been deprecated in favor of [@nx/eslint-plugin](https://www.npmjs.com/package/@nx/eslint-plugin). Please use that instead.

@nrwl/eslint-plugin-nx will no longer be published in Nx v17.

Expand Down
2 changes: 1 addition & 1 deletion packages-legacy/eslint-plugin-nx/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from '@nx/eslint-plugin-nx';
export * from '@nx/eslint-plugin';
2 changes: 1 addition & 1 deletion packages-legacy/eslint-plugin-nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"homepage": "https://nx.dev",
"dependencies": {
"@nx/eslint-plugin-nx": "file:../../packages/eslint-plugin-nx"
"@nx/eslint-plugin": "file:../../packages/eslint-plugin"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 1 addition & 2 deletions packages-legacy/linter/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@
]
}
}
},
"implicitDependencies": ["eslint-plugin-nx"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`addLinting generator should correctly generate the .eslintrc.json file
"overrides": [
{
"extends": [
"plugin:@nx/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates",
],
"files": [
Expand All @@ -38,7 +38,7 @@ exports[`addLinting generator should correctly generate the .eslintrc.json file
},
{
"extends": [
"plugin:@nx/nx/angular-template",
"plugin:@nx/angular-template",
],
"files": [
"*.html",
Expand All @@ -60,7 +60,7 @@ exports[`addLinting generator support angular v14 should correctly generate the
"overrides": [
{
"extends": [
"plugin:@nx/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates",
],
"files": [
Expand All @@ -87,7 +87,7 @@ exports[`addLinting generator support angular v14 should correctly generate the
},
{
"extends": [
"plugin:@nx/nx/angular-template",
"plugin:@nx/angular-template",
],
"files": [
"*.html",
Expand Down
Loading

0 comments on commit 6af5e2e

Please sign in to comment.