From 555ae7431d3ef38e96358944ecf548ed7a2c3f6e Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Tue, 29 Sep 2020 18:26:17 +0300 Subject: [PATCH] refactor(docs-infra): more closely align `tslint.json` with CLI (#39018) This commit re-organizes the `tslint.json` configuration file to more closely align with the one generated by the latest Angular CLI for new apps. This makes it easier to see the difference with new CLI versions in the future and keep our `tslint.json` up-to-date (while keeping our own rules). NOTE: This commit only re-orders rules and removes redundant ones. It does not change the linting behavior. PR Close #39018 --- aio/tslint.json | 102 +++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/aio/tslint.json b/aio/tslint.json index 4f7ccaf9ed..3a745b774d 100644 --- a/aio/tslint.json +++ b/aio/tslint.json @@ -11,32 +11,16 @@ ] }, "array-type": false, - "arrow-parens": false, "arrow-return-shorthand": true, "ban": [ true, {"name": "fdescribe", "message": "Don't keep jasmine focus methods."}, {"name": "fit", "message": "Don't keep jasmine focus methods."} ], - "component-class-suffix": true, - "component-selector": [ - true, - "element", - "aio", - "kebab-case" - ], - "contextual-lifecycle": true, "curly": true, "deprecation": { - "severity": "warn" + "severity": "warning" }, - "directive-class-suffix": true, - "directive-selector": [ - true, - "attribute", - "aio", - "camelCase" - ], "eofline": true, "import-blacklist": [ true, @@ -48,13 +32,11 @@ "spaces" ] }, - "interface-name": false, "max-classes-per-file": false, "max-line-length": [ true, 140 ], - "member-access": false, "member-ordering": [ true, { @@ -66,8 +48,6 @@ ] } ], - "no-conflicting-lifecycle": true, - "no-consecutive-blank-lines": false, "no-console": [ true, "debug", @@ -77,24 +57,15 @@ "trace" ], "no-empty": false, - "no-host-metadata-property": true, "no-inferrable-types": [ true, "ignore-params" ], - "no-input-rename": true, - "no-inputs-metadata-property": true, - "no-output-native": true, - "no-output-on-prefix": true, - "no-output-rename": true, - "no-outputs-metadata-property": true, "no-string-literal": false, "no-switch-case-fall-through": true, "no-var-requires": false, "object-literal-key-quotes": false, - "object-literal-sort-keys": false, "only-arrow-functions": false, - "ordered-imports": false, "quotemark": [ true, "single" @@ -113,9 +84,6 @@ "named": "never" } }, - "template-banana-in-box": true, - "template-no-negated-async": true, - "trailing-comma": false, "typedef-whitespace": { "options": [ { @@ -134,26 +102,15 @@ } ] }, - "use-lifecycle-interface": true, - "use-pipe-transform-interface": true, - "variable-name": [ - true, - "allow-leading-underscore", - "allow-pascal-case", - "ban-keywords", - "check-format", - "require-const-for-all-caps" - ], - "template-accessibility-alt-text": true, - "template-accessibility-elements-content": true, - "template-accessibility-label-for": true, - "template-accessibility-tabindex-no-positive": true, - "template-accessibility-table-scope": true, - "template-accessibility-valid-aria": true, - "template-click-events-have-key-events": true, - "template-mouse-events-have-key-events": true, - "template-no-autofocus": true, - "template-no-distracting-elements": true, + "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-leading-underscore", + "allow-pascal-case", + "require-const-for-all-caps" + ] + }, "whitespace": { "options": [ "check-branch", @@ -163,6 +120,43 @@ "check-type", "check-typecast" ] - } + }, + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-accessibility-alt-text": true, + "template-accessibility-elements-content": true, + "template-accessibility-label-for": true, + "template-accessibility-tabindex-no-positive": true, + "template-accessibility-table-scope": true, + "template-accessibility-valid-aria": true, + "template-banana-in-box": true, + "template-click-events-have-key-events": true, + "template-mouse-events-have-key-events": true, + "template-no-autofocus": true, + "template-no-distracting-elements": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true, + "directive-selector": [ + true, + "attribute", + "aio", + "camelCase" + ], + "component-selector": [ + true, + "element", + "aio", + "kebab-case" + ] } }