mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech: removing unused variables from typescript files, and making tslint rules more strict
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
// import from 'react-dom';
|
||||
import coreModule from '../core_module';
|
||||
|
||||
export interface IProps {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
var template = `
|
||||
@@ -37,7 +34,7 @@ export class ColorPickerCtrl {
|
||||
showAxisControls: boolean;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $rootScope) {
|
||||
constructor(private $scope, $rootScope) {
|
||||
this.colors = $rootScope.colors;
|
||||
this.autoClose = $scope.autoClose;
|
||||
this.series = $scope.series;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
var template = `
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../../core_module';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import store from 'app/core/store';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import $ from 'jquery';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
@@ -8,7 +8,7 @@ export class HelpCtrl {
|
||||
shortcuts: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, $sce) {
|
||||
constructor() {
|
||||
this.tabIndex = 0;
|
||||
this.shortcuts = {
|
||||
'Global': [
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
getObjectName,
|
||||
getType,
|
||||
getValuePreview,
|
||||
getPreview,
|
||||
cssClass,
|
||||
createElement
|
||||
} from './helpers';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import store from 'app/core/store';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
var template = `
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="navbar-inner">
|
||||
<a class="navbar-brand-btn pointer" ng-click="ctrl.contextSrv.toggleSideMenu()">
|
||||
<a class="navbar-brand-btn pointer" ng-click="ctrl.toggleSideMenu()">
|
||||
<span class="navbar-brand-btn-background">
|
||||
<img src="public/img/grafana_icon.svg"></img>
|
||||
</span>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../../core_module';
|
||||
import {NavModel, NavModelItem} from '../../nav_model_srv';
|
||||
|
||||
@@ -12,7 +9,7 @@ export class NavbarCtrl {
|
||||
hasMenu: boolean;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $rootScope, private contextSrv) {
|
||||
constructor(private $rootScope, private contextSrv) {
|
||||
this.section = this.model.section;
|
||||
this.hasMenu = this.model.menu.length > 0;
|
||||
}
|
||||
@@ -21,6 +18,10 @@ export class NavbarCtrl {
|
||||
this.$rootScope.appEvent('show-dash-search');
|
||||
}
|
||||
|
||||
toggleSideMenu() {
|
||||
this.contextSrv.toggleSideMenu();
|
||||
}
|
||||
|
||||
navItemClicked(navItem, evt) {
|
||||
if (navItem.clickHandler) {
|
||||
navItem.clickHandler();
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import angular from 'angular';
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../../core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
export class SearchCtrl {
|
||||
isOpen: boolean;
|
||||
@@ -22,7 +19,7 @@ export class SearchCtrl {
|
||||
openCompleted: boolean;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv, private $rootScope) {
|
||||
constructor($scope, private $location, private $timeout, private backendSrv, public contextSrv, $rootScope) {
|
||||
$rootScope.onAppEvent('show-dash-search', this.openSearch.bind(this), $scope);
|
||||
$rootScope.onAppEvent('hide-dash-search', this.closeSearch.bind(this), $scope);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from '../../core_module';
|
||||
|
||||
@@ -19,7 +18,7 @@ export class SideMenuCtrl {
|
||||
maxShownOrgs: number;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private $location, private contextSrv, private backendSrv, private $element) {
|
||||
constructor(private $scope, private $location, private contextSrv, private backendSrv) {
|
||||
this.isSignedIn = contextSrv.isSignedIn;
|
||||
this.user = contextSrv.user;
|
||||
this.appSubUrl = config.appSubUrl;
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
var template = `
|
||||
<label for="check-{{ctrl.id}}" class="gf-form-label {{ctrl.labelClass}} pointer" ng-show="ctrl.label">
|
||||
|
||||
@@ -8,9 +8,9 @@ export class SignUpCtrl {
|
||||
/** @ngInject */
|
||||
constructor(
|
||||
private $scope: any,
|
||||
private $location: any,
|
||||
private contextSrv: any,
|
||||
private backendSrv: any) {
|
||||
private backendSrv: any,
|
||||
$location: any,
|
||||
contextSrv: any) {
|
||||
|
||||
contextSrv.sidemenu = false;
|
||||
$scope.ctrl = this;
|
||||
|
||||
@@ -7,7 +7,7 @@ export class DeltaCtrl {
|
||||
observer: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $rootScope) {
|
||||
constructor($rootScope) {
|
||||
const waitForCompile = function(mutations) {
|
||||
if (mutations.length === 1) {
|
||||
this.$rootScope.appEvent('json-diff-ready');
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
|
||||
import coreModule from '../core_module';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import _ from 'lodash';
|
||||
import config from 'app/core/config';
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
import {Observable} from 'vendor/npm/rxjs/Observable';
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
///<reference path="../headers/common.d.ts" />
|
||||
|
||||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
|
||||
export class Profiler {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import './dashboard_loaders';
|
||||
|
||||
import angular from 'angular';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import {BundleLoader} from './bundle_loader';
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
@@ -10,7 +9,7 @@ export class AlertSrv {
|
||||
list: any[];
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $timeout, private $sce, private $rootScope, private $modal) {
|
||||
constructor(private $timeout, private $rootScope, private $modal) {
|
||||
this.list = [];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import angular from 'angular';
|
||||
import _ from 'lodash';
|
||||
import config from 'app/core/config';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
@@ -12,7 +10,7 @@ export class BackendSrv {
|
||||
private noBackendCache: boolean;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $http, private alertSrv, private $rootScope, private $q, private $timeout, private contextSrv) {
|
||||
constructor(private $http, private alertSrv, private $q, private $timeout, private contextSrv) {
|
||||
}
|
||||
|
||||
get(url, params?) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import coreModule from '../core_module';
|
||||
class DynamicDirectiveSrv {
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $compile, private $parse, private $rootScope) {}
|
||||
constructor(private $compile, private $rootScope) {}
|
||||
|
||||
addDirective(element, name, scope) {
|
||||
var child = angular.element(document.createElement(name));
|
||||
|
||||
@@ -14,10 +14,7 @@ export class KeybindingSrv {
|
||||
/** @ngInject */
|
||||
constructor(
|
||||
private $rootScope,
|
||||
private $modal,
|
||||
private $location,
|
||||
private contextSrv,
|
||||
private $timeout) {
|
||||
private $location) {
|
||||
|
||||
// clear out all shortcuts on route change
|
||||
$rootScope.$on('$routeChangeSuccess', () => {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
import coreModule from 'app/core/core_module';
|
||||
import Drop from 'tether-drop';
|
||||
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import config from 'app/core/config';
|
||||
import _ from 'lodash';
|
||||
import $ from 'jquery';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import appEvents from 'app/core/app_events';
|
||||
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
|
||||
import EventEmitter from 'eventemitter3';
|
||||
|
||||
var hasOwnProp = {}.hasOwnProperty;
|
||||
|
||||
function createName(name) {
|
||||
return '$' + name;
|
||||
}
|
||||
|
||||
export class Emitter {
|
||||
emitter: any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user