Skip to content

Commit

Permalink
Fix some lint (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford authored and Stephen Weatherford committed Apr 19, 2018
1 parent fc0679d commit 94cf3f0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/Hover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

// tslint:disable max-classes-per-file // Grandfathered in

import * as language from "./Language";

/**
Expand Down Expand Up @@ -59,4 +61,4 @@ export class VariableReferenceInfo extends Info {
public getHoverText(): string {
return `**${this._name}** (variable)`;
}
}
}
7 changes: 5 additions & 2 deletions src/JSON.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

// tslint:disable switch-default // Grandfathered in
// tslint:disable max-classes-per-file // Grandfathered in

import * as assert from "assert";

import * as basic from "./Tokenizer";
Expand Down Expand Up @@ -555,7 +558,7 @@ export class ObjectValue extends Value {
}

/**
* Get the property names
* Get the property names
*/
public get propertyNames(): string[] {
return Object.keys(this.propertyMap);
Expand Down Expand Up @@ -1096,4 +1099,4 @@ export abstract class Visitor {

public visitNullValue(nullValue: NullValue): void {
}
}
}
3 changes: 3 additions & 0 deletions src/TLE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

// TLE = Template Language Expression

// tslint:disable:switch-default // Grandfathered in
// tslint:disable max-classes-per-file // Grandfathered in

import * as assert from "assert";

import * as assets from "./AzureRMAssets";
Expand Down
8 changes: 5 additions & 3 deletions src/Telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

// tslint:disable max-classes-per-file // Grandfathered in

import * as appInsights from "applicationinsights";
import * as assert from "assert";
import * as fs from "fs";
Expand Down Expand Up @@ -136,7 +138,7 @@ export class VSCode extends Endpoint {
if (reporter) {
let properties: { [key: string]: string } = undefined;
let measurements: { [key: string]: number } = undefined;

for (let propertyName in event) {
if (propertyName !== "eventName") {
let propertyValue = event[propertyName];
Expand All @@ -157,7 +159,7 @@ export class VSCode extends Endpoint {

reporter.sendTelemetryEvent(event.eventName, properties, measurements);
}
}
}
}

/**
Expand Down Expand Up @@ -256,4 +258,4 @@ export class List extends Endpoint {
endpoint.close();
}
}
}
}
7 changes: 7 additions & 0 deletions src/Treeview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

// tslint:disable:no-var-keyword // Grandfathered in
// tslint:disable:no-duplicate-variable // Grandfathered in

import * as Json from "./JSON";
import * as vscode from "vscode";
import { TreeItem } from "vscode";
Expand Down
3 changes: 2 additions & 1 deletion src/VSCodeTelReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import TelemetryReporter from 'vscode-extension-telemetry';
import * as vscode from 'vscode';

export var reporter: TelemetryReporter;
export let reporter: TelemetryReporter;

export class Reporter extends vscode.Disposable {
constructor(ctx: vscode.ExtensionContext) {
Expand All @@ -26,6 +26,7 @@ interface IPackageInfo {
}

function getPackageInfo(context: vscode.ExtensionContext): IPackageInfo | undefined {
// tslint:disable-next-line:non-literal-require
let extensionPackage = require(context.asAbsolutePath('./package.json'));
if (extensionPackage) {
return {
Expand Down
1 change: 1 addition & 0 deletions test/SurveyMetadata.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as assert from "assert";
import { SurveyMetadata } from "../src/SurveyMetadata";
import { SurveySettings } from "../src/SurveySettings";

// tslint:disable-next-line:no-suspicious-comment
// TODO: Re-enable as part of https://github.com/Microsoft/vscode-azurearmtools/issues/51
function suiteDisabled(name: string, func: Function) {
}
Expand Down
1 change: 1 addition & 0 deletions test/SurveySettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as assert from "assert";

import { SurveySettings } from "../src/SurveySettings";

// tslint:disable-next-line:no-suspicious-comment
// TODO: Re-enable as part of https://github.com/Microsoft/vscode-azurearmtools/issues/51
function suiteDisabled(name: string, func: Function) {
}
Expand Down
13 changes: 6 additions & 7 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"no-string-based-set-immediate": true,
"no-string-based-set-interval": true,
"no-string-based-set-timeout": true,
// TODO: "non-literal-require": true,
"non-literal-require": true,
"possible-timing-attack": true,
"react-anchor-blank-noopener": true,
"react-iframe-missing-sandbox": true,
Expand Down Expand Up @@ -54,7 +54,7 @@
"no-debugger": true,
"no-duplicate-switch-case": true,
"no-duplicate-super": true,
// TODO: "no-duplicate-variable": true,
"no-duplicate-variable": true,
// TODO: "no-empty": true,
"no-floating-promises": true,
// TODO: "no-for-in-array": true,
Expand Down Expand Up @@ -93,14 +93,13 @@
"allow-undefined-union", // changed
"allow-mix" // changed
],
// TODO: "switch-default": true,
"switch-default": true,
"triple-equals": [
false, // TODO: true,
"allow-null-check"
],
"use-isnan": true,
"use-named-parameter": true,
"typeof-compare": true,
"adjacent-overload-signatures": true,
"array-type": [
true,
Expand All @@ -122,7 +121,7 @@
// TODO: "interface-name": true,
"jsdoc-format": true,
"max-classes-per-file": [
false, // TODO: true,
true,
3
],
"max-file-line-count": true,
Expand Down Expand Up @@ -159,14 +158,14 @@
"no-relative-imports": false, // changed
"no-require-imports": false, // changed
//TODO: "no-shadowed-variable": true,
// TODO: "no-suspicious-comment": true,
"no-suspicious-comment": true,
"no-typeof-undefined": true,
"no-unnecessary-field-initialization": true,
// TODO: "no-unnecessary-local-variable": true,
"no-unnecessary-qualifier": true,
"no-unsupported-browser-code": true,
"no-useless-files": true,
// TODO: "no-var-keyword": true,
"no-var-keyword": true,
// TODO: "no-var-requires": true,
// TODO: "no-var-self": true,
"no-void-expression": [
Expand Down

0 comments on commit 94cf3f0

Please sign in to comment.