mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tsconfig: started on setting noImplicitThis to true
This commit is contained in:
parent
ceadced6f0
commit
80d6ef535d
@ -1,7 +1,7 @@
|
||||
// Based on underscore.js debounce()
|
||||
export default function debounce(func, wait) {
|
||||
let timeout;
|
||||
return function() {
|
||||
return function(this: any) {
|
||||
const context = this;
|
||||
const args = arguments;
|
||||
const later = function() {
|
||||
|
@ -922,7 +922,7 @@ for (var i = 0; i < 128; i++) {
|
||||
|
||||
const identifierPartTable = identifierStartTable;
|
||||
|
||||
export function Lexer(expression) {
|
||||
export function Lexer(this: any, expression) {
|
||||
this.input = expression;
|
||||
this.char = 1;
|
||||
this.from = 1;
|
||||
@ -1037,7 +1037,7 @@ Lexer.prototype = {
|
||||
return /^[0-9a-fA-F]$/.test(str);
|
||||
}
|
||||
|
||||
const readUnicodeEscapeSequence = _.bind(function() {
|
||||
const readUnicodeEscapeSequence = _.bind(function(this: any) {
|
||||
/*jshint validthis:true */
|
||||
index += 1;
|
||||
|
||||
@ -1065,7 +1065,7 @@ Lexer.prototype = {
|
||||
return null;
|
||||
}, this);
|
||||
|
||||
const getIdentifierStart = _.bind(function() {
|
||||
const getIdentifierStart = _.bind(function(this: any) {
|
||||
/*jshint validthis:true */
|
||||
const chr = this.peek(index);
|
||||
const code = chr.charCodeAt(0);
|
||||
@ -1096,7 +1096,7 @@ Lexer.prototype = {
|
||||
return null;
|
||||
}, this);
|
||||
|
||||
const getIdentifierPart = _.bind(function() {
|
||||
const getIdentifierPart = _.bind(function(this: any) {
|
||||
/*jshint validthis:true */
|
||||
const chr = this.peek(index);
|
||||
const code = chr.charCodeAt(0);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Lexer } from './lexer';
|
||||
|
||||
export function Parser(expression) {
|
||||
export function Parser(this: any, expression) {
|
||||
this.expression = expression;
|
||||
this.lexer = new Lexer(expression);
|
||||
this.tokens = this.lexer.tokenize();
|
||||
|
@ -39,15 +39,12 @@ export default class OpenTsDatasource {
|
||||
const end = this.convertToTSDBTime(options.rangeRaw.to, true);
|
||||
const qs = [];
|
||||
|
||||
_.each(
|
||||
options.targets,
|
||||
function(target) {
|
||||
if (!target.metric) {
|
||||
return;
|
||||
}
|
||||
qs.push(this.convertTargetToQuery(target, options, this.tsdbVersion));
|
||||
}.bind(this)
|
||||
);
|
||||
_.each(options.targets, target => {
|
||||
if (!target.metric) {
|
||||
return;
|
||||
}
|
||||
qs.push(this.convertTargetToQuery(target, options, this.tsdbVersion));
|
||||
});
|
||||
|
||||
const queries = _.compact(qs);
|
||||
|
||||
@ -75,30 +72,19 @@ export default class OpenTsDatasource {
|
||||
return query.hide !== true;
|
||||
});
|
||||
|
||||
return this.performTimeSeriesQuery(queries, start, end).then(
|
||||
function(response) {
|
||||
const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);
|
||||
const result = _.map(
|
||||
response.data,
|
||||
function(metricData, index) {
|
||||
index = metricToTargetMapping[index];
|
||||
if (index === -1) {
|
||||
index = 0;
|
||||
}
|
||||
this._saveTagKeys(metricData);
|
||||
return this.performTimeSeriesQuery(queries, start, end).then(response => {
|
||||
const metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);
|
||||
const result = _.map(response.data, (metricData, index) => {
|
||||
index = metricToTargetMapping[index];
|
||||
if (index === -1) {
|
||||
index = 0;
|
||||
}
|
||||
this._saveTagKeys(metricData);
|
||||
|
||||
return this.transformMetricData(
|
||||
metricData,
|
||||
groupByTags,
|
||||
options.targets[index],
|
||||
options,
|
||||
this.tsdbResolution
|
||||
);
|
||||
}.bind(this)
|
||||
);
|
||||
return { data: result };
|
||||
}.bind(this)
|
||||
);
|
||||
return this.transformMetricData(metricData, groupByTags, options.targets[index], options, this.tsdbResolution);
|
||||
});
|
||||
return { data: result };
|
||||
});
|
||||
}
|
||||
|
||||
annotationQuery(options) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import $ from 'jquery';
|
||||
import { appEvents } from 'app/core/core';
|
||||
|
||||
export default function GraphTooltip(elem, dashboard, scope, getSeriesFn) {
|
||||
export default function GraphTooltip(this: any, elem, dashboard, scope, getSeriesFn) {
|
||||
const self = this;
|
||||
const ctrl = scope.ctrl;
|
||||
const panel = ctrl.panel;
|
||||
|
@ -420,7 +420,7 @@ export class EventMarkers {
|
||||
event: event,
|
||||
});
|
||||
|
||||
const mouseenter = function() {
|
||||
const mouseenter = function(this: any) {
|
||||
createAnnotationToolip(marker, $(this).data('event'), that._plot);
|
||||
};
|
||||
|
||||
@ -541,7 +541,7 @@ export class EventMarkers {
|
||||
event: event,
|
||||
});
|
||||
|
||||
const mouseenter = function() {
|
||||
const mouseenter = function(this: any) {
|
||||
createAnnotationToolip(region, $(this).data('event'), that._plot);
|
||||
};
|
||||
|
||||
@ -596,7 +596,7 @@ export class EventMarkers {
|
||||
*/
|
||||
|
||||
/** @ngInject */
|
||||
export function init(plot) {
|
||||
export function init(this: any, plot) {
|
||||
/*jshint validthis:true */
|
||||
const that = this;
|
||||
const eventMarkers = new EventMarkers(plot);
|
||||
|
@ -31,7 +31,7 @@ export const TeamModel = types
|
||||
groups: types.optional(types.map(TeamGroupModel), {}),
|
||||
})
|
||||
.views(self => ({
|
||||
get filteredMembers() {
|
||||
get filteredMembers(this: Team) {
|
||||
const members = this.members.values();
|
||||
const regex = new RegExp(self.search, 'i');
|
||||
return members.filter(member => {
|
||||
@ -121,7 +121,7 @@ export const TeamsStore = types
|
||||
search: types.optional(types.string, ''),
|
||||
})
|
||||
.views(self => ({
|
||||
get filteredTeams() {
|
||||
get filteredTeams(this: any) {
|
||||
const teams = this.map.values();
|
||||
const regex = new RegExp(self.search, 'i');
|
||||
return teams.filter(team => {
|
||||
|
@ -4,7 +4,7 @@ import * as dateMath from 'app/core/utils/datemath';
|
||||
import { angularMocks, sinon } from '../lib/common';
|
||||
import { PanelModel } from 'app/features/dashboard/panel_model';
|
||||
|
||||
export function ControllerTestContext() {
|
||||
export function ControllerTestContext(this: any) {
|
||||
const self = this;
|
||||
|
||||
this.datasource = {};
|
||||
@ -106,7 +106,7 @@ export function ControllerTestContext() {
|
||||
};
|
||||
}
|
||||
|
||||
export function ServiceTestContext() {
|
||||
export function ServiceTestContext(this: any) {
|
||||
const self = this;
|
||||
self.templateSrv = new TemplateSrvStub();
|
||||
self.timeSrv = new TimeSrvStub();
|
||||
@ -138,11 +138,11 @@ export function ServiceTestContext() {
|
||||
};
|
||||
}
|
||||
|
||||
export function DashboardViewStateStub() {
|
||||
export function DashboardViewStateStub(this: any) {
|
||||
this.registerPanel = function() {};
|
||||
}
|
||||
|
||||
export function TimeSrvStub() {
|
||||
export function TimeSrvStub(this: any) {
|
||||
this.init = sinon.spy();
|
||||
this.time = { from: 'now-1h', to: 'now' };
|
||||
this.timeRange = function(parse) {
|
||||
@ -164,13 +164,13 @@ export function TimeSrvStub() {
|
||||
};
|
||||
}
|
||||
|
||||
export function ContextSrvStub() {
|
||||
export function ContextSrvStub(this: any) {
|
||||
this.hasRole = function() {
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
export function TemplateSrvStub() {
|
||||
export function TemplateSrvStub(this: any) {
|
||||
this.variables = [];
|
||||
this.templateSettings = { interpolate: /\[\[([\s\S]+?)\]\]/g };
|
||||
this.data = {};
|
||||
|
@ -20,7 +20,7 @@
|
||||
"emitDecoratorMetadata": false,
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitThis": false,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitUseStrict": false,
|
||||
"noImplicitAny": false,
|
||||
"noUnusedLocals": true,
|
||||
|
Loading…
Reference in New Issue
Block a user