From 1471dafb9cc37bea188355560b4c45becc722ead Mon Sep 17 00:00:00 2001 From: mgechev Date: Fri, 3 Nov 2017 11:13:08 -0700 Subject: [PATCH] feat: update codelyzer and add rules Codelyzer@^4.0.0 is out! It introduces few new rules such as: - `angular-whitespace` - checks whether we have presence of whitespace in the template to make it more readable, for instance in `{{ expr }}`, `check-interpolation` will check if `expr` is surrounded by whitespace. This rule also introduces auto fixes. - `no-output-on-prefix` - warns if outputs are prefixed with `on` this is based on https://angular.io/guide/styleguide#dont-prefix-output-properties. Tell me what you think about `angular-whitespace` and let me know if it is too opinionated. As part of `angular-whitespace` we're planning a few more features. --- packages/schematics/angular/application/files/package.json | 2 +- packages/schematics/angular/application/files/tslint.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/schematics/angular/application/files/package.json b/packages/schematics/angular/application/files/package.json index 06975fcbbf..b985893cdb 100644 --- a/packages/schematics/angular/application/files/package.json +++ b/packages/schematics/angular/application/files/package.json @@ -32,7 +32,7 @@ "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", - "codelyzer": "~3.2.0", + "codelyzer": "^4.0.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", diff --git a/packages/schematics/angular/application/files/tslint.json b/packages/schematics/angular/application/files/tslint.json index d9af7070a6..1f8ed16bed 100644 --- a/packages/schematics/angular/application/files/tslint.json +++ b/packages/schematics/angular/application/files/tslint.json @@ -127,6 +127,8 @@ "<%= prefix %>", "kebab-case" ], + "angular-whitespace": [true, "check-interpolation"], + "no-output-on-prefix": true, "use-input-property-decorator": true, "use-output-property-decorator": true, "use-host-property-decorator": true, @@ -135,7 +137,6 @@ "use-life-cycle-interface": true, "use-pipe-transform-interface": true, "component-class-suffix": true, - "directive-class-suffix": true, - "invoke-injectable": true + "directive-class-suffix": true } }