feat(linter): rename @nx/linter to @nx/eslint (#19515)
This commit is contained in:
parent
cc2388cb88
commit
0bc693342e
8
.github/workflows/e2e-matrix.yml
vendored
8
.github/workflows/e2e-matrix.yml
vendored
@ -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
|
||||
|
||||
8
.github/workflows/e2e-windows.yml
vendored
8
.github/workflows/e2e-windows.yml
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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": [
|
||||
|
||||
@ -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": [
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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).
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
@ -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"]
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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": [
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"]
|
||||
|
||||
@ -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 |
|
||||
|
||||
@ -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`.
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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}"]
|
||||
|
||||
@ -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`,
|
||||
|
||||
@ -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',
|
||||
};
|
||||
@ -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"]
|
||||
}
|
||||
@ -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`,
|
||||
@ -77,7 +77,7 @@ export function newProject({
|
||||
`@nx/esbuild`,
|
||||
`@nx/jest`,
|
||||
`@nx/js`,
|
||||
`@nx/linter`,
|
||||
`@nx/eslint`,
|
||||
`@nx/nest`,
|
||||
`@nx/next`,
|
||||
`@nx/node`,
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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,
|
||||
};
|
||||
|
||||
@ -239,7 +239,7 @@ export function PluginsTab(): JSX.Element {
|
||||
Installed plugins: <br />
|
||||
<br />
|
||||
@nx/js (executors,generators) <br />
|
||||
@nx/linter (executors,generators) <br />
|
||||
@nx/eslint (executors,generators) <br />
|
||||
@nx/next (executors,generators)
|
||||
<br />
|
||||
<br />
|
||||
|
||||
@ -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',
|
||||
|
||||
13
packages-legacy/linter-nx/README.md
Normal file
13
packages-legacy/linter-nx/README.md
Normal file
@ -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.
|
||||
|
||||
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
|
||||
|
||||
# Nx: Smart, Fast and Extensible Build System
|
||||
|
||||
Nx is a next generation build system with first class monorepo support and powerful integrations.
|
||||
17
packages-legacy/linter-nx/executors.json
Normal file
17
packages-legacy/linter-nx/executors.json
Normal file
@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
4
packages-legacy/linter-nx/generators.json
Normal file
4
packages-legacy/linter-nx/generators.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": ["@nx/eslint"],
|
||||
"schematics": {}
|
||||
}
|
||||
1
packages-legacy/linter-nx/index.ts
Normal file
1
packages-legacy/linter-nx/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '@nx/eslint';
|
||||
37
packages-legacy/linter-nx/package.json
Normal file
37
packages-legacy/linter-nx/package.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
38
packages-legacy/linter-nx/project.json
Normal file
38
packages-legacy/linter-nx/project.json
Normal file
@ -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": "/"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
packages-legacy/linter-nx/tsconfig.json
Normal file
6
packages-legacy/linter-nx/tsconfig.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {},
|
||||
"include": ["**/*.ts"],
|
||||
"files": ["index.ts"]
|
||||
}
|
||||
@ -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."
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"extends": ["@nx/linter"],
|
||||
"extends": ["@nx/eslint"],
|
||||
"schematics": {}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
export * from '@nx/linter';
|
||||
export * from '@nx/eslint';
|
||||
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,5 +35,5 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"implicitDependencies": ["node", "linter"]
|
||||
"implicitDependencies": ["node", "eslint"]
|
||||
}
|
||||
|
||||
@ -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"
|
||||
},
|
||||
|
||||
@ -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`,
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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}",
|
||||
|
||||
@ -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}",
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -5,11 +5,11 @@ describe(<%= componentName %>.name, () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.overrideComponent(<%= componentName %>, {
|
||||
add: {
|
||||
add: {
|
||||
imports: [],
|
||||
providers: []
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it('renders', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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: {
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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<void> {
|
||||
target.executor = '@nx/linter:eslint';
|
||||
target.executor = '@nx/eslint:lint';
|
||||
|
||||
if (!target.options) {
|
||||
this.logger.warn(
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import type { Linter } from '@nx/linter';
|
||||
import type { Linter } from '@nx/eslint';
|
||||
|
||||
export interface StorybookConfigurationOptions {
|
||||
configureStaticServe?: boolean;
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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<typeof Button> = {
|
||||
component: Button,
|
||||
title: 'Layout/Texts/Button',
|
||||
};
|
||||
export default Story;
|
||||
|
||||
|
||||
export const Primary = {
|
||||
args: {},
|
||||
};
|
||||
|
||||
@ -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],
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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}",
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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}",
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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"
|
||||
},
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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 () => {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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', () => {
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user