Commit 272c0951 by Torkel Ödegaard

tslint: added a new tslint rule

parent 0dc89493
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"build": "grunt build", "build": "grunt build",
"test": "grunt test", "test": "grunt test",
"test:coverage": "grunt test --coverage=true", "test:coverage": "grunt test --coverage=true",
"lint": "tslint -c tslint.json --project tsconfig.json --type-check", "lint": "tslint -c tslint.json --project tsconfig.json",
"jest": "jest --notify --watch", "jest": "jest --notify --watch",
"api-tests": "jest --notify --watch --config=tests/api/jest.js", "api-tests": "jest --notify --watch --config=tests/api/jest.js",
"precommit": "lint-staged && grunt precommit" "precommit": "lint-staged && grunt precommit"
......
...@@ -109,7 +109,7 @@ export function determineQueryHints(series: any[], datasource?: any): any[] { ...@@ -109,7 +109,7 @@ export function determineQueryHints(series: any[], datasource?: any): any[] {
} }
// Check for monotony // Check for monotony
const datapoints: [number, number][] = s.datapoints; const datapoints: number[][] = s.datapoints;
if (datapoints.length > 1) { if (datapoints.length > 1) {
let increasing = false; let increasing = false;
const monotonic = datapoints.filter(dp => dp[0] !== null).every((dp, index) => { const monotonic = datapoints.filter(dp => dp[0] !== null).every((dp, index) => {
......
...@@ -27,11 +27,11 @@ class GraphElement { ...@@ -27,11 +27,11 @@ class GraphElement {
ctrl: GraphCtrl; ctrl: GraphCtrl;
tooltip: any; tooltip: any;
dashboard: any; dashboard: any;
annotations: Array<object>; annotations: object[];
panel: any; panel: any;
plot: any; plot: any;
sortedSeries: Array<any>; sortedSeries: any[];
data: Array<any>; data: any[];
panelWidth: number; panelWidth: number;
eventManager: EventManager; eventManager: EventManager;
thresholdManager: ThresholdManager; thresholdManager: ThresholdManager;
......
{ {
"rules": { "rules": {
"array-type": [true, "array-simple"],
"interface-name": [true, "never-prefix"], "interface-name": [true, "never-prefix"],
"no-string-throw": true, "no-string-throw": true,
"no-unused-expression": true, "no-unused-expression": true,
...@@ -19,13 +20,7 @@ ...@@ -19,13 +20,7 @@
"member-access": false, "member-access": false,
"no-arg": true, "no-arg": true,
"no-bitwise": false, "no-bitwise": false,
"no-console": [true, "no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true, "no-construct": true,
"no-debugger": true, "no-debugger": true,
"no-empty": false, "no-empty": false,
...@@ -37,26 +32,20 @@ ...@@ -37,26 +32,20 @@
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-var-keyword": false, "no-var-keyword": false,
"object-literal-sort-keys": false, "object-literal-sort-keys": false,
"one-line": [true, "one-line": [true, "check-open-brace", "check-catch", "check-else"],
"check-open-brace",
"check-catch",
"check-else"
],
"prefer-const": true, "prefer-const": true,
"radix": false, "radix": false,
"typedef-whitespace": [true, { "typedef-whitespace": [
"call-signature": "nospace", true,
"index-signature": "nospace", {
"parameter": "nospace", "call-signature": "nospace",
"property-declaration": "nospace", "index-signature": "nospace",
"variable-declaration": "nospace" "parameter": "nospace",
}], "property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": [true, "ban-keywords"], "variable-name": [true, "ban-keywords"],
"whitespace": [true, "whitespace": [true, "check-branch", "check-decl", "check-type", "check-preblock"]
"check-branch",
"check-decl",
"check-type",
"check-preblock"
]
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment