@angular-eslint/schematics 19.4.1-alpha.9 → 19.5.0

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/README.md CHANGED
@@ -3,3 +3,13 @@
3
3
  Please see https://github.com/angular-eslint/angular-eslint for full usage instructions and guidance.
4
4
 
5
5
  The `@angular-eslint/schematics` package is a set of custom Angular CLI Schematics which are used to add and update dependencies and configuration files which are relevant for running ESLint on an Angular workspace.
6
+
7
+ ## Options
8
+
9
+ ### `--skip-install`
10
+
11
+ Skips installing npm packages when running `ng add @angular-eslint/schematics`. This can be useful when the schematic is executed as part of a larger workflow that handles dependency installation separately.
12
+
13
+ ```
14
+ ng add @angular-eslint/schematics --skip-install
15
+ ```
@@ -1,5 +1,11 @@
1
1
  import type { Rule } from '@angular-devkit/schematics';
2
+ import type { Schema } from './schema';
2
3
  export declare const FIXED_ESLINT_V8_VERSION = "8.57.0";
3
4
  export declare const FIXED_TYPESCRIPT_ESLINT_V7_VERSION = "7.11.0";
4
- export default function (): Rule;
5
+ /**
6
+ * Entry point for the ng-add schematic.
7
+ *
8
+ * @param options Configuration options passed to the schematic.
9
+ */
10
+ export default function (options: Schema): Rule;
5
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAc/E,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,kCAAkC,WAAW,CAAC;AAuM3D,MAAM,CAAC,OAAO,cAAc,IAAI,CAa/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAG/E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAYvC,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,kCAAkC,WAAW,CAAC;AAgN3D;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,OAAO,EAAE,MAAM,GAAG,IAAI,CAa9C"}
@@ -9,7 +9,7 @@ exports.FIXED_ESLINT_V8_VERSION = '8.57.0';
9
9
  exports.FIXED_TYPESCRIPT_ESLINT_V7_VERSION = '7.11.0';
10
10
  // eslint-disable-next-line @typescript-eslint/no-var-requires
11
11
  const packageJSON = require('../../package.json');
12
- function addAngularESLintPackages(json, useFlatConfig) {
12
+ function addAngularESLintPackages(json, useFlatConfig, options) {
13
13
  return (host, context) => {
14
14
  if (!host.exists('package.json')) {
15
15
  throw new Error('Could not find a `package.json` file at the root of your workspace');
@@ -40,12 +40,21 @@ function addAngularESLintPackages(json, useFlatConfig) {
40
40
  }
41
41
  json.devDependencies = (0, utils_1.sortObjectByKeys)(json.devDependencies);
42
42
  host.overwrite('package.json', JSON.stringify(json, null, 2));
43
- context.addTask(new tasks_1.NodePackageInstallTask());
44
- context.logger.info(`
43
+ if (!options.skipInstall) {
44
+ context.addTask(new tasks_1.NodePackageInstallTask({ allowScripts: false }));
45
+ context.logger.info(`
45
46
  All angular-eslint dependencies have been successfully installed 🎉
46
47
 
47
48
  Please see https://github.com/angular-eslint/angular-eslint for how to add ESLint configuration to your project.
48
49
  `);
50
+ }
51
+ else {
52
+ context.logger.info(`
53
+ All angular-eslint dependencies have been successfully added. Run your package manager install command to complete setup.
54
+
55
+ Please see https://github.com/angular-eslint/angular-eslint for how to add ESLint configuration to your project.
56
+ `);
57
+ }
49
58
  return host;
50
59
  };
51
60
  }
@@ -148,13 +157,18 @@ Please see https://github.com/angular-eslint/angular-eslint for more information
148
157
  ]);
149
158
  };
150
159
  }
151
- function default_1() {
160
+ /**
161
+ * Entry point for the ng-add schematic.
162
+ *
163
+ * @param options Configuration options passed to the schematic.
164
+ */
165
+ function default_1(options) {
152
166
  return (host, context) => {
153
167
  const workspacePackageJSON = host.read('package.json').toString('utf-8');
154
168
  const json = JSON.parse(workspacePackageJSON);
155
169
  const useFlatConfig = (0, utils_1.shouldUseFlatConfig)(host, json);
156
170
  return (0, schematics_1.chain)([
157
- addAngularESLintPackages(json, useFlatConfig),
171
+ addAngularESLintPackages(json, useFlatConfig, options),
158
172
  applyESLintConfigIfSingleProjectWithNoExistingTSLint(useFlatConfig),
159
173
  ])(host, context);
160
174
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Options available to the ng-add schematic.
3
+ */
4
+ export interface Schema {
5
+ /**
6
+ * Skip installing dependencies after modifying package.json.
7
+ */
8
+ skipInstall?: boolean;
9
+ }
10
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/ng-add/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,6 +3,13 @@
3
3
  "$id": "add-angular-eslint",
4
4
  "title": "Add angular-eslint to an existing workspace",
5
5
  "type": "object",
6
- "properties": {},
6
+ "properties": {
7
+ "skipInstall": {
8
+ "type": "boolean",
9
+ "description": "Skip package installation after adding dependencies",
10
+ "default": false,
11
+ "alias": "skip-install"
12
+ }
13
+ },
7
14
  "required": []
8
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/schematics",
3
- "version": "19.4.1-alpha.9",
3
+ "version": "19.5.0",
4
4
  "description": "Angular Schematics for angular-eslint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -41,8 +41,8 @@
41
41
  "ignore": "7.0.4",
42
42
  "semver": "7.7.2",
43
43
  "strip-json-comments": "3.1.1",
44
- "@angular-eslint/eslint-plugin": "19.4.1-alpha.9",
45
- "@angular-eslint/eslint-plugin-template": "19.4.1-alpha.9"
44
+ "@angular-eslint/eslint-plugin": "19.5.0",
45
+ "@angular-eslint/eslint-plugin-template": "19.5.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@typescript-eslint/utils": "8.32.1",