Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

refactor: removed 'export = Linter` in linter.ts #3438

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import * as Configuration from "./configuration";
import * as Formatters from "./formatters";
import { FormatterConstructor } from "./language/formatter/formatter";
import { RuleFailure } from "./language/rule/rule";
import * as Linter from "./linter";
import * as Rules from "./rules";
import * as Test from "./test";
import * as Utils from "./utils";

export { Configuration, Formatters, Linter, Rules, Test, Utils };
export { Configuration, Formatters, Rules, Test, Utils };

export * from "./linter";
export * from "./language/rule/rule";
export * from "./enableDisableRules";
export * from "./formatterLoader";
Expand Down
7 changes: 1 addition & 6 deletions src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { arrayify, dedent, flatMap, mapDefined } from "./utils";
/**
* Linter that can lint multiple files in consecutive runs.
*/
class Linter {
export class Linter {
public static VERSION = "5.8.0";

public static findConfiguration = findConfiguration;
Expand Down Expand Up @@ -262,11 +262,6 @@ class Linter {
}
}

// tslint:disable-next-line:no-namespace
namespace Linter { }

export = Linter;

function createMultiMap<T, K, V>(inputs: T[], getPair: (input: T) => [K, V] | undefined): Map<K, V[]> {
const map = new Map<K, V[]>();
for (const input of inputs) {
Expand Down
2 changes: 1 addition & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from "./configuration";
import { FatalError } from "./error";
import { LintResult } from "./index";
import * as Linter from "./linter";
import { Linter } from "./linter";
import { flatMap } from "./utils";

export interface Options {
Expand Down
2 changes: 1 addition & 1 deletion src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import * as semver from "semver";
import * as ts from "typescript";

import { Replacement } from "./language/rule/rule";
import * as Linter from "./linter";
import { Linter } from "./linter";
import { Logger } from "./runner";
import { denormalizeWinPath, mapDefined, readBufferWithDetectedEncoding } from "./utils";
import { LintError } from "./verify/lintError";
Expand Down
4 changes: 2 additions & 2 deletions src/tslint-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import commander = require("commander");
import * as fs from "fs";

import { VERSION } from "./linter";
import { Linter } from "./linter";
import { run } from "./runner";
import { arrayify, dedent } from "./utils";

Expand Down Expand Up @@ -205,7 +205,7 @@ const builtinOptions: Option[] = [
},
];

commander.version(VERSION, "-v, --version");
commander.version(Linter.VERSION, "-v, --version");

for (const option of options) {
const commanderStr = optionUsageTag(option) + optionParam(option);
Expand Down
2 changes: 1 addition & 1 deletion test/linterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { createSourceFile, ScriptTarget } from "typescript";
import { Replacement, RuleFailure } from "../src/language/rule/rule";
import { createTempFile } from "./utils";

import Linter = require("../src/linter");
import { Linter } from "../src/linter";

class TestLinter extends Linter {
public applyFixesHelper(fileName: string, source: string, ruleFailures: RuleFailure[]) {
Expand Down
2 changes: 1 addition & 1 deletion test/ruleTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { assert } from "chai";

import { parseConfigFile } from "../src/configuration";
import * as Linter from "../src/linter";
import { Linter } from "../src/linter";

describe("no-implicit-dependencies", () => {
it("assumes empty package.json if not found", () => {
Expand Down