@nx/eslint-plugin 22.0.0-beta.0 → 22.0.0-beta.2
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 +1 -8
- package/package.json +3 -3
- package/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.d.ts +0 -3
- package/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.d.ts.map +0 -1
- package/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.js +0 -59
package/migrations.json
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generators": {
|
|
3
|
-
"update-19-1-0-rename-no-extra-semi": {
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"version": "19.1.0-beta.6",
|
|
6
|
-
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
|
|
7
|
-
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
2
|
+
"generators": {},
|
|
10
3
|
"packageJsonUpdates": {},
|
|
11
4
|
"version": "0.1"
|
|
12
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/eslint-plugin",
|
|
3
|
-
"version": "22.0.0-beta.
|
|
3
|
+
"version": "22.0.0-beta.2",
|
|
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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "22.0.0-beta.
|
|
38
|
-
"@nx/js": "22.0.0-beta.
|
|
37
|
+
"@nx/devkit": "22.0.0-beta.2",
|
|
38
|
+
"@nx/js": "22.0.0-beta.2",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
40
40
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
41
41
|
"@typescript-eslint/utils": "^8.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-no-extra-semi.d.ts","sourceRoot":"","sources":["../../../../../../packages/eslint-plugin/src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAIL,MAAM,YAAY,CAAC;AAEpB,wBAA8B,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC/D"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = migrate;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
async function migrate(tree) {
|
|
6
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (path) => {
|
|
7
|
-
if (!path.endsWith('.eslintrc.json')) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
// Cheap check to see if the file contains references to the nx TS or JS eslint configs
|
|
11
|
-
const fileContents = tree.read(path, 'utf-8');
|
|
12
|
-
if (!fileContents.includes('@nx/typescript') &&
|
|
13
|
-
!fileContents.includes('@nx/javascript')) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
let wasUpdated = false;
|
|
17
|
-
(0, devkit_1.updateJson)(tree, path, (json) => {
|
|
18
|
-
// Update top level config
|
|
19
|
-
wasUpdated = addNoExtraSemiExplicitly(json);
|
|
20
|
-
// Update overrides
|
|
21
|
-
if (json.overrides) {
|
|
22
|
-
for (const override of json.overrides) {
|
|
23
|
-
const overrideUpdated = addNoExtraSemiExplicitly(override);
|
|
24
|
-
wasUpdated = wasUpdated || overrideUpdated;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return json;
|
|
28
|
-
});
|
|
29
|
-
if (wasUpdated) {
|
|
30
|
-
console.warn(`NOTE: The configuration for @typescript-eslint/no-extra-semi and no-extra-semi that you were previously inheriting from the Nx eslint-plugin has been explicitly added to your ${path} file.
|
|
31
|
-
|
|
32
|
-
This is because those rules have been migrated to the https://eslint.style/ project (for stylistic only rules) and will no longer work in v8 of typescript-eslint. Having them explicitly in your config will make it easier for you to handle the transition, either by starting to use the ESLint Stylistic plugin, or removing the rules from your config.`);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @returns {boolean} whether the json was updated
|
|
39
|
-
*/
|
|
40
|
-
function addNoExtraSemiExplicitly(json) {
|
|
41
|
-
let wasUpdated = false;
|
|
42
|
-
if (!json.extends?.includes('@nx/typescript') &&
|
|
43
|
-
!json.extends?.includes('plugin:@nx/typescript') &&
|
|
44
|
-
!json.extends?.includes('@nx/javascript') &&
|
|
45
|
-
!json.extends?.includes('plugin:@nx/javascript')) {
|
|
46
|
-
return wasUpdated;
|
|
47
|
-
}
|
|
48
|
-
if (!json.rules?.['@typescript-eslint/no-extra-semi']) {
|
|
49
|
-
json.rules ??= {};
|
|
50
|
-
json.rules['@typescript-eslint/no-extra-semi'] = 'error';
|
|
51
|
-
wasUpdated = true;
|
|
52
|
-
}
|
|
53
|
-
if (!json.rules?.['no-extra-semi']) {
|
|
54
|
-
json.rules ??= {};
|
|
55
|
-
json.rules['no-extra-semi'] = 'off';
|
|
56
|
-
wasUpdated = true;
|
|
57
|
-
}
|
|
58
|
-
return wasUpdated;
|
|
59
|
-
}
|