mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tslint: added a new tslint rule
This commit is contained in:
parent
0dc8949352
commit
272c09513f
@ -101,7 +101,7 @@
|
||||
"build": "grunt build",
|
||||
"test": "grunt test",
|
||||
"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",
|
||||
"api-tests": "jest --notify --watch --config=tests/api/jest.js",
|
||||
"precommit": "lint-staged && grunt precommit"
|
||||
|
@ -109,7 +109,7 @@ export function determineQueryHints(series: any[], datasource?: any): any[] {
|
||||
}
|
||||
|
||||
// Check for monotony
|
||||
const datapoints: [number, number][] = s.datapoints;
|
||||
const datapoints: number[][] = s.datapoints;
|
||||
if (datapoints.length > 1) {
|
||||
let increasing = false;
|
||||
const monotonic = datapoints.filter(dp => dp[0] !== null).every((dp, index) => {
|
||||
|
@ -27,11 +27,11 @@ class GraphElement {
|
||||
ctrl: GraphCtrl;
|
||||
tooltip: any;
|
||||
dashboard: any;
|
||||
annotations: Array<object>;
|
||||
annotations: object[];
|
||||
panel: any;
|
||||
plot: any;
|
||||
sortedSeries: Array<any>;
|
||||
data: Array<any>;
|
||||
sortedSeries: any[];
|
||||
data: any[];
|
||||
panelWidth: number;
|
||||
eventManager: EventManager;
|
||||
thresholdManager: ThresholdManager;
|
||||
|
39
tslint.json
39
tslint.json
@ -1,5 +1,6 @@
|
||||
{
|
||||
"rules": {
|
||||
"array-type": [true, "array-simple"],
|
||||
"interface-name": [true, "never-prefix"],
|
||||
"no-string-throw": true,
|
||||
"no-unused-expression": true,
|
||||
@ -19,13 +20,7 @@
|
||||
"member-access": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": false,
|
||||
"no-console": [true,
|
||||
"debug",
|
||||
"info",
|
||||
"time",
|
||||
"timeEnd",
|
||||
"trace"
|
||||
],
|
||||
"no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
|
||||
"no-construct": true,
|
||||
"no-debugger": true,
|
||||
"no-empty": false,
|
||||
@ -37,26 +32,20 @@
|
||||
"no-trailing-whitespace": true,
|
||||
"no-var-keyword": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [true,
|
||||
"check-open-brace",
|
||||
"check-catch",
|
||||
"check-else"
|
||||
],
|
||||
"one-line": [true, "check-open-brace", "check-catch", "check-else"],
|
||||
"prefer-const": true,
|
||||
"radix": false,
|
||||
"typedef-whitespace": [true, {
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}],
|
||||
"typedef-whitespace": [
|
||||
true,
|
||||
{
|
||||
"call-signature": "nospace",
|
||||
"index-signature": "nospace",
|
||||
"parameter": "nospace",
|
||||
"property-declaration": "nospace",
|
||||
"variable-declaration": "nospace"
|
||||
}
|
||||
],
|
||||
"variable-name": [true, "ban-keywords"],
|
||||
"whitespace": [true,
|
||||
"check-branch",
|
||||
"check-decl",
|
||||
"check-type",
|
||||
"check-preblock"
|
||||
]
|
||||
"whitespace": [true, "check-branch", "check-decl", "check-type", "check-preblock"]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user