@o3r/eslint-config 12.5.0-prerelease.5 → 12.5.0-prerelease.50
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/package.json +20 -15
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +52 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/eslint-config",
|
|
3
|
-
"version": "12.5.0-prerelease.
|
|
3
|
+
"version": "12.5.0-prerelease.50",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
40
|
+
"@o3r/schematics": "^12.5.0-prerelease.50"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@angular-devkit/core": "^19.0.0",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@angular/compiler": "^19.0.0",
|
|
47
47
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
48
48
|
"@eslint/js": "^8.57.0 || ^9.22.0",
|
|
49
|
-
"@o3r/eslint-plugin": "^12.5.0-prerelease.
|
|
50
|
-
"@o3r/schematics": "^12.5.0-prerelease.
|
|
49
|
+
"@o3r/eslint-plugin": "^12.5.0-prerelease.50",
|
|
50
|
+
"@o3r/schematics": "^12.5.0-prerelease.50",
|
|
51
51
|
"@schematics/angular": "^19.0.0",
|
|
52
52
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
53
53
|
"@typescript-eslint/parser": "^8.15.0",
|
|
@@ -71,32 +71,33 @@
|
|
|
71
71
|
"ts-node": "^10.9.2",
|
|
72
72
|
"type-fest": "^4.30.1",
|
|
73
73
|
"typescript": "^5.5.4",
|
|
74
|
-
"typescript-eslint": "^8.15.0"
|
|
74
|
+
"typescript-eslint": "^8.15.0",
|
|
75
|
+
"yaml-eslint-parser": "^1.2.2"
|
|
75
76
|
},
|
|
76
77
|
"devDependencies": {
|
|
77
78
|
"@angular-devkit/core": "~19.2.0",
|
|
78
79
|
"@angular-devkit/schematics": "~19.2.0",
|
|
79
80
|
"@angular/compiler": "~19.2.0",
|
|
80
81
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
81
|
-
"@eslint/js": "~9.
|
|
82
|
+
"@eslint/js": "~9.33.0",
|
|
82
83
|
"@nx/eslint-plugin": "~20.8.0",
|
|
83
|
-
"@o3r/build-helpers": "^12.5.0-prerelease.
|
|
84
|
-
"@o3r/eslint-plugin": "^12.5.0-prerelease.
|
|
85
|
-
"@o3r/test-helpers": "^12.5.0-prerelease.
|
|
84
|
+
"@o3r/build-helpers": "^12.5.0-prerelease.50",
|
|
85
|
+
"@o3r/eslint-plugin": "^12.5.0-prerelease.50",
|
|
86
|
+
"@o3r/test-helpers": "^12.5.0-prerelease.50",
|
|
86
87
|
"@schematics/angular": "~19.2.0",
|
|
87
88
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
88
89
|
"@types/eslint__js": "^8.42.3",
|
|
89
90
|
"@types/jest": "~29.5.2",
|
|
90
91
|
"@types/node": "^20.0.0",
|
|
91
|
-
"@typescript-eslint/parser": "~8.
|
|
92
|
+
"@typescript-eslint/parser": "~8.39.0",
|
|
92
93
|
"angular-eslint": "~19.4.0",
|
|
93
94
|
"cpy-cli": "^5.0.0",
|
|
94
|
-
"eslint": "~9.
|
|
95
|
+
"eslint": "~9.33.0",
|
|
95
96
|
"eslint-import-resolver-node": "~0.3.9",
|
|
96
97
|
"eslint-import-resolver-typescript": "~3.10.0",
|
|
97
|
-
"eslint-plugin-import": "~2.
|
|
98
|
+
"eslint-plugin-import": "~2.32.0",
|
|
98
99
|
"eslint-plugin-import-newlines": "~1.4.0",
|
|
99
|
-
"eslint-plugin-jest": "~28.
|
|
100
|
+
"eslint-plugin-jest": "~28.14.0",
|
|
100
101
|
"eslint-plugin-jsdoc": "~50.8.0",
|
|
101
102
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
102
103
|
"eslint-plugin-unicorn": "~56.0.0",
|
|
@@ -104,17 +105,18 @@
|
|
|
104
105
|
"globals": "^15.9.0",
|
|
105
106
|
"jest": "~29.7.0",
|
|
106
107
|
"jest-junit": "~16.0.0",
|
|
108
|
+
"jest-util": "~29.7.0",
|
|
107
109
|
"jsonc-eslint-parser": "~2.4.0",
|
|
108
110
|
"nx": "~20.8.0",
|
|
109
111
|
"pid-from-port": "^1.1.3",
|
|
110
112
|
"rxjs": "^7.8.1",
|
|
111
113
|
"semver": "^7.5.2",
|
|
112
|
-
"ts-jest": "~29.
|
|
114
|
+
"ts-jest": "~29.4.0",
|
|
113
115
|
"ts-node": "~10.9.2",
|
|
114
116
|
"tslib": "^2.6.2",
|
|
115
117
|
"type-fest": "^4.30.1",
|
|
116
118
|
"typescript": "~5.8.2",
|
|
117
|
-
"typescript-eslint": "~8.
|
|
119
|
+
"typescript-eslint": "~8.39.0"
|
|
118
120
|
},
|
|
119
121
|
"peerDependenciesMeta": {
|
|
120
122
|
"@angular-devkit/core": {
|
|
@@ -155,6 +157,9 @@
|
|
|
155
157
|
},
|
|
156
158
|
"typescript": {
|
|
157
159
|
"optional": true
|
|
160
|
+
},
|
|
161
|
+
"yaml-eslint-parser": {
|
|
162
|
+
"optional": true
|
|
158
163
|
}
|
|
159
164
|
},
|
|
160
165
|
"schematics": "./collection.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EAIV,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,IAAI,EAIV,MAAM,4BAA4B,CAAC;AAkBpC,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,UAAU,CAAC;AA4JlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -6,6 +6,37 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
6
6
|
const schematics_2 = require("@o3r/schematics");
|
|
7
7
|
const index_1 = require("./eslint/index");
|
|
8
8
|
const index_2 = require("./vscode/index");
|
|
9
|
+
/**
|
|
10
|
+
* List of external dependencies to be added to the project as peer dependencies
|
|
11
|
+
*/
|
|
12
|
+
const dependenciesToInstall = [];
|
|
13
|
+
/**
|
|
14
|
+
* List of external dependencies to be added to the project as dev dependencies
|
|
15
|
+
*/
|
|
16
|
+
const devDependenciesToInstall = [
|
|
17
|
+
'@eslint/js',
|
|
18
|
+
'@eslint-community/eslint-plugin-eslint-comments',
|
|
19
|
+
'@stylistic/eslint-plugin',
|
|
20
|
+
'@typescript-eslint/parser',
|
|
21
|
+
'@typescript-eslint/utils',
|
|
22
|
+
'@typescript-eslint/types',
|
|
23
|
+
'angular-eslint',
|
|
24
|
+
'eslint',
|
|
25
|
+
'eslint-import-resolver-node',
|
|
26
|
+
'eslint-import-resolver-typescript',
|
|
27
|
+
'eslint-plugin-import',
|
|
28
|
+
'eslint-plugin-import-newlines',
|
|
29
|
+
'eslint-plugin-jsdoc',
|
|
30
|
+
'eslint-plugin-prefer-arrow',
|
|
31
|
+
'eslint-plugin-unicorn',
|
|
32
|
+
'eslint-plugin-unused-imports',
|
|
33
|
+
'globals',
|
|
34
|
+
'globby',
|
|
35
|
+
'jsonc-eslint-parser',
|
|
36
|
+
'typescript-eslint'
|
|
37
|
+
// TODO: reactivate once https://github.com/nirtamir2/eslint-plugin-sort-export-all/issues/18 is fixed
|
|
38
|
+
// 'eslint-plugin-sort-export-all',
|
|
39
|
+
];
|
|
9
40
|
const handleOtterEslintErrors = (projectName) => (tree, context) => {
|
|
10
41
|
if (!projectName) {
|
|
11
42
|
return;
|
|
@@ -50,7 +81,7 @@ const addHarmonizeScript = () => {
|
|
|
50
81
|
return tree;
|
|
51
82
|
}
|
|
52
83
|
const postInstall = rootPackageJsonObject.scripts.postinstall;
|
|
53
|
-
rootPackageJsonObject.scripts.harmonize = `eslint
|
|
84
|
+
rootPackageJsonObject.scripts.harmonize = `eslint "**/package.json" ${isYarnPackageManager ? '.yarnrc.yml ' : ''}--quiet --fix --no-error-on-unmatched-pattern`;
|
|
54
85
|
rootPackageJsonObject.scripts.postinstall = `${postInstall ? postInstall + ' && ' : ''}${extraPostInstall}`;
|
|
55
86
|
tree.overwrite(rootPackageJsonPath, JSON.stringify(rootPackageJsonObject, null, 2));
|
|
56
87
|
return tree;
|
|
@@ -58,44 +89,21 @@ const addHarmonizeScript = () => {
|
|
|
58
89
|
};
|
|
59
90
|
function ngAddFn(options) {
|
|
60
91
|
/* ng add rules */
|
|
61
|
-
return
|
|
92
|
+
return (tree, context) => {
|
|
62
93
|
let installJestPlugin = false;
|
|
63
94
|
try {
|
|
64
95
|
require.resolve('jest');
|
|
65
96
|
installJestPlugin = true;
|
|
66
97
|
}
|
|
67
98
|
catch { }
|
|
68
|
-
|
|
69
|
-
'
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'@
|
|
73
|
-
|
|
74
|
-
'@typescript-eslint/types',
|
|
75
|
-
'angular-eslint',
|
|
76
|
-
'eslint',
|
|
77
|
-
'eslint-import-resolver-node',
|
|
78
|
-
'eslint-import-resolver-typescript',
|
|
79
|
-
'eslint-plugin-import',
|
|
80
|
-
'eslint-plugin-import-newlines',
|
|
81
|
-
...(installJestPlugin ? ['eslint-plugin-jest'] : []),
|
|
82
|
-
'eslint-plugin-jsdoc',
|
|
83
|
-
'eslint-plugin-prefer-arrow',
|
|
84
|
-
// TODO: reactivate once https://github.com/nirtamir2/eslint-plugin-sort-export-all/issues/18 is fixed
|
|
85
|
-
// 'eslint-plugin-sort-export-all',
|
|
86
|
-
'eslint-plugin-unicorn',
|
|
87
|
-
'eslint-plugin-unused-imports',
|
|
88
|
-
'globby',
|
|
89
|
-
'globals',
|
|
90
|
-
'jsonc-eslint-parser',
|
|
91
|
-
'typescript-eslint',
|
|
92
|
-
// TODO could be removed once #2482 is fixed
|
|
93
|
-
'yaml-eslint-parser',
|
|
94
|
-
...(options.projectName ? ['@angular-eslint/builder'] : [])
|
|
95
|
-
];
|
|
99
|
+
if (installJestPlugin) {
|
|
100
|
+
devDependenciesToInstall.push('eslint-plugin-jest');
|
|
101
|
+
}
|
|
102
|
+
if (options.projectName) {
|
|
103
|
+
devDependenciesToInstall.push('@angular-eslint/builder');
|
|
104
|
+
}
|
|
96
105
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(path.resolve(__dirname, '..', '..', 'package.json'), true, /^@(?:o3r|ama-sdk)/);
|
|
97
106
|
const workspaceProject = options.projectName ? (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
|
98
|
-
const { NodeDependencyType } = await Promise.resolve().then(() => require('@schematics/angular/utility/dependencies'));
|
|
99
107
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
100
108
|
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
101
109
|
acc[dep] = {
|
|
@@ -107,19 +115,22 @@ function ngAddFn(options) {
|
|
|
107
115
|
};
|
|
108
116
|
return acc;
|
|
109
117
|
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, true, !!options.exactO3rVersion));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
118
|
+
const projectDirectory = workspaceProject?.root || '.';
|
|
119
|
+
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
120
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
121
|
+
devDependenciesToInstall,
|
|
122
|
+
dependenciesToInstall,
|
|
123
|
+
projectType: workspaceProject?.projectType,
|
|
124
|
+
projectPackageJson,
|
|
125
|
+
o3rPackageJsonPath: packageJsonPath
|
|
126
|
+
}, context.logger);
|
|
119
127
|
return () => (0, schematics_1.chain)([
|
|
120
128
|
(0, schematics_2.setupDependencies)({
|
|
121
129
|
projectName: options.projectName,
|
|
122
|
-
dependencies
|
|
130
|
+
dependencies: {
|
|
131
|
+
...dependencies,
|
|
132
|
+
...externalDependenciesInfo
|
|
133
|
+
},
|
|
123
134
|
ngAddToRun: depsInfo.o3rPeerDeps
|
|
124
135
|
}),
|
|
125
136
|
index_2.updateVscode,
|