@nx/eslint-plugin 20.0.0-beta.5 → 20.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +0 -6
- package/package.json +3 -3
- package/src/configs/javascript.d.ts +2 -2
- package/src/configs/javascript.js +2 -2
- package/src/configs/typescript.d.ts +2 -2
- package/src/configs/typescript.js +2 -2
- package/src/flat-configs/javascript.js +2 -2
- package/src/flat-configs/typescript.js +2 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -43
package/migrations.json
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generators": {
|
|
3
|
-
"update-16-0-0-add-nx-packages": {
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"version": "16.0.0-beta.1",
|
|
6
|
-
"description": "Replace @nrwl/eslint-plugin-nx with @nx/eslint-plugin",
|
|
7
|
-
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
8
|
-
},
|
|
9
3
|
"update-17-2-6-rename-workspace-rules": {
|
|
10
4
|
"cli": "nx",
|
|
11
5
|
"version": "17.2.6-beta.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint-plugin",
|
|
3
|
-
"version": "20.0.0-beta.
|
|
3
|
+
"version": "20.0.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"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.",
|
|
6
6
|
"repository": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@eslint/compat": "^1.1.1",
|
|
38
|
-
"@nx/devkit": "20.0.0-beta.
|
|
39
|
-
"@nx/js": "20.0.0-beta.
|
|
38
|
+
"@nx/devkit": "20.0.0-beta.7",
|
|
39
|
+
"@nx/js": "20.0.0-beta.7",
|
|
40
40
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
41
41
|
"@typescript-eslint/utils": "^8.0.0",
|
|
42
42
|
"chalk": "^4.1.0",
|
|
@@ -44,7 +44,7 @@ declare const _default: {
|
|
|
44
44
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
45
45
|
* changed how configurations are defined.
|
|
46
46
|
*
|
|
47
|
-
* TODO(
|
|
47
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
48
48
|
*/
|
|
49
49
|
'@typescript-eslint/no-non-null-assertion': string;
|
|
50
50
|
'@typescript-eslint/adjacent-overload-signatures': string;
|
|
@@ -59,7 +59,7 @@ declare const _default: {
|
|
|
59
59
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
60
60
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
61
61
|
*
|
|
62
|
-
* TODO(
|
|
62
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
63
63
|
*/
|
|
64
64
|
'@typescript-eslint/no-require-imports': string;
|
|
65
65
|
};
|
|
@@ -53,7 +53,7 @@ exports.default = {
|
|
|
53
53
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
54
54
|
* changed how configurations are defined.
|
|
55
55
|
*
|
|
56
|
-
* TODO(
|
|
56
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
57
57
|
*/
|
|
58
58
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
59
59
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
@@ -68,7 +68,7 @@ exports.default = {
|
|
|
68
68
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
69
69
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
70
70
|
*
|
|
71
|
-
* TODO(
|
|
71
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
72
72
|
*/
|
|
73
73
|
'@typescript-eslint/no-require-imports': 'off',
|
|
74
74
|
},
|
|
@@ -26,7 +26,7 @@ declare const _default: {
|
|
|
26
26
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
27
27
|
* changed how configurations are defined.
|
|
28
28
|
*
|
|
29
|
-
* TODO(
|
|
29
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
30
30
|
*/
|
|
31
31
|
'@typescript-eslint/no-non-null-assertion': string;
|
|
32
32
|
'@typescript-eslint/adjacent-overload-signatures': string;
|
|
@@ -41,7 +41,7 @@ declare const _default: {
|
|
|
41
41
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
42
42
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
43
43
|
*
|
|
44
|
-
* TODO(
|
|
44
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
45
45
|
*/
|
|
46
46
|
'@typescript-eslint/no-require-imports': string;
|
|
47
47
|
};
|
|
@@ -36,7 +36,7 @@ exports.default = {
|
|
|
36
36
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
37
37
|
* changed how configurations are defined.
|
|
38
38
|
*
|
|
39
|
-
* TODO(
|
|
39
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
40
40
|
*/
|
|
41
41
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
42
42
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
@@ -51,7 +51,7 @@ exports.default = {
|
|
|
51
51
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
52
52
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
53
53
|
*
|
|
54
|
-
* TODO(
|
|
54
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
55
55
|
*/
|
|
56
56
|
'@typescript-eslint/no-require-imports': 'off',
|
|
57
57
|
},
|
|
@@ -53,7 +53,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
|
|
|
53
53
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
54
54
|
* changed how configurations are defined.
|
|
55
55
|
*
|
|
56
|
-
* TODO(
|
|
56
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
57
57
|
*/
|
|
58
58
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
59
59
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
@@ -68,7 +68,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
|
|
|
68
68
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
69
69
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
70
70
|
*
|
|
71
|
-
* TODO(
|
|
71
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
72
72
|
*/
|
|
73
73
|
'@typescript-eslint/no-require-imports': 'off',
|
|
74
74
|
},
|
|
@@ -37,7 +37,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
|
|
|
37
37
|
* previously defined v5 of `@typescript-eslint`. v6 of `@typescript-eslint`
|
|
38
38
|
* changed how configurations are defined.
|
|
39
39
|
*
|
|
40
|
-
* TODO(
|
|
40
|
+
* TODO(eslint): re-evalute these deviations from @typescript-eslint/recommended in v20 of Nx
|
|
41
41
|
*/
|
|
42
42
|
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
43
43
|
'@typescript-eslint/adjacent-overload-signatures': 'error',
|
|
@@ -52,7 +52,7 @@ exports.default = typescript_eslint_1.default.config(js_1.default.configs.recomm
|
|
|
52
52
|
* During the migration to use ESLint v9 and typescript-eslint v8 for new workspaces,
|
|
53
53
|
* this rule would have created a lot of noise, so we are disabling it by default for now.
|
|
54
54
|
*
|
|
55
|
-
* TODO(
|
|
55
|
+
* TODO(eslint): we should make this part of what we re-evaluate in v20
|
|
56
56
|
*/
|
|
57
57
|
'@typescript-eslint/no-require-imports': 'off',
|
|
58
58
|
},
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = replacePackage;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const replace_package_1 = require("@nx/devkit/src/utils/replace-package");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const binary_extensions_1 = require("@nx/devkit/src/utils/binary-extensions");
|
|
8
|
-
const eslintFileNames = [
|
|
9
|
-
'.eslintrc',
|
|
10
|
-
'.eslintrc.js',
|
|
11
|
-
'.eslintrc.cjs',
|
|
12
|
-
'.eslintrc.yaml',
|
|
13
|
-
'.eslintrc.yml',
|
|
14
|
-
'.eslintrc.json',
|
|
15
|
-
'eslint.config.js', // new format that requires `ESLINT_USE_FLAT_CONFIG=true`
|
|
16
|
-
];
|
|
17
|
-
async function replacePackage(tree) {
|
|
18
|
-
await (0, replace_package_1.replaceNrwlPackageWithNxPackage)(tree, '@nrwl/eslint-plugin-nx', '@nx/eslint-plugin');
|
|
19
|
-
/**
|
|
20
|
-
* Matches:
|
|
21
|
-
* * // eslint-disable-next-line @nrwl/nx/...
|
|
22
|
-
* * // eslint-disable-line @nrwl/nx/...
|
|
23
|
-
* * /* eslint-disable @nrwl/nx/...
|
|
24
|
-
*/
|
|
25
|
-
const ignoreLineRegex = /(eslint-disable(?:(?:-next)?-line)?\s*)@nrwl\/nx/g;
|
|
26
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (path) => {
|
|
27
|
-
if ((0, binary_extensions_1.isBinaryPath)(path)) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
let contents = tree.read(path).toString();
|
|
31
|
-
if (eslintFileNames.includes((0, path_1.basename)(path))) {
|
|
32
|
-
if (!contents.includes('@nrwl/nx')) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
contents = contents.replace(new RegExp('@nrwl/nx', 'g'), '@nx');
|
|
36
|
-
}
|
|
37
|
-
if (ignoreLineRegex.test(contents)) {
|
|
38
|
-
contents = contents.replace(ignoreLineRegex, '$1@nx');
|
|
39
|
-
}
|
|
40
|
-
tree.write(path, contents);
|
|
41
|
-
});
|
|
42
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
43
|
-
}
|