@angular-eslint/schematics 4.2.0-tmp.0 → 4.2.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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.2.0](https://github.com/angular-eslint/angular-eslint/compare/v4.1.0...v4.2.0) (2021-04-28)
7
+
8
+ ### Features
9
+
10
+ - **schematics:** add add-eslint-to-project schematic ([#426](https://github.com/angular-eslint/angular-eslint/issues/426)) ([7ae557d](https://github.com/angular-eslint/angular-eslint/commit/7ae557d94f53833fbfbf5128d39f64c7bb1c3c5f))
11
+
6
12
  # [4.1.0](https://github.com/angular-eslint/angular-eslint/compare/v4.0.0...v4.1.0) (2021-04-28)
7
13
 
8
14
  ### Bug Fixes
package/dist/utils.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.determineTargetProjectName = exports.sortObjectByKeys = exports.createRootESLintConfigFile = exports.removeTSLintJSONForProject = exports.createESLintConfigForProject = exports.createRootESLintConfig = exports.setESLintProjectBasedOnProjectType = exports.visitNotIgnoredFiles = exports.addESLintTargetToProject = exports.updateWorkspaceInTree = exports.offsetFromRoot = exports.getProjectConfig = exports.isTSLintUsedInWorkspace = exports.getWorkspacePath = exports.updateJsonInTree = exports.readJsonInTree = void 0;
6
+ exports.determineTargetProjectName = exports.sortObjectByKeys = exports.removeTSLintJSONForProject = exports.createESLintConfigForProject = exports.createRootESLintConfig = exports.setESLintProjectBasedOnProjectType = exports.visitNotIgnoredFiles = exports.addESLintTargetToProject = exports.updateWorkspaceInTree = exports.offsetFromRoot = exports.getProjectConfig = exports.isTSLintUsedInWorkspace = exports.getWorkspacePath = exports.updateJsonInTree = exports.readJsonInTree = void 0;
7
7
  const core_1 = require("@angular-devkit/core");
8
8
  const schematics_1 = require("@angular-devkit/schematics");
9
9
  const ignore_1 = __importDefault(require("ignore"));
@@ -273,11 +273,10 @@ function createESLintConfigForProject(projectName) {
273
273
  const { root: projectRoot, projectType, prefix } = angularJSON.projects[projectName];
274
274
  /**
275
275
  * If the root is an empty string it must be the initial project created at the
276
- * root by the Angular CLI's workspace schematic. We handle creating the root level
277
- * config in our own workspace schematic.
276
+ * root by the Angular CLI's workspace schematic
278
277
  */
279
278
  if (projectRoot === '') {
280
- return;
279
+ return createRootESLintConfigFile(projectName);
281
280
  }
282
281
  return updateJsonInTree(core_1.join(core_1.normalize(projectRoot), '.eslintrc.json'), () => createProjectESLintConfig(tree.root.path, projectRoot, projectType, prefix));
283
282
  };
@@ -294,19 +293,18 @@ function removeTSLintJSONForProject(projectName) {
294
293
  };
295
294
  }
296
295
  exports.removeTSLintJSONForProject = removeTSLintJSONForProject;
297
- function createRootESLintConfigFile(workspaceName) {
296
+ function createRootESLintConfigFile(projectName) {
298
297
  return (tree) => {
299
298
  var _a;
300
- const angularJSON = readJsonInTree(tree, core_1.join(core_1.normalize(workspaceName), 'angular.json'));
299
+ const angularJSON = readJsonInTree(tree, getWorkspacePath(tree));
301
300
  let lintPrefix = null;
302
- if ((_a = angularJSON.projects) === null || _a === void 0 ? void 0 : _a[workspaceName]) {
303
- const { prefix } = angularJSON.projects[workspaceName];
301
+ if ((_a = angularJSON.projects) === null || _a === void 0 ? void 0 : _a[projectName]) {
302
+ const { prefix } = angularJSON.projects[projectName];
304
303
  lintPrefix = prefix;
305
304
  }
306
- return updateJsonInTree(core_1.join(core_1.normalize(workspaceName), '.eslintrc.json'), () => createRootESLintConfig(lintPrefix));
305
+ return updateJsonInTree('.eslintrc.json', () => createRootESLintConfig(lintPrefix));
307
306
  };
308
307
  }
309
- exports.createRootESLintConfigFile = createRootESLintConfigFile;
310
308
  function sortObjectByKeys(obj) {
311
309
  return Object.keys(obj)
312
310
  .sort()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/schematics",
3
- "version": "4.2.0-tmp.0",
3
+ "version": "4.2.0",
4
4
  "description": "Angular Schematics for angular-eslint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -31,8 +31,8 @@
31
31
  "save": "devDependencies"
32
32
  },
33
33
  "dependencies": {
34
- "@angular-eslint/eslint-plugin": "^4.2.0-tmp.0",
35
- "@angular-eslint/eslint-plugin-template": "^4.2.0-tmp.0",
34
+ "@angular-eslint/eslint-plugin": "4.2.0",
35
+ "@angular-eslint/eslint-plugin-template": "4.2.0",
36
36
  "ignore": "5.1.8",
37
37
  "strip-json-comments": "3.1.1",
38
38
  "tmp": "0.2.1"
@@ -46,5 +46,5 @@
46
46
  "peerDependencies": {
47
47
  "@angular/cli": ">= 11.2.0 < 12.0.0"
48
48
  },
49
- "gitHead": "1f9b2ccf17e4157d9ecfe84779f2f6e8b5084b1a"
49
+ "gitHead": "e1af184da7fbb88902635cd539223ecdaa88c0b8"
50
50
  }