@o3r/eslint-config 12.5.0-prerelease.23 → 12.5.0-prerelease.4

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.23",
3
+ "version": "12.5.0-prerelease.4",
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.23"
40
+ "@o3r/schematics": "^12.5.0-prerelease.4"
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.23",
50
- "@o3r/schematics": "^12.5.0-prerelease.23",
49
+ "@o3r/eslint-plugin": "^12.5.0-prerelease.4",
50
+ "@o3r/schematics": "^12.5.0-prerelease.4",
51
51
  "@schematics/angular": "^19.0.0",
52
52
  "@stylistic/eslint-plugin": "~3.1.0",
53
53
  "@typescript-eslint/parser": "^8.15.0",
@@ -71,33 +71,32 @@
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",
75
- "yaml-eslint-parser": "^1.2.2"
74
+ "typescript-eslint": "^8.15.0"
76
75
  },
77
76
  "devDependencies": {
78
77
  "@angular-devkit/core": "~19.2.0",
79
78
  "@angular-devkit/schematics": "~19.2.0",
80
79
  "@angular/compiler": "~19.2.0",
81
80
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
82
- "@eslint/js": "~9.30.0",
81
+ "@eslint/js": "~9.28.0",
83
82
  "@nx/eslint-plugin": "~20.8.0",
84
- "@o3r/build-helpers": "^12.5.0-prerelease.23",
85
- "@o3r/eslint-plugin": "^12.5.0-prerelease.23",
86
- "@o3r/test-helpers": "^12.5.0-prerelease.23",
83
+ "@o3r/build-helpers": "^12.5.0-prerelease.4",
84
+ "@o3r/eslint-plugin": "^12.5.0-prerelease.4",
85
+ "@o3r/test-helpers": "^12.5.0-prerelease.4",
87
86
  "@schematics/angular": "~19.2.0",
88
87
  "@stylistic/eslint-plugin": "~3.1.0",
89
88
  "@types/eslint__js": "^8.42.3",
90
89
  "@types/jest": "~29.5.2",
91
90
  "@types/node": "^20.0.0",
92
- "@typescript-eslint/parser": "~8.35.0",
91
+ "@typescript-eslint/parser": "~8.34.0",
93
92
  "angular-eslint": "~19.4.0",
94
93
  "cpy-cli": "^5.0.0",
95
- "eslint": "~9.30.0",
94
+ "eslint": "~9.28.0",
96
95
  "eslint-import-resolver-node": "~0.3.9",
97
96
  "eslint-import-resolver-typescript": "~3.10.0",
98
- "eslint-plugin-import": "~2.32.0",
97
+ "eslint-plugin-import": "~2.31.0",
99
98
  "eslint-plugin-import-newlines": "~1.4.0",
100
- "eslint-plugin-jest": "~28.14.0",
99
+ "eslint-plugin-jest": "~28.13.0",
101
100
  "eslint-plugin-jsdoc": "~50.8.0",
102
101
  "eslint-plugin-prefer-arrow": "~1.2.3",
103
102
  "eslint-plugin-unicorn": "~56.0.0",
@@ -115,7 +114,7 @@
115
114
  "tslib": "^2.6.2",
116
115
  "type-fest": "^4.30.1",
117
116
  "typescript": "~5.8.2",
118
- "typescript-eslint": "~8.35.0"
117
+ "typescript-eslint": "~8.34.0"
119
118
  },
120
119
  "peerDependenciesMeta": {
121
120
  "@angular-devkit/core": {
@@ -156,9 +155,6 @@
156
155
  },
157
156
  "typescript": {
158
157
  "optional": true
159
- },
160
- "yaml-eslint-parser": {
161
- "optional": true
162
158
  }
163
159
  },
164
160
  "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;AA8JlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,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;AA2IlB;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,SAAS,qBAAqB,SAA2C,CAAC"}
@@ -6,39 +6,6 @@ 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
- ];
42
9
  const handleOtterEslintErrors = (projectName) => (tree, context) => {
43
10
  if (!projectName) {
44
11
  return;
@@ -83,7 +50,7 @@ const addHarmonizeScript = () => {
83
50
  return tree;
84
51
  }
85
52
  const postInstall = rootPackageJsonObject.scripts.postinstall;
86
- rootPackageJsonObject.scripts.harmonize = `eslint '**/package.json' ${isYarnPackageManager ? '.yarnrc.yml ' : ''}--quiet --fix --no-error-on-unmatched-pattern`;
53
+ rootPackageJsonObject.scripts.harmonize = `eslint '**/package.json' ${isYarnPackageManager ? '.yarnrc.yml ' : ''}--quiet --fix`;
87
54
  rootPackageJsonObject.scripts.postinstall = `${postInstall ? postInstall + ' && ' : ''}${extraPostInstall}`;
88
55
  tree.overwrite(rootPackageJsonPath, JSON.stringify(rootPackageJsonObject, null, 2));
89
56
  return tree;
@@ -91,21 +58,44 @@ const addHarmonizeScript = () => {
91
58
  };
92
59
  function ngAddFn(options) {
93
60
  /* ng add rules */
94
- return (tree, context) => {
61
+ return async (tree, context) => {
95
62
  let installJestPlugin = false;
96
63
  try {
97
64
  require.resolve('jest');
98
65
  installJestPlugin = true;
99
66
  }
100
67
  catch { }
101
- if (installJestPlugin) {
102
- devDependenciesToInstall.push('eslint-plugin-jest');
103
- }
104
- if (options.projectName) {
105
- devDependenciesToInstall.push('@angular-eslint/builder');
106
- }
68
+ const devDependenciesToInstall = [
69
+ '@eslint-community/eslint-plugin-eslint-comments',
70
+ '@eslint/js',
71
+ '@stylistic/eslint-plugin',
72
+ '@typescript-eslint/parser',
73
+ '@typescript-eslint/utils',
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
+ ];
107
96
  const depsInfo = (0, schematics_2.getO3rPeerDeps)(path.resolve(__dirname, '..', '..', 'package.json'), true, /^@(?:o3r|ama-sdk)/);
108
97
  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'));
109
99
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
110
100
  const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
111
101
  acc[dep] = {
@@ -117,22 +107,19 @@ function ngAddFn(options) {
117
107
  };
118
108
  return acc;
119
109
  }, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, true, !!options.exactO3rVersion));
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);
110
+ Object.entries((0, schematics_2.getExternalDependenciesVersionRange)(devDependenciesToInstall, packageJsonPath, context.logger))
111
+ .forEach(([dep, range]) => {
112
+ dependencies[dep] = {
113
+ inManifest: [{
114
+ range,
115
+ types: [NodeDependencyType.Dev]
116
+ }]
117
+ };
118
+ });
129
119
  return () => (0, schematics_1.chain)([
130
120
  (0, schematics_2.setupDependencies)({
131
121
  projectName: options.projectName,
132
- dependencies: {
133
- ...dependencies,
134
- ...externalDependenciesInfo
135
- },
122
+ dependencies,
136
123
  ngAddToRun: depsInfo.o3rPeerDeps
137
124
  }),
138
125
  index_2.updateVscode,