@o3r/eslint-config 12.5.0-prerelease.10 → 12.5.0-prerelease.12
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
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.12",
|
|
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.12"
|
|
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.12",
|
|
50
|
+
"@o3r/schematics": "^12.5.0-prerelease.12",
|
|
51
51
|
"@schematics/angular": "^19.0.0",
|
|
52
52
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
53
53
|
"@typescript-eslint/parser": "^8.15.0",
|
|
@@ -71,7 +71,8 @@
|
|
|
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",
|
|
@@ -80,9 +81,9 @@
|
|
|
80
81
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
81
82
|
"@eslint/js": "~9.29.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.12",
|
|
85
|
+
"@o3r/eslint-plugin": "^12.5.0-prerelease.12",
|
|
86
|
+
"@o3r/test-helpers": "^12.5.0-prerelease.12",
|
|
86
87
|
"@schematics/angular": "~19.2.0",
|
|
87
88
|
"@stylistic/eslint-plugin": "~3.1.0",
|
|
88
89
|
"@types/eslint__js": "^8.42.3",
|
|
@@ -155,6 +156,9 @@
|
|
|
155
156
|
},
|
|
156
157
|
"typescript": {
|
|
157
158
|
"optional": true
|
|
159
|
+
},
|
|
160
|
+
"yaml-eslint-parser": {
|
|
161
|
+
"optional": true
|
|
158
162
|
}
|
|
159
163
|
},
|
|
160
164
|
"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;AA8JlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
|
|
@@ -6,6 +6,39 @@ 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
|
+
// TODO could be removed once #2482 is fixed
|
|
40
|
+
'yaml-eslint-parser'
|
|
41
|
+
];
|
|
9
42
|
const handleOtterEslintErrors = (projectName) => (tree, context) => {
|
|
10
43
|
if (!projectName) {
|
|
11
44
|
return;
|
|
@@ -50,7 +83,7 @@ const addHarmonizeScript = () => {
|
|
|
50
83
|
return tree;
|
|
51
84
|
}
|
|
52
85
|
const postInstall = rootPackageJsonObject.scripts.postinstall;
|
|
53
|
-
rootPackageJsonObject.scripts.harmonize = `eslint '**/package.json' ${isYarnPackageManager ? '.yarnrc.yml ' : ''}--quiet --fix`;
|
|
86
|
+
rootPackageJsonObject.scripts.harmonize = `eslint '**/package.json' ${isYarnPackageManager ? '.yarnrc.yml ' : ''}--quiet --fix --no-error-on-unmatched-pattern`;
|
|
54
87
|
rootPackageJsonObject.scripts.postinstall = `${postInstall ? postInstall + ' && ' : ''}${extraPostInstall}`;
|
|
55
88
|
tree.overwrite(rootPackageJsonPath, JSON.stringify(rootPackageJsonObject, null, 2));
|
|
56
89
|
return tree;
|
|
@@ -58,44 +91,21 @@ const addHarmonizeScript = () => {
|
|
|
58
91
|
};
|
|
59
92
|
function ngAddFn(options) {
|
|
60
93
|
/* ng add rules */
|
|
61
|
-
return
|
|
94
|
+
return (tree, context) => {
|
|
62
95
|
let installJestPlugin = false;
|
|
63
96
|
try {
|
|
64
97
|
require.resolve('jest');
|
|
65
98
|
installJestPlugin = true;
|
|
66
99
|
}
|
|
67
100
|
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
|
-
];
|
|
101
|
+
if (installJestPlugin) {
|
|
102
|
+
devDependenciesToInstall.push('eslint-plugin-jest');
|
|
103
|
+
}
|
|
104
|
+
if (options.projectName) {
|
|
105
|
+
devDependenciesToInstall.push('@angular-eslint/builder');
|
|
106
|
+
}
|
|
96
107
|
const depsInfo = (0, schematics_2.getO3rPeerDeps)(path.resolve(__dirname, '..', '..', 'package.json'), true, /^@(?:o3r|ama-sdk)/);
|
|
97
108
|
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
109
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
|
100
110
|
const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
|
|
101
111
|
acc[dep] = {
|
|
@@ -107,19 +117,22 @@ function ngAddFn(options) {
|
|
|
107
117
|
};
|
|
108
118
|
return acc;
|
|
109
119
|
}, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, true, !!options.exactO3rVersion));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
120
|
+
const projectDirectory = workspaceProject?.root || '.';
|
|
121
|
+
const projectPackageJson = tree.readJson(path.posix.join(projectDirectory, 'package.json'));
|
|
122
|
+
const externalDependenciesInfo = (0, schematics_2.getExternalDependenciesInfo)({
|
|
123
|
+
devDependenciesToInstall,
|
|
124
|
+
dependenciesToInstall,
|
|
125
|
+
projectType: workspaceProject?.projectType,
|
|
126
|
+
projectPackageJson,
|
|
127
|
+
o3rPackageJsonPath: packageJsonPath
|
|
128
|
+
}, context.logger);
|
|
119
129
|
return () => (0, schematics_1.chain)([
|
|
120
130
|
(0, schematics_2.setupDependencies)({
|
|
121
131
|
projectName: options.projectName,
|
|
122
|
-
dependencies
|
|
132
|
+
dependencies: {
|
|
133
|
+
...dependencies,
|
|
134
|
+
...externalDependenciesInfo
|
|
135
|
+
},
|
|
123
136
|
ngAddToRun: depsInfo.o3rPeerDeps
|
|
124
137
|
}),
|
|
125
138
|
index_2.updateVscode,
|