From eaaf7bedc2386c889149180e86317368b2b0199e Mon Sep 17 00:00:00 2001 From: softsimon Date: Sun, 5 Apr 2020 00:00:17 +0700 Subject: [PATCH] upgrading tslint to v6 --- frontend/package.json | 2 +- .../statistics/chartist.component.scss | 73 ------------------- frontend/tslint.json | 67 ++++++++++++++++- 3 files changed, 66 insertions(+), 76 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 4ef46dc2f..e95f7bd0a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -67,7 +67,7 @@ "karma-jasmine-html-reporter": "^1.4.0", "protractor": "~5.4.0", "ts-node": "~7.0.0", - "tslint": "~5.15.0", + "tslint": "~6.1.0", "typescript": "~3.6.4" } } \ No newline at end of file diff --git a/frontend/src/app/components/statistics/chartist.component.scss b/frontend/src/app/components/statistics/chartist.component.scss index 32b427e7b..e69de29bb 100644 --- a/frontend/src/app/components/statistics/chartist.component.scss +++ b/frontend/src/app/components/statistics/chartist.component.scss @@ -1,73 +0,0 @@ -@import "../../../styles.scss"; - -.ct-bar-label { - font-size: 20px; - font-weight: bold; - fill: #fff; -} - -.ct-target-line { - stroke: #f5f5f5; - stroke-width: 3px; - stroke-dasharray: 7px; -} - -.ct-area { - stroke: none; - fill-opacity: 0.9; -} - -.ct-label { - fill: rgba(255, 255, 255, 0.4); - color: rgba(255, 255, 255, 0.4); -} - -.ct-grid { - stroke: rgba(255, 255, 255, 0.2); -} - -/* LEGEND */ - -.ct-legend { - position: absolute; - z-index: 10; - left: 0px; - list-style: none; - font-size: 13px; - padding: 0px 0px 0px 30px; - top: 90px; - - li { - position: relative; - padding-left: 23px; - margin-bottom: 0px; - } - - li:before { - width: 12px; - height: 12px; - position: absolute; - left: 0; - bottom: 3px; - content: ''; - border: 3px solid transparent; - border-radius: 2px; - } - - li.inactive:before { - background: transparent; - } - - &.ct-legend-inside { - position: absolute; - top: 0; - right: 0; - } - - @for $i from 0 to length($ct-series-colors) { - .ct-series-#{$i}:before { - background-color: nth($ct-series-colors, $i + 1); - border-color: nth($ct-series-colors, $i + 1); - } - } -} \ No newline at end of file diff --git a/frontend/tslint.json b/frontend/tslint.json index 231c9596a..f420405a7 100644 --- a/frontend/tslint.json +++ b/frontend/tslint.json @@ -1,14 +1,29 @@ { "extends": "tslint:recommended", "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warning" }, "component-class-suffix": true, "contextual-lifecycle": true, "directive-class-suffix": true, + "eofline": true, + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "object-literal-shorthand": false, "directive-selector": [ true, @@ -61,7 +76,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ false, @@ -73,6 +87,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -84,9 +112,44 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - }, + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +}, "rulesDirectory": [ "codelyzer" ]