@nrwl/linter 14.8.7 → 14.9.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -1
- package/LICENSE +22 -22
- package/README.md +5 -26
- package/executors.json +0 -10
- package/migrations.json +12 -84
- package/package.json +4 -6
- package/src/executors/eslint/hasher.d.ts +1 -1
- package/src/executors/eslint/hasher.js +1 -1
- package/src/executors/eslint/hasher.js.map +1 -1
- package/src/executors/eslint/lint.impl.js +2 -2
- package/src/executors/eslint/lint.impl.js.map +1 -1
- package/src/executors/eslint/schema.json +12 -6
- package/src/generators/init/global-eslint-config.d.ts +36 -0
- package/src/generators/init/global-eslint-config.js +77 -0
- package/src/generators/init/global-eslint-config.js.map +1 -0
- package/src/generators/init/init-migration.d.ts +3 -0
- package/src/generators/init/init-migration.js +68 -0
- package/src/generators/init/init-migration.js.map +1 -0
- package/src/generators/init/init.d.ts +1 -0
- package/src/generators/init/init.js +12 -160
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/lint-project/lint-project.d.ts +2 -0
- package/src/generators/lint-project/lint-project.js +65 -30
- package/src/generators/lint-project/lint-project.js.map +1 -1
- package/src/generators/utils/eslint-file.d.ts +4 -2
- package/src/generators/utils/eslint-file.js +18 -5
- package/src/generators/utils/eslint-file.js.map +1 -1
- package/src/generators/utils/eslint-targets.d.ts +2 -0
- package/src/generators/utils/eslint-targets.js +13 -0
- package/src/generators/utils/eslint-targets.js.map +1 -0
- package/src/generators/utils/linter.d.ts +0 -1
- package/src/generators/utils/linter.js +0 -1
- package/src/generators/utils/linter.js.map +1 -1
- package/src/generators/workspace-rule/files/__name__.ts__tmpl__ +1 -1
- package/src/generators/workspace-rule/schema.json +2 -11
- package/src/generators/workspace-rule/workspace-rule.d.ts +1 -1
- package/src/generators/workspace-rule/workspace-rule.js +2 -2
- package/src/generators/workspace-rule/workspace-rule.js.map +1 -1
- package/src/generators/workspace-rules-project/workspace-rules-project.d.ts +1 -1
- package/src/generators/workspace-rules-project/workspace-rules-project.js +30 -9
- package/src/generators/workspace-rules-project/workspace-rules-project.js.map +1 -1
- package/src/migrations/update-13-3-0/eslint-8-updates.js +3 -2
- package/src/migrations/update-13-3-0/eslint-8-updates.js.map +1 -1
- package/src/migrations/update-15-0-0/add-eslint-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-eslint-inputs.js +33 -0
- package/src/migrations/update-15-0-0/add-eslint-inputs.js.map +1 -0
- package/src/migrations/update-15-7-1/add-eslint-ignore.d.ts +2 -0
- package/src/migrations/update-15-7-1/add-eslint-ignore.js +42 -0
- package/src/migrations/update-15-7-1/add-eslint-ignore.js.map +1 -0
- package/src/utils/convert-tslint-to-eslint/project-converter.d.ts +1 -1
- package/src/utils/convert-tslint-to-eslint/project-converter.js +9 -9
- package/src/utils/convert-tslint-to-eslint/project-converter.js.map +1 -1
- package/src/utils/convert-tslint-to-eslint/utils.d.ts +1 -1
- package/src/utils/testing.d.ts +1 -1
- package/src/utils/versions.d.ts +0 -2
- package/src/utils/versions.js +1 -3
- package/src/utils/versions.js.map +1 -1
- package/src/executors/lint/compat.d.ts +0 -2
- package/src/executors/lint/compat.js +0 -6
- package/src/executors/lint/compat.js.map +0 -1
- package/src/executors/lint/lint.impl.d.ts +0 -2
- package/src/executors/lint/lint.impl.js +0 -10
- package/src/executors/lint/lint.impl.js.map +0 -1
- package/src/executors/lint/schema.json +0 -124
- package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.d.ts +0 -1
- package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.js +0 -52
- package/src/migrations/update-10-3-0/add-json-ext-to-eslintrc.js.map +0 -1
- package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.d.ts +0 -1
- package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.js +0 -18
- package/src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps.js.map +0 -1
- package/src/migrations/update-10-3-0/update-10-3-0.d.ts +0 -1
- package/src/migrations/update-10-3-0/update-10-3-0.js +0 -20
- package/src/migrations/update-10-3-0/update-10-3-0.js.map +0 -1
- package/src/migrations/update-10-3-0/update-eslint-builder-and-config.d.ts +0 -1
- package/src/migrations/update-10-3-0/update-eslint-builder-and-config.js +0 -81
- package/src/migrations/update-10-3-0/update-eslint-builder-and-config.js.map +0 -1
- package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.d.ts +0 -1
- package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.js +0 -24
- package/src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options.js.map +0 -1
- package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.d.ts +0 -7
- package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js +0 -447
- package/src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets.js.map +0 -1
- package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.d.ts +0 -1
- package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.js +0 -107
- package/src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides.js.map +0 -1
- package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.d.ts +0 -3
- package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.js +0 -95
- package/src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
-
|
6
|
+
|
7
7
|
|
8
8
|
**Note:** Version bump only for package @nrwl/linter
|
package/LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
(The MIT License)
|
2
|
-
|
3
|
-
Copyright (c) 2017-
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
'Software'), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Copyright (c) 2017-2023 Narwhal Technologies Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
@@ -41,40 +41,19 @@ npm init nx-workspace
|
|
41
41
|
yarn create nx-workspace
|
42
42
|
```
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
```
|
47
|
-
? What to create in the new workspace (Use arrow keys)
|
48
|
-
❯ apps [an empty workspace with no plugins with a layout that works best for building apps]
|
49
|
-
core [an empty workspace with no plugins set up to publish npm packages (similar to yarn workspaces)]
|
50
|
-
ts [an empty workspace with the JS/TS plugin preinstalled]
|
51
|
-
react [a workspace with a single React application]
|
52
|
-
angular [a workspace with a single Angular application]
|
53
|
-
next.js [a workspace with a single Next.js application]
|
54
|
-
nest [a workspace with a single Nest application]
|
55
|
-
express [a workspace with a single Express application]
|
56
|
-
web components [a workspace with a single app built using web components]
|
57
|
-
react-native [a workspace with a single React Native application]
|
58
|
-
react-express [a workspace with a full stack application (React + Express)]
|
59
|
-
```
|
60
|
-
|
61
|
-
Select the preset that works best for you
|
62
|
-
|
63
|
-
### Adding Nx to an Existing Monorepo
|
44
|
+
### Adding Nx to an Existing Repository
|
64
45
|
|
65
46
|
Run:
|
66
47
|
|
67
48
|
```bash
|
68
|
-
npx
|
49
|
+
npx nx@latest init
|
69
50
|
```
|
70
51
|
|
71
52
|
## Documentation & Resources
|
72
53
|
|
73
|
-
|
74
|
-
|
75
|
-
- [Nx
|
76
|
-
- [Tutorial: Adding Nx to an Existing Monorepo](/recipe/adding-to-monorepo)
|
77
|
-
- [Official Nx YouTube Channel](https://www.youtube.com/c/Nrwl_io)
|
54
|
+
- [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
|
55
|
+
- [Intro to Nx](https://nx.dev/getting-started/intro)
|
56
|
+
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
78
57
|
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
79
58
|
|
80
59
|
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
package/executors.json
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"builders": {
|
3
|
-
"lint": {
|
4
|
-
"implementation": "./src/executors/lint/compat",
|
5
|
-
"schema": "./src/executors/lint/schema.json",
|
6
|
-
"description": "**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in `v10.3.0`."
|
7
|
-
},
|
8
3
|
"eslint": {
|
9
4
|
"implementation": "./src/executors/eslint/compat",
|
10
5
|
"schema": "./src/executors/eslint/schema.json",
|
@@ -12,11 +7,6 @@
|
|
12
7
|
}
|
13
8
|
},
|
14
9
|
"executors": {
|
15
|
-
"lint": {
|
16
|
-
"implementation": "./src/executors/lint/lint.impl",
|
17
|
-
"schema": "./src/executors/lint/schema.json",
|
18
|
-
"description": "**[DEPRECATED]**: Please use the eslint builder instead, an automated migration was provided in `v10.3.0`."
|
19
|
-
},
|
20
10
|
"eslint": {
|
21
11
|
"implementation": "./src/executors/eslint/lint.impl",
|
22
12
|
"schema": "./src/executors/eslint/schema.json",
|
package/migrations.json
CHANGED
@@ -1,46 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"schematics": {
|
3
|
-
"update-10.3.0": {
|
4
|
-
"version": "10.3.0-beta.1",
|
5
|
-
"description": "Update @typescript-eslint to v4.3",
|
6
|
-
"factory": "./src/migrations/update-10-3-0/update-10-3-0"
|
7
|
-
},
|
8
|
-
"update-eslint-builder-and-config": {
|
9
|
-
"version": "10.3.0-beta.0",
|
10
|
-
"description": "Migrate to the new ESLint builder and ESLint config style",
|
11
|
-
"factory": "./src/migrations/update-10-3-0/update-eslint-builder-and-config"
|
12
|
-
},
|
13
|
-
"add-json-ext-to-eslintrc": {
|
14
|
-
"version": "10.3.0-beta.2",
|
15
|
-
"description": "Add explicit .json file extension to .eslintrc files, not using an extension is deprecated",
|
16
|
-
"factory": "./src/migrations/update-10-3-0/add-json-ext-to-eslintrc"
|
17
|
-
},
|
18
|
-
"add-root-eslintrc-json-to-workspace-implicit-deps": {
|
19
|
-
"version": "10.3.0-beta.3",
|
20
|
-
"description": "Update implicitDependencies within nx.json to include root .eslintrc.json",
|
21
|
-
"factory": "./src/migrations/update-10-3-0/add-root-eslintrc-json-to-workspace-implicit-deps"
|
22
|
-
},
|
23
|
-
"revert-node-modules-files-in-eslint-builder-options": {
|
24
|
-
"version": "10.3.1-beta.1",
|
25
|
-
"description": "Revert any node_modules lintFilesPatterns that were accidentally included by update-eslint-builder-and-config",
|
26
|
-
"factory": "./src/migrations/update-10-3-1/revert-node-modules-files-in-eslint-builder-options"
|
27
|
-
},
|
28
|
-
"update-eslint-configs-to-use-nx-presets": {
|
29
|
-
"version": "10.4.0-beta.0",
|
30
|
-
"description": "Update ESLint config files to use preset configs which eslint-plugin-nx exports",
|
31
|
-
"factory": "./src/migrations/update-10-4-0/update-eslint-configs-to-use-nx-presets"
|
32
|
-
},
|
33
|
-
"update-root-eslint-config-to-use-overrides": {
|
34
|
-
"version": "10.4.0-beta.1",
|
35
|
-
"description": "Update root ESLint config to use overrides",
|
36
|
-
"factory": "./src/migrations/update-10-4-0/update-root-eslint-config-to-use-overrides"
|
37
|
-
},
|
38
|
-
"always-use-project-level-tsconfigs-with-eslint": {
|
39
|
-
"cli": "nx",
|
40
|
-
"version": "11.5.0-beta.0",
|
41
|
-
"description": "Update project .eslintrc.json files to always use project level tsconfigs",
|
42
|
-
"factory": "./src/migrations/update-11-5-0/always-use-project-level-tsconfigs-with-eslint"
|
43
|
-
},
|
44
3
|
"remove-eslint-project-config-if-no-type-checking-rules": {
|
45
4
|
"cli": "nx",
|
46
5
|
"version": "12.4.0-beta.0",
|
@@ -88,52 +47,21 @@
|
|
88
47
|
"version": "14.4.4",
|
89
48
|
"description": "Switch from @typescript-eslint/experimental-utils to @typescript-eslint/utils in all rules and rules.spec files",
|
90
49
|
"factory": "./src/migrations/update-14-4-4/experimental-to-utils-rules"
|
50
|
+
},
|
51
|
+
"add-eslint-inputs": {
|
52
|
+
"cli": "nx",
|
53
|
+
"version": "15.0.0-beta.0",
|
54
|
+
"description": "Stop hashing eslint config files for build targets and dependent tasks",
|
55
|
+
"factory": "./src/migrations/update-15-0-0/add-eslint-inputs"
|
56
|
+
},
|
57
|
+
"add-eslint-ignore": {
|
58
|
+
"cli": "nx",
|
59
|
+
"version": "15.7.1-beta.0",
|
60
|
+
"description": "Add node_modules to root eslint ignore",
|
61
|
+
"factory": "./src/migrations/update-15-7-1/add-eslint-ignore"
|
91
62
|
}
|
92
63
|
},
|
93
64
|
"packageJsonUpdates": {
|
94
|
-
"10.3.0": {
|
95
|
-
"version": "10.3.0-beta.1",
|
96
|
-
"packages": {
|
97
|
-
"@typescript-eslint/parser": {
|
98
|
-
"version": "4.3.0",
|
99
|
-
"alwaysAddToPackageJson": false
|
100
|
-
},
|
101
|
-
"@typescript-eslint/eslint-plugin": {
|
102
|
-
"version": "4.3.0",
|
103
|
-
"alwaysAddToPackageJson": false
|
104
|
-
},
|
105
|
-
"eslint": {
|
106
|
-
"version": "7.10.0",
|
107
|
-
"alwaysAddToPackageJson": false
|
108
|
-
}
|
109
|
-
}
|
110
|
-
},
|
111
|
-
"11.5.0": {
|
112
|
-
"version": "11.5.0-beta.0",
|
113
|
-
"packages": {
|
114
|
-
"eslint-config-prettier": {
|
115
|
-
"version": "8.1.0",
|
116
|
-
"alwaysAddToPackageJson": false
|
117
|
-
}
|
118
|
-
}
|
119
|
-
},
|
120
|
-
"11.6.0": {
|
121
|
-
"version": "11.6.0-beta.1",
|
122
|
-
"packages": {
|
123
|
-
"@typescript-eslint/parser": {
|
124
|
-
"version": "4.19.0",
|
125
|
-
"alwaysAddToPackageJson": false
|
126
|
-
},
|
127
|
-
"@typescript-eslint/eslint-plugin": {
|
128
|
-
"version": "4.19.0",
|
129
|
-
"alwaysAddToPackageJson": false
|
130
|
-
},
|
131
|
-
"eslint": {
|
132
|
-
"version": "7.22.0",
|
133
|
-
"alwaysAddToPackageJson": false
|
134
|
-
}
|
135
|
-
}
|
136
|
-
},
|
137
65
|
"12.6.0": {
|
138
66
|
"version": "12.6.0-beta.8",
|
139
67
|
"packages": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nrwl/linter",
|
3
|
-
"version": "14.
|
3
|
+
"version": "14.9.0-beta.1",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Linter plugin for Nx contains executors, generators and utilities used for linting JavaScript/TypeScript projects within an Nx workspace.",
|
6
6
|
"repository": {
|
@@ -12,7 +12,6 @@
|
|
12
12
|
"Monorepo",
|
13
13
|
"Web",
|
14
14
|
"Lint",
|
15
|
-
"TSLint",
|
16
15
|
"ESLint",
|
17
16
|
"CLI"
|
18
17
|
],
|
@@ -34,10 +33,9 @@
|
|
34
33
|
"eslint": "^8.0.0"
|
35
34
|
},
|
36
35
|
"dependencies": {
|
37
|
-
"@nrwl/devkit": "14.
|
38
|
-
"@nrwl/
|
36
|
+
"@nrwl/devkit": "14.9.0-beta.1",
|
37
|
+
"@nrwl/js": "14.9.0-beta.1",
|
39
38
|
"@phenomnomnominal/tsquery": "4.1.1",
|
40
|
-
"nx": "14.8.7",
|
41
39
|
"tmp": "~0.2.1",
|
42
40
|
"tslib": "^2.3.0"
|
43
41
|
},
|
@@ -50,5 +48,5 @@
|
|
50
48
|
"access": "public"
|
51
49
|
},
|
52
50
|
"types": "./index.d.ts",
|
53
|
-
"gitHead": "
|
51
|
+
"gitHead": "b2a467bcb2bdc124ed52f3755780bca429a43855"
|
54
52
|
}
|
@@ -8,7 +8,7 @@ function run(task, context) {
|
|
8
8
|
return res;
|
9
9
|
}
|
10
10
|
const deps = allDeps(task.id, context.taskGraph, context.projectGraph);
|
11
|
-
const tags = context.hasher.hashArray(deps.map((d) => (context.
|
11
|
+
const tags = context.hasher.hashArray(deps.map((d) => (context.projectsConfigurations.projects[d].tags || []).join('|')));
|
12
12
|
const command = res.details['command'];
|
13
13
|
let selfSource = '';
|
14
14
|
for (let n of Object.keys(res.details)) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hasher.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/executors/eslint/hasher.ts"],"names":[],"mappings":";;;AASA,SAA8B,GAAG,CAC/B,IAAU,EACV,OAKC;;QAED,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,IAAI,EAAE;YAChD,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CACnC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"hasher.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/executors/eslint/hasher.ts"],"names":[],"mappings":";;;AASA,SAA8B,GAAG,CAC/B,IAAU,EACV,OAKC;;QAED,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,IAAI,EAAE;YAChD,OAAO,GAAG,CAAC;SACZ;QAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,EAA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YACvE,OAAO,EAAE;gBACP,OAAO;gBACP,KAAK,kBAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,IAAK,KAAK,CAAE;aAC7D;SACF,CAAC;IACJ,CAAC;CAAA;AA5CD,sBA4CC;AAED,SAAS,OAAO,CACd,MAAc,EACd,SAAoB,EACpB,YAA0B;IAE1B,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;QACpB,OAAO,EAAE,CAAC;KACX;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;IACvD,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC;SACpD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;SAC7C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACxB,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
@@ -46,8 +46,8 @@ function run(options, context) {
|
|
46
46
|
catch (err) {
|
47
47
|
if (err.message.includes('You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser')) {
|
48
48
|
let eslintConfigPathForError = `for ${projectName}`;
|
49
|
-
if ((_e = (_d = (_c = context.
|
50
|
-
const { root } = context.
|
49
|
+
if ((_e = (_d = (_c = context.projectsConfigurations) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d[projectName]) === null || _e === void 0 ? void 0 : _e.root) {
|
50
|
+
const { root } = context.projectsConfigurations.projects[projectName];
|
51
51
|
eslintConfigPathForError = `\`${root}/.eslintrc.json\``;
|
52
52
|
}
|
53
53
|
console.error(`
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lint.impl.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/executors/eslint/lint.imp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K,CAAC,CAAC,IAAI,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;SAC1E,CAAC;;CACH;AArJD,sBAqJC"}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
{
|
2
|
+
"version": 2,
|
3
|
+
"outputCapture": "direct-nodejs",
|
2
4
|
"$schema": "http://json-schema.org/schema",
|
3
5
|
"title": "ESLint Lint Target",
|
4
6
|
"description": "ESLint Lint Target.",
|
@@ -9,7 +11,8 @@
|
|
9
11
|
"type": "string",
|
10
12
|
"description": "The name of the ESLint configuration file.",
|
11
13
|
"x-completion-type": "file",
|
12
|
-
"x-completion-glob": ".eslintrc?(.json)"
|
14
|
+
"x-completion-glob": ".eslintrc?(.json)",
|
15
|
+
"x-priority": "important"
|
13
16
|
},
|
14
17
|
"lintFilePatterns": {
|
15
18
|
"type": "array",
|
@@ -44,7 +47,8 @@
|
|
44
47
|
{
|
45
48
|
"minLength": 1
|
46
49
|
}
|
47
|
-
]
|
50
|
+
],
|
51
|
+
"x-priority": "important"
|
48
52
|
},
|
49
53
|
"force": {
|
50
54
|
"type": "boolean",
|
@@ -59,7 +63,8 @@
|
|
59
63
|
"fix": {
|
60
64
|
"type": "boolean",
|
61
65
|
"description": "Fixes linting errors (may overwrite linted files).",
|
62
|
-
"default": false
|
66
|
+
"default": false,
|
67
|
+
"x-priority": "important"
|
63
68
|
},
|
64
69
|
"cache": {
|
65
70
|
"type": "boolean",
|
@@ -85,7 +90,8 @@
|
|
85
90
|
"quiet": {
|
86
91
|
"type": "boolean",
|
87
92
|
"description": "Report errors only - default: `false`.",
|
88
|
-
"default": false
|
93
|
+
"default": false,
|
94
|
+
"x-priority": "important"
|
89
95
|
},
|
90
96
|
"ignorePath": {
|
91
97
|
"type": "string",
|
@@ -124,10 +130,10 @@
|
|
124
130
|
},
|
125
131
|
"reportUnusedDisableDirectives": {
|
126
132
|
"type": "string",
|
127
|
-
"default": "off",
|
128
133
|
"enum": ["off", "warn", "error"],
|
129
134
|
"description": "The equivalent of the `--report-unused-disable-directives` flag on the ESLint CLI."
|
130
135
|
}
|
131
136
|
},
|
132
|
-
"required": ["lintFilePatterns"]
|
137
|
+
"required": ["lintFilePatterns"],
|
138
|
+
"examplesFile": "../../../docs/eslint-examples.md"
|
133
139
|
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { ESLint, Linter as LinterType } from 'eslint';
|
2
|
+
/**
|
3
|
+
* This configuration is intended to apply to all TypeScript source files.
|
4
|
+
* See the eslint-plugin-nx package for what is in the referenced shareable config.
|
5
|
+
*/
|
6
|
+
export declare const globalTypeScriptOverrides: {
|
7
|
+
files: string[];
|
8
|
+
extends: string[];
|
9
|
+
/**
|
10
|
+
* Having an empty rules object present makes it more obvious to the user where they would
|
11
|
+
* extend things from if they needed to
|
12
|
+
*/
|
13
|
+
rules: {};
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* This configuration is intended to apply to all JavaScript source files.
|
17
|
+
* See the eslint-plugin-nx package for what is in the referenced shareable config.
|
18
|
+
*/
|
19
|
+
export declare const globalJavaScriptOverrides: {
|
20
|
+
files: string[];
|
21
|
+
extends: string[];
|
22
|
+
/**
|
23
|
+
* Having an empty rules object present makes it more obvious to the user where they would
|
24
|
+
* extend things from if they needed to
|
25
|
+
*/
|
26
|
+
rules: {};
|
27
|
+
};
|
28
|
+
/**
|
29
|
+
* This configuration is intended to apply to all "source code" (but not
|
30
|
+
* markup like HTML, or other custom file types like GraphQL)
|
31
|
+
*/
|
32
|
+
export declare const moduleBoundariesOverride: {
|
33
|
+
files: string[];
|
34
|
+
rules: LinterType.RulesRecord;
|
35
|
+
};
|
36
|
+
export declare const getGlobalEsLintConfiguration: (unitTestRunner?: string, rootProject?: boolean) => ESLint.ConfigData<LinterType.RulesRecord>;
|
@@ -0,0 +1,77 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getGlobalEsLintConfiguration = exports.moduleBoundariesOverride = exports.globalJavaScriptOverrides = exports.globalTypeScriptOverrides = void 0;
|
4
|
+
/**
|
5
|
+
* This configuration is intended to apply to all TypeScript source files.
|
6
|
+
* See the eslint-plugin-nx package for what is in the referenced shareable config.
|
7
|
+
*/
|
8
|
+
exports.globalTypeScriptOverrides = {
|
9
|
+
files: ['*.ts', '*.tsx'],
|
10
|
+
extends: ['plugin:@nrwl/nx/typescript'],
|
11
|
+
/**
|
12
|
+
* Having an empty rules object present makes it more obvious to the user where they would
|
13
|
+
* extend things from if they needed to
|
14
|
+
*/
|
15
|
+
rules: {},
|
16
|
+
};
|
17
|
+
/**
|
18
|
+
* This configuration is intended to apply to all JavaScript source files.
|
19
|
+
* See the eslint-plugin-nx package for what is in the referenced shareable config.
|
20
|
+
*/
|
21
|
+
exports.globalJavaScriptOverrides = {
|
22
|
+
files: ['*.js', '*.jsx'],
|
23
|
+
extends: ['plugin:@nrwl/nx/javascript'],
|
24
|
+
/**
|
25
|
+
* Having an empty rules object present makes it more obvious to the user where they would
|
26
|
+
* extend things from if they needed to
|
27
|
+
*/
|
28
|
+
rules: {},
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* This configuration is intended to apply to all "source code" (but not
|
32
|
+
* markup like HTML, or other custom file types like GraphQL)
|
33
|
+
*/
|
34
|
+
exports.moduleBoundariesOverride = {
|
35
|
+
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
36
|
+
rules: {
|
37
|
+
'@nrwl/nx/enforce-module-boundaries': [
|
38
|
+
'error',
|
39
|
+
{
|
40
|
+
enforceBuildableLibDependency: true,
|
41
|
+
allow: [],
|
42
|
+
depConstraints: [{ sourceTag: '*', onlyDependOnLibsWithTags: ['*'] }],
|
43
|
+
},
|
44
|
+
],
|
45
|
+
},
|
46
|
+
};
|
47
|
+
const getGlobalEsLintConfiguration = (unitTestRunner, rootProject) => {
|
48
|
+
const config = {
|
49
|
+
root: true,
|
50
|
+
ignorePatterns: rootProject ? ['!**/*'] : ['**/*'],
|
51
|
+
plugins: ['@nrwl/nx'],
|
52
|
+
/**
|
53
|
+
* We leverage ESLint's "overrides" capability so that we can set up a root config which will support
|
54
|
+
* all permutations of Nx workspaces across all frameworks, libraries and tools.
|
55
|
+
*
|
56
|
+
* The key point is that we need entirely different ESLint config to apply to different types of files,
|
57
|
+
* but we still want to share common config where possible.
|
58
|
+
*/
|
59
|
+
overrides: [
|
60
|
+
...(rootProject ? [] : [exports.moduleBoundariesOverride]),
|
61
|
+
exports.globalTypeScriptOverrides,
|
62
|
+
exports.globalJavaScriptOverrides,
|
63
|
+
],
|
64
|
+
};
|
65
|
+
if (unitTestRunner === 'jest') {
|
66
|
+
config.overrides.push({
|
67
|
+
files: ['*.spec.ts', '*.spec.tsx', '*.spec.js', '*.spec.jsx'],
|
68
|
+
env: {
|
69
|
+
jest: true,
|
70
|
+
},
|
71
|
+
rules: {},
|
72
|
+
});
|
73
|
+
}
|
74
|
+
return config;
|
75
|
+
};
|
76
|
+
exports.getGlobalEsLintConfiguration = getGlobalEsLintConfiguration;
|
77
|
+
//# sourceMappingURL=global-eslint-config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"global-eslint-config.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/global-eslint-config.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACU,QAAA,yBAAyB,GAAG;IACvC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,CAAC,4BAA4B,CAAC;IACvC;;;OAGG;IACH,KAAK,EAAE,EAAE;CACV,CAAC;AAEF;;;GAGG;AACU,QAAA,yBAAyB,GAAG;IACvC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,CAAC,4BAA4B,CAAC;IACvC;;;OAGG;IACH,KAAK,EAAE,EAAE;CACV,CAAC;AAEF;;;GAGG;AACU,QAAA,wBAAwB,GAAG;IACtC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;IACzC,KAAK,EAAE;QACL,oCAAoC,EAAE;YACpC,OAAO;YACP;gBACE,6BAA6B,EAAE,IAAI;gBACnC,KAAK,EAAE,EAAE;gBACT,cAAc,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,wBAAwB,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;aACtE;SACF;KACwB;CAC5B,CAAC;AAEK,MAAM,4BAA4B,GAAG,CAC1C,cAAuB,EACvB,WAAqB,EACrB,EAAE;IACF,MAAM,MAAM,GAAsB;QAChC,IAAI,EAAE,IAAI;QACV,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAClD,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB;;;;;;WAMG;QACH,SAAS,EAAE;YACT,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,gCAAwB,CAAC,CAAC;YAClD,iCAAyB;YACzB,iCAAyB;SAC1B;KACF,CAAC;IACF,IAAI,cAAc,KAAK,MAAM,EAAE;QAC7B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC;YACpB,KAAK,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC;YAC7D,GAAG,EAAE;gBACH,IAAI,EAAE,IAAI;aACX;YACD,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;KACJ;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA/BW,QAAA,4BAA4B,gCA+BvC"}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { ProjectConfiguration, TargetConfiguration, Tree } from '@nrwl/devkit';
|
2
|
+
export declare function migrateConfigToMonorepoStyle(projects: ProjectConfiguration[], tree: Tree, unitTestRunner: string): void;
|
3
|
+
export declare function findLintTarget(project: ProjectConfiguration): TargetConfiguration;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.findLintTarget = exports.migrateConfigToMonorepoStyle = void 0;
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
5
|
+
const path_1 = require("path");
|
6
|
+
const eslint_file_1 = require("../utils/eslint-file");
|
7
|
+
const global_eslint_config_1 = require("./global-eslint-config");
|
8
|
+
function migrateConfigToMonorepoStyle(projects, tree, unitTestRunner) {
|
9
|
+
(0, devkit_1.writeJson)(tree, '.eslintrc.base.json', (0, global_eslint_config_1.getGlobalEsLintConfiguration)(unitTestRunner));
|
10
|
+
// update extens in all projects' eslint configs
|
11
|
+
projects.forEach((project) => {
|
12
|
+
const lintTarget = findLintTarget(project);
|
13
|
+
if (lintTarget) {
|
14
|
+
const projectEslintPath = (0, devkit_1.joinPathFragments)(project.root, lintTarget.options.eslintConfig || (0, eslint_file_1.findEslintFile)(tree, project.root));
|
15
|
+
migrateEslintFile(projectEslintPath, tree);
|
16
|
+
}
|
17
|
+
});
|
18
|
+
}
|
19
|
+
exports.migrateConfigToMonorepoStyle = migrateConfigToMonorepoStyle;
|
20
|
+
function findLintTarget(project) {
|
21
|
+
var _a, _b;
|
22
|
+
return (_b = Object.entries((_a = project.targets) !== null && _a !== void 0 ? _a : {}).find(([name, target]) => name === 'lint' || target.executor === '@nrwl/linter:eslint')) === null || _b === void 0 ? void 0 : _b[1];
|
23
|
+
}
|
24
|
+
exports.findLintTarget = findLintTarget;
|
25
|
+
function migrateEslintFile(projectEslintPath, tree) {
|
26
|
+
if (projectEslintPath.endsWith('.json') ||
|
27
|
+
projectEslintPath.endsWith('.eslintrc')) {
|
28
|
+
(0, devkit_1.updateJson)(tree, projectEslintPath, (json) => {
|
29
|
+
// we have a new root now
|
30
|
+
delete json.root;
|
31
|
+
// remove nrwl/nx plugins
|
32
|
+
if (json.plugins) {
|
33
|
+
json.plugins = json.plugins.filter((p) => p !== '@nrwl/nx');
|
34
|
+
if (json.plugins.length === 0) {
|
35
|
+
delete json.plugins;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
// add extends
|
39
|
+
json.extends = json.extends || [];
|
40
|
+
const pathToRootConfig = `${(0, devkit_1.offsetFromRoot)((0, path_1.dirname)(projectEslintPath))}.eslintrc.base.json`;
|
41
|
+
if (json.extends.indexOf(pathToRootConfig) === -1) {
|
42
|
+
json.extends.push(pathToRootConfig);
|
43
|
+
}
|
44
|
+
// cleanup overrides
|
45
|
+
if (json.overrides) {
|
46
|
+
json.overrides.forEach((override) => {
|
47
|
+
if (override.extends) {
|
48
|
+
override.extends = override.extends.filter((ext) => ext !== 'plugin:@nrwl/nx/typescript' &&
|
49
|
+
ext !== 'plugin:@nrwl/nx/javascript');
|
50
|
+
if (override.extends.length === 0) {
|
51
|
+
delete override.extends;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
});
|
55
|
+
}
|
56
|
+
return json;
|
57
|
+
});
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
if (projectEslintPath.endsWith('.yml') ||
|
61
|
+
projectEslintPath.endsWith('.yaml')) {
|
62
|
+
console.warn('YAML eslint config is not supported yet for migration');
|
63
|
+
}
|
64
|
+
if (projectEslintPath.endsWith('.js') || projectEslintPath.endsWith('.cjs')) {
|
65
|
+
console.warn('YAML eslint config is not supported yet for migration');
|
66
|
+
}
|
67
|
+
}
|
68
|
+
//# sourceMappingURL=init-migration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"init-migration.js","sourceRoot":"","sources":["../../../../../../packages/linter/src/generators/init/init-migration.ts"],"names":[],"mappings":";;;AAAA,yCAQsB;AACtB,+BAA+B;AAC/B,sDAAsD;AACtD,iEAAsE;AAEtE,SAAgB,4BAA4B,CAC1C,QAAgC,EAChC,IAAU,EACV,cAAsB;IAEtB,IAAA,kBAAS,EACP,IAAI,EACJ,qBAAqB,EACrB,IAAA,mDAA4B,EAAC,cAAc,CAAC,CAC7C,CAAC;IAEF,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,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