From 5d8ae54055c77d9eb64de3982a5c9f3781239ad9 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 29 Jan 2019 22:13:09 +0100 Subject: [PATCH] Enable grouped-imports for ordered-imports rule in tslint:all config (#4420) --- src/configs/all.ts | 1 + src/configuration.ts | 2 +- src/enableDisableRules.ts | 1 + src/formatterLoader.ts | 1 + src/formatters/checkstyleFormatter.ts | 1 - src/formatters/codeFrameFormatter.ts | 7 +++---- src/formatters/jsonFormatter.ts | 1 - src/formatters/junitFormatter.ts | 1 - src/formatters/pmdFormatter.ts | 1 - src/formatters/stylishFormatter.ts | 5 ++--- src/formatters/tapFormatter.ts | 1 - src/formatters/vsoFormatter.ts | 1 - src/language/formatter/abstractFormatter.ts | 1 + src/language/rule/abstractRule.ts | 1 + src/language/rule/typedRule.ts | 1 + src/language/walker/blockScopeAwareRuleWalker.ts | 1 + src/language/walker/programAwareRuleWalker.ts | 1 + src/language/walker/ruleWalker.ts | 1 + src/language/walker/scopeAwareRuleWalker.ts | 1 + src/language/walker/walker.ts | 1 + src/rules/arrowReturnShorthandRule.ts | 1 + src/rules/awaitPromiseRule.ts | 1 + src/rules/banTsIgnoreRule.ts | 2 ++ src/rules/classNameRule.ts | 1 + src/rules/completed-docs/blockExclusion.ts | 1 + src/rules/completed-docs/classExclusion.ts | 1 + src/rules/completed-docs/exclusion.ts | 1 + src/rules/completed-docs/exclusionDescriptors.ts | 1 + src/rules/completed-docs/exclusionFactory.ts | 1 + src/rules/completedDocsRule.ts | 1 + src/rules/curlyRule.ts | 2 ++ src/rules/cyclomaticComplexityRule.ts | 1 + src/rules/deprecationRule.ts | 1 + src/rules/fileHeaderRule.ts | 1 + src/rules/functionConstructorRule.ts | 1 + src/rules/importBlacklistRule.ts | 1 + src/rules/interfaceOverTypeLiteralRule.ts | 1 + src/rules/maxClassesPerFileRule.ts | 1 + src/rules/maxFileLineCountRule.ts | 1 + src/rules/maxLineLengthRule.ts | 1 + src/rules/newlineBeforeReturnRule.ts | 1 + src/rules/newlinePerChainedCallRule.ts | 1 + src/rules/noAnyRule.ts | 1 + src/rules/noDefaultImportRule.ts | 1 + src/rules/noDuplicateImportsRule.ts | 1 + src/rules/noEmptyInterfaceRule.ts | 1 + src/rules/noInferredEmptyObjectTypeRule.ts | 1 + src/rules/noInternalModuleRule.ts | 1 + src/rules/noInvalidThisRule.ts | 1 + src/rules/noMagicNumbersRule.ts | 2 +- src/rules/noParameterReassignmentRule.ts | 1 + src/rules/noSparseArraysRule.ts | 1 + src/rules/noStringThrowRule.ts | 1 + src/rules/noSubmoduleImportsRule.ts | 1 + src/rules/noTrailingWhitespaceRule.ts | 1 + src/rules/noUnboundMethodRule.ts | 1 + src/rules/noUnnecessaryCallbackWrapperRule.ts | 1 + src/rules/noUnnecessaryClassRule.ts | 6 +++--- src/rules/noUnnecessaryTypeAssertionRule.ts | 1 + src/rules/noUnsafeAnyRule.ts | 1 + src/rules/noUseBeforeDeclareRule.ts | 3 ++- src/rules/noVoidExpressionRule.ts | 1 + src/rules/objectLiteralKeyQuotesRule.ts | 1 + src/rules/objectLiteralShorthandRule.ts | 1 + src/rules/objectLiteralSortKeysRule.ts | 13 +++++++++++-- src/rules/oneVariablePerDeclarationRule.ts | 1 + src/rules/onlyArrowFunctionsRule.ts | 1 + src/rules/preferConstRule.ts | 4 ++-- src/rules/preferForOfRule.ts | 1 + src/rules/preferTemplateRule.ts | 1 + src/rules/preferWhileRule.ts | 2 ++ src/rules/promiseFunctionAsyncRule.ts | 1 + src/rules/quotemarkRule.ts | 1 + src/rules/radixRule.ts | 1 + src/rules/spaceBeforeFunctionParenRule.ts | 1 + src/rules/spaceWithinParensRule.ts | 2 +- src/rules/strictBooleanExpressionsRule.ts | 1 + src/rules/strictTypePredicatesRule.ts | 2 +- src/rules/switchDefaultRule.ts | 1 + src/rules/typedefRule.ts | 1 + src/rules/useDefaultTypeParameterRule.ts | 1 + src/rules/useIsnanRule.ts | 1 + src/verify/parse.ts | 1 + test/configurationTests.ts | 3 ++- test/executable/executableTests.ts | 1 + test/formatters/checkstyleFormatterTests.ts | 1 + test/formatters/codeFrameFormatterTests.ts | 2 +- test/formatters/externalFormatterTests.ts | 1 + test/formatters/fileslistFormatterTests.ts | 1 + test/formatters/jsonFormatterTests.ts | 1 + test/formatters/junitFormatterTests.ts | 1 + test/formatters/msbuildFormatterTests.ts | 1 + test/formatters/pmdFormatterTests.ts | 1 + test/formatters/proseFormatterTests.ts | 1 + test/formatters/stylishFormatterTests.ts | 1 + test/formatters/tapFormatterTests.ts | 1 + test/formatters/utils.ts | 1 + test/formatters/verboseFormatterTests.ts | 1 + test/formatters/vsoFormatterTests.ts | 1 + test/linterTests.ts | 2 ++ test/rule-tester/parseTests.ts | 1 + test/ruleLoaderTests.ts | 4 +++- test/runner/runnerTests.ts | 1 + test/utilsTests.ts | 1 + 104 files changed, 122 insertions(+), 28 deletions(-) diff --git a/src/configs/all.ts b/src/configs/all.ts index bb75db71b73..f85d32d0571 100644 --- a/src/configs/all.ts +++ b/src/configs/all.ts @@ -227,6 +227,7 @@ export const rules = { "ordered-imports": [ true, { + "grouped-imports": true, "import-sources-order": "case-insensitive", "named-imports-order": "case-insensitive", "module-source-path": "full", diff --git a/src/configuration.ts b/src/configuration.ts index 457de0f4556..fcb32b0db31 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -20,8 +20,8 @@ import * as yaml from "js-yaml"; import { Minimatch } from "minimatch"; import * as os from "os"; import * as path from "path"; -import { FatalError, showWarningOnce } from "./error"; +import { FatalError, showWarningOnce } from "./error"; import { IOptions, RuleSeverity } from "./language/rule/rule"; import { findRule } from "./ruleLoader"; import { arrayify, hasOwnProperty, stripComments, tryResolvePackage } from "./utils"; diff --git a/src/enableDisableRules.ts b/src/enableDisableRules.ts index 7b30ca2ae66..fd25aef0b2e 100644 --- a/src/enableDisableRules.ts +++ b/src/enableDisableRules.ts @@ -19,6 +19,7 @@ import * as utils from "tsutils"; import * as ts from "typescript"; + import { RuleFailure } from "./language/rule/rule"; /** diff --git a/src/formatterLoader.ts b/src/formatterLoader.ts index 9bf85c907ec..951b145ddda 100644 --- a/src/formatterLoader.ts +++ b/src/formatterLoader.ts @@ -17,6 +17,7 @@ import * as fs from "fs"; import * as path from "path"; + import { FormatterConstructor } from "./index"; import { camelize, tryResolvePackage } from "./utils"; diff --git a/src/formatters/checkstyleFormatter.ts b/src/formatters/checkstyleFormatter.ts index a77f0773f1e..36c224fc970 100644 --- a/src/formatters/checkstyleFormatter.ts +++ b/src/formatters/checkstyleFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/codeFrameFormatter.ts b/src/formatters/codeFrameFormatter.ts index 4f5d423fb5c..e1f490a873a 100644 --- a/src/formatters/codeFrameFormatter.ts +++ b/src/formatters/codeFrameFormatter.ts @@ -15,13 +15,12 @@ * limitations under the License. */ -import { AbstractFormatter } from "../language/formatter/abstractFormatter"; -import { IFormatterMetadata } from "../language/formatter/formatter"; -import { RuleFailure } from "../language/rule/rule"; - import codeFrame = require("babel-code-frame"); import chalk from "chalk"; +import { AbstractFormatter } from "../language/formatter/abstractFormatter"; +import { IFormatterMetadata } from "../language/formatter/formatter"; +import { RuleFailure } from "../language/rule/rule"; import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/jsonFormatter.ts b/src/formatters/jsonFormatter.ts index 74715c775df..e259ccdf545 100644 --- a/src/formatters/jsonFormatter.ts +++ b/src/formatters/jsonFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/junitFormatter.ts b/src/formatters/junitFormatter.ts index 7035b2fd945..b0ccf13b663 100644 --- a/src/formatters/junitFormatter.ts +++ b/src/formatters/junitFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/pmdFormatter.ts b/src/formatters/pmdFormatter.ts index 9d6f61dab5d..ee9f961830f 100644 --- a/src/formatters/pmdFormatter.ts +++ b/src/formatters/pmdFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/stylishFormatter.ts b/src/formatters/stylishFormatter.ts index c323b5b3ac4..7b35ebd19eb 100644 --- a/src/formatters/stylishFormatter.ts +++ b/src/formatters/stylishFormatter.ts @@ -15,12 +15,11 @@ * limitations under the License. */ +import chalk from "chalk"; + import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - -import chalk from "chalk"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/tapFormatter.ts b/src/formatters/tapFormatter.ts index e1ef5b8874d..e588562c6d9 100644 --- a/src/formatters/tapFormatter.ts +++ b/src/formatters/tapFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/formatters/vsoFormatter.ts b/src/formatters/vsoFormatter.ts index 9d32a4eda97..f9ab02aca2e 100644 --- a/src/formatters/vsoFormatter.ts +++ b/src/formatters/vsoFormatter.ts @@ -18,7 +18,6 @@ import { AbstractFormatter } from "../language/formatter/abstractFormatter"; import { IFormatterMetadata } from "../language/formatter/formatter"; import { RuleFailure } from "../language/rule/rule"; - import * as Utils from "../utils"; export class Formatter extends AbstractFormatter { diff --git a/src/language/formatter/abstractFormatter.ts b/src/language/formatter/abstractFormatter.ts index d9de37a7c46..28b262714fb 100644 --- a/src/language/formatter/abstractFormatter.ts +++ b/src/language/formatter/abstractFormatter.ts @@ -16,6 +16,7 @@ */ import { RuleFailure } from "../rule/rule"; + import { IFormatter, IFormatterMetadata } from "./formatter"; export abstract class AbstractFormatter implements IFormatter { diff --git a/src/language/rule/abstractRule.ts b/src/language/rule/abstractRule.ts index c44590d23e6..87264d52557 100644 --- a/src/language/rule/abstractRule.ts +++ b/src/language/rule/abstractRule.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { IWalker, WalkContext } from "../walker"; + import { IOptions, IRule, IRuleMetadata, RuleFailure, RuleSeverity } from "./rule"; export type NoInfer = T & { [K in keyof T]: T[K] }; diff --git a/src/language/rule/typedRule.ts b/src/language/rule/typedRule.ts index fc377edf42e..ab3fcb3197c 100644 --- a/src/language/rule/typedRule.ts +++ b/src/language/rule/typedRule.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { showWarningOnce } from "../../error"; + import { AbstractRule } from "./abstractRule"; import { ITypedRule, RuleFailure } from "./rule"; diff --git a/src/language/walker/blockScopeAwareRuleWalker.ts b/src/language/walker/blockScopeAwareRuleWalker.ts index dd03e30a5ec..34e2ee9c827 100644 --- a/src/language/walker/blockScopeAwareRuleWalker.ts +++ b/src/language/walker/blockScopeAwareRuleWalker.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { IOptions } from "../rule/rule"; import { isBlockScopeBoundary } from "../utils"; + import { ScopeAwareRuleWalker } from "./scopeAwareRuleWalker"; // tslint:disable:deprecation (extends deprecated class and uses deprecated utils - doesn't matter because it's deprecated, too) diff --git a/src/language/walker/programAwareRuleWalker.ts b/src/language/walker/programAwareRuleWalker.ts index c2bbf650e53..2e2342c1ef5 100644 --- a/src/language/walker/programAwareRuleWalker.ts +++ b/src/language/walker/programAwareRuleWalker.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { IOptions } from "../rule/rule"; + import { RuleWalker } from "./ruleWalker"; export class ProgramAwareRuleWalker extends RuleWalker { diff --git a/src/language/walker/ruleWalker.ts b/src/language/walker/ruleWalker.ts index 3e3b95347a0..90685899da2 100644 --- a/src/language/walker/ruleWalker.ts +++ b/src/language/walker/ruleWalker.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { Fix, IOptions, Replacement, RuleFailure } from "../rule/rule"; + import { SyntaxWalker } from "./syntaxWalker"; import { IWalker } from "./walker"; diff --git a/src/language/walker/scopeAwareRuleWalker.ts b/src/language/walker/scopeAwareRuleWalker.ts index 48d8b325d5a..27c17e91ecf 100644 --- a/src/language/walker/scopeAwareRuleWalker.ts +++ b/src/language/walker/scopeAwareRuleWalker.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { IOptions } from "../rule/rule"; import { isScopeBoundary } from "../utils"; + import { RuleWalker } from "./ruleWalker"; /** diff --git a/src/language/walker/walker.ts b/src/language/walker/walker.ts index e25d16fb741..1b1b3b97693 100644 --- a/src/language/walker/walker.ts +++ b/src/language/walker/walker.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { RuleFailure } from "../rule/rule"; + import { WalkContext } from "./walkContext"; export interface IWalker { diff --git a/src/rules/arrowReturnShorthandRule.ts b/src/rules/arrowReturnShorthandRule.ts index 0f1c2253017..4e0932b7dd0 100644 --- a/src/rules/arrowReturnShorthandRule.ts +++ b/src/rules/arrowReturnShorthandRule.ts @@ -20,6 +20,7 @@ import * as ts from "typescript"; import * as Lint from "../index"; import { hasCommentAfterPosition } from "../language/utils"; + import { codeExamples } from "./code-examples/arrowReturnShorthand.examples"; const OPTION_MULTILINE = "multiline"; diff --git a/src/rules/awaitPromiseRule.ts b/src/rules/awaitPromiseRule.ts index fbeed24e900..ff561a1aae6 100644 --- a/src/rules/awaitPromiseRule.ts +++ b/src/rules/awaitPromiseRule.ts @@ -23,6 +23,7 @@ import { isUnionOrIntersectionType, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.TypedRule { diff --git a/src/rules/banTsIgnoreRule.ts b/src/rules/banTsIgnoreRule.ts index 780c2ad5590..f238f08702f 100644 --- a/src/rules/banTsIgnoreRule.ts +++ b/src/rules/banTsIgnoreRule.ts @@ -17,7 +17,9 @@ import { forEachComment } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; + import { codeExamples } from "./code-examples/banTsIgnore.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/classNameRule.ts b/src/rules/classNameRule.ts index 8ac5e9aca6a..d03f7e2d1da 100644 --- a/src/rules/classNameRule.ts +++ b/src/rules/classNameRule.ts @@ -20,6 +20,7 @@ import * as ts from "typescript"; import * as Lint from "../index"; import { isPascalCased } from "../utils"; + import { codeExamples } from "./code-examples/className.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/completed-docs/blockExclusion.ts b/src/rules/completed-docs/blockExclusion.ts index f25106c864d..a4ddde0d585 100644 --- a/src/rules/completed-docs/blockExclusion.ts +++ b/src/rules/completed-docs/blockExclusion.ts @@ -19,6 +19,7 @@ import { hasModifier } from "tsutils"; import * as ts from "typescript"; import { ALL, Visibility, VISIBILITY_EXPORTED, VISIBILITY_INTERNAL } from "../completedDocsRule"; + import { Exclusion } from "./exclusion"; export interface IBlockExclusionDescriptor { diff --git a/src/rules/completed-docs/classExclusion.ts b/src/rules/completed-docs/classExclusion.ts index 884cebac038..f5e25df8f66 100644 --- a/src/rules/completed-docs/classExclusion.ts +++ b/src/rules/completed-docs/classExclusion.ts @@ -28,6 +28,7 @@ import { PRIVACY_PROTECTED, PRIVACY_PUBLIC, } from "../completedDocsRule"; + import { Exclusion } from "./exclusion"; export interface IClassExclusionDescriptor { diff --git a/src/rules/completed-docs/exclusion.ts b/src/rules/completed-docs/exclusion.ts index f36f86ab417..54e045e09d3 100644 --- a/src/rules/completed-docs/exclusion.ts +++ b/src/rules/completed-docs/exclusion.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import { All, ALL } from "../completedDocsRule"; + import { ExclusionDescriptor } from "./exclusionDescriptors"; export abstract class Exclusion { diff --git a/src/rules/completed-docs/exclusionDescriptors.ts b/src/rules/completed-docs/exclusionDescriptors.ts index 59a19580642..20caa948923 100644 --- a/src/rules/completed-docs/exclusionDescriptors.ts +++ b/src/rules/completed-docs/exclusionDescriptors.ts @@ -16,6 +16,7 @@ */ import { DocType } from "../completedDocsRule"; + import { IBlockExclusionDescriptor } from "./blockExclusion"; import { IClassExclusionDescriptor } from "./classExclusion"; import { ITagExclusionDescriptor } from "./tagExclusion"; diff --git a/src/rules/completed-docs/exclusionFactory.ts b/src/rules/completed-docs/exclusionFactory.ts index 071885f32e2..7f9acc47986 100644 --- a/src/rules/completed-docs/exclusionFactory.ts +++ b/src/rules/completed-docs/exclusionFactory.ts @@ -17,6 +17,7 @@ import { hasOwnProperty } from "../../utils"; import { DocType } from "../completedDocsRule"; + import { BlockExclusion, IBlockExclusionDescriptor } from "./blockExclusion"; import { ClassExclusion, IClassExclusionDescriptor } from "./classExclusion"; import { Exclusion } from "./exclusion"; diff --git a/src/rules/completedDocsRule.ts b/src/rules/completedDocsRule.ts index 3aabd11074a..102d5159221 100644 --- a/src/rules/completedDocsRule.ts +++ b/src/rules/completedDocsRule.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import * as Lint from "../index"; + import { IInputExclusionDescriptors } from "./completed-docs/exclusionDescriptors"; import { ExclusionFactory, ExclusionsMap } from "./completed-docs/exclusionFactory"; diff --git a/src/rules/curlyRule.ts b/src/rules/curlyRule.ts index c7aac3dcd09..0e828e22edb 100644 --- a/src/rules/curlyRule.ts +++ b/src/rules/curlyRule.ts @@ -17,7 +17,9 @@ import { isBlock, isIfStatement, isIterationStatement, isSameLine } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; + import { codeExamples } from "./code-examples/curly.examples"; const OPTION_AS_NEEDED = "as-needed"; diff --git a/src/rules/cyclomaticComplexityRule.ts b/src/rules/cyclomaticComplexityRule.ts index b476d037131..7632cd69346 100644 --- a/src/rules/cyclomaticComplexityRule.ts +++ b/src/rules/cyclomaticComplexityRule.ts @@ -17,6 +17,7 @@ import { isIdentifier } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; import { isFunctionScopeBoundary } from "../utils"; diff --git a/src/rules/deprecationRule.ts b/src/rules/deprecationRule.ts index 9493316da78..79753d13edf 100644 --- a/src/rules/deprecationRule.ts +++ b/src/rules/deprecationRule.ts @@ -32,6 +32,7 @@ import { isVariableDeclarationList, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.TypedRule { diff --git a/src/rules/fileHeaderRule.ts b/src/rules/fileHeaderRule.ts index 2d90a0a2003..03d44d342ff 100644 --- a/src/rules/fileHeaderRule.ts +++ b/src/rules/fileHeaderRule.ts @@ -16,6 +16,7 @@ */ import * as ts from "typescript"; + import * as Lint from "../index"; const ENFORCE_TRAILING_NEWLINE = "enforce-trailing-newline"; diff --git a/src/rules/functionConstructorRule.ts b/src/rules/functionConstructorRule.ts index 4df62e0b8e8..1e1e5ef19cf 100644 --- a/src/rules/functionConstructorRule.ts +++ b/src/rules/functionConstructorRule.ts @@ -19,6 +19,7 @@ import { isCallExpression, isIdentifier, isNewExpression } from "tsutils"; import * as ts from "typescript"; import * as Lint from ".."; + import { codeExamples } from "./code-examples/functionConstructor.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/importBlacklistRule.ts b/src/rules/importBlacklistRule.ts index a4c55e3ef3b..14db0d86909 100644 --- a/src/rules/importBlacklistRule.ts +++ b/src/rules/importBlacklistRule.ts @@ -23,6 +23,7 @@ import { isNamedImports, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/interfaceOverTypeLiteralRule.ts b/src/rules/interfaceOverTypeLiteralRule.ts index 289e8f7c8c9..1ee9fab03a3 100644 --- a/src/rules/interfaceOverTypeLiteralRule.ts +++ b/src/rules/interfaceOverTypeLiteralRule.ts @@ -17,6 +17,7 @@ import { getChildOfKind, isTypeAliasDeclaration, isTypeLiteralNode } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/maxClassesPerFileRule.ts b/src/rules/maxClassesPerFileRule.ts index fe5adc6a643..51e2dd1eff9 100644 --- a/src/rules/maxClassesPerFileRule.ts +++ b/src/rules/maxClassesPerFileRule.ts @@ -17,6 +17,7 @@ import { isClassDeclaration, isClassExpression } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; interface Options { diff --git a/src/rules/maxFileLineCountRule.ts b/src/rules/maxFileLineCountRule.ts index 4b752b3798a..780cbad9508 100644 --- a/src/rules/maxFileLineCountRule.ts +++ b/src/rules/maxFileLineCountRule.ts @@ -16,6 +16,7 @@ */ import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/maxLineLengthRule.ts b/src/rules/maxLineLengthRule.ts index 9f8f95aa819..ebb7f44abfe 100644 --- a/src/rules/maxLineLengthRule.ts +++ b/src/rules/maxLineLengthRule.ts @@ -17,6 +17,7 @@ import { getLineRanges } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; interface MaxLineLengthRuleOptions { diff --git a/src/rules/newlineBeforeReturnRule.ts b/src/rules/newlineBeforeReturnRule.ts index 4d67051ebdc..7ccef2d5eb8 100644 --- a/src/rules/newlineBeforeReturnRule.ts +++ b/src/rules/newlineBeforeReturnRule.ts @@ -17,6 +17,7 @@ import { getPreviousStatement } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/newlinePerChainedCallRule.ts b/src/rules/newlinePerChainedCallRule.ts index 3643eb649a7..8814d217924 100644 --- a/src/rules/newlinePerChainedCallRule.ts +++ b/src/rules/newlinePerChainedCallRule.ts @@ -22,6 +22,7 @@ import { isSameLine, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from ".."; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noAnyRule.ts b/src/rules/noAnyRule.ts index 86177edeef3..88cfd9b5483 100644 --- a/src/rules/noAnyRule.ts +++ b/src/rules/noAnyRule.ts @@ -18,6 +18,7 @@ import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noAny.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noDefaultImportRule.ts b/src/rules/noDefaultImportRule.ts index e69fe7f9638..dc7c629df59 100644 --- a/src/rules/noDefaultImportRule.ts +++ b/src/rules/noDefaultImportRule.ts @@ -17,6 +17,7 @@ import { isImportDeclaration, isNamedImports, isStringLiteral } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const fromModulesConfigOptionName = "fromModules"; diff --git a/src/rules/noDuplicateImportsRule.ts b/src/rules/noDuplicateImportsRule.ts index b102207cfa2..f662ae35de7 100644 --- a/src/rules/noDuplicateImportsRule.ts +++ b/src/rules/noDuplicateImportsRule.ts @@ -17,6 +17,7 @@ import { isImportDeclaration, isLiteralExpression, isModuleDeclaration } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noEmptyInterfaceRule.ts b/src/rules/noEmptyInterfaceRule.ts index 8f27b456882..a4b06706da2 100644 --- a/src/rules/noEmptyInterfaceRule.ts +++ b/src/rules/noEmptyInterfaceRule.ts @@ -19,6 +19,7 @@ import { isInterfaceDeclaration } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noEmptyInterface.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noInferredEmptyObjectTypeRule.ts b/src/rules/noInferredEmptyObjectTypeRule.ts index 212d6e16de7..70d0d60ae4f 100644 --- a/src/rules/noInferredEmptyObjectTypeRule.ts +++ b/src/rules/noInferredEmptyObjectTypeRule.ts @@ -17,6 +17,7 @@ import { isObjectFlagSet, isObjectType, isTypeReference } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.TypedRule { diff --git a/src/rules/noInternalModuleRule.ts b/src/rules/noInternalModuleRule.ts index fc79100e7a1..9671bf64e4b 100644 --- a/src/rules/noInternalModuleRule.ts +++ b/src/rules/noInternalModuleRule.ts @@ -17,6 +17,7 @@ import { isNodeFlagSet } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noInvalidThisRule.ts b/src/rules/noInvalidThisRule.ts index abf2c311b89..98c925b0cb1 100644 --- a/src/rules/noInvalidThisRule.ts +++ b/src/rules/noInvalidThisRule.ts @@ -17,6 +17,7 @@ import { isThisParameter } from "tsutils"; import * as ts from "typescript"; + import * as Lint from ".."; const OPTION_FUNCTION_IN_METHOD = "check-function-in-method"; diff --git a/src/rules/noMagicNumbersRule.ts b/src/rules/noMagicNumbersRule.ts index a3f1aa73d0f..a1ef9077fef 100644 --- a/src/rules/noMagicNumbersRule.ts +++ b/src/rules/noMagicNumbersRule.ts @@ -15,9 +15,9 @@ * limitations under the License. */ +import { isCallExpression, isIdentifier } from "tsutils"; import * as ts from "typescript"; -import { isCallExpression, isIdentifier } from "tsutils"; import * as Lint from "../index"; import { isNegativeNumberLiteral } from "../language/utils"; diff --git a/src/rules/noParameterReassignmentRule.ts b/src/rules/noParameterReassignmentRule.ts index c00107a7ed1..b0a47a781cd 100644 --- a/src/rules/noParameterReassignmentRule.ts +++ b/src/rules/noParameterReassignmentRule.ts @@ -21,6 +21,7 @@ import { isReassignmentTarget, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noSparseArraysRule.ts b/src/rules/noSparseArraysRule.ts index 13676253cbe..5654ddeb75e 100644 --- a/src/rules/noSparseArraysRule.ts +++ b/src/rules/noSparseArraysRule.ts @@ -19,6 +19,7 @@ import * as utils from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noSparseArrays.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noStringThrowRule.ts b/src/rules/noStringThrowRule.ts index f3a6a0b07f4..a970d890a74 100644 --- a/src/rules/noStringThrowRule.ts +++ b/src/rules/noStringThrowRule.ts @@ -19,6 +19,7 @@ import { isThrowStatement } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noStringThrowRule.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noSubmoduleImportsRule.ts b/src/rules/noSubmoduleImportsRule.ts index fcc3b6b3528..c0de3cc6f03 100644 --- a/src/rules/noSubmoduleImportsRule.ts +++ b/src/rules/noSubmoduleImportsRule.ts @@ -17,6 +17,7 @@ import { findImports, ImportKind } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noTrailingWhitespaceRule.ts b/src/rules/noTrailingWhitespaceRule.ts index 61ad922751f..d59f29ed7c1 100644 --- a/src/rules/noTrailingWhitespaceRule.ts +++ b/src/rules/noTrailingWhitespaceRule.ts @@ -19,6 +19,7 @@ import { forEachComment, forEachTokenWithTrivia, getLineRanges } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { getTemplateRanges } from "./noConsecutiveBlankLinesRule"; const OPTION_IGNORE_COMMENTS = "ignore-comments"; diff --git a/src/rules/noUnboundMethodRule.ts b/src/rules/noUnboundMethodRule.ts index 31c6136a2ac..ca6eb40e983 100644 --- a/src/rules/noUnboundMethodRule.ts +++ b/src/rules/noUnboundMethodRule.ts @@ -17,6 +17,7 @@ import { hasModifier, isPropertyAccessExpression } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_IGNORE_STATIC = "ignore-static"; diff --git a/src/rules/noUnnecessaryCallbackWrapperRule.ts b/src/rules/noUnnecessaryCallbackWrapperRule.ts index e19ad4d454a..ce4cb41e5f6 100644 --- a/src/rules/noUnnecessaryCallbackWrapperRule.ts +++ b/src/rules/noUnnecessaryCallbackWrapperRule.ts @@ -25,6 +25,7 @@ import { import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noUnnecessaryCallbackWrapper.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/noUnnecessaryClassRule.ts b/src/rules/noUnnecessaryClassRule.ts index cb6217097f1..4cc25098923 100644 --- a/src/rules/noUnnecessaryClassRule.ts +++ b/src/rules/noUnnecessaryClassRule.ts @@ -15,9 +15,6 @@ * limitations under the License. */ -import * as ts from "typescript"; -import * as Lint from "../index"; - import { getChildOfKind, hasModifier, @@ -25,6 +22,9 @@ import { isConstructorDeclaration, isParameterProperty, } from "tsutils"; +import * as ts from "typescript"; + +import * as Lint from "../index"; interface Options { allowConstructorOnly: boolean; diff --git a/src/rules/noUnnecessaryTypeAssertionRule.ts b/src/rules/noUnnecessaryTypeAssertionRule.ts index 964c73ce03b..6b5c89b673f 100644 --- a/src/rules/noUnnecessaryTypeAssertionRule.ts +++ b/src/rules/noUnnecessaryTypeAssertionRule.ts @@ -17,6 +17,7 @@ import { isObjectFlagSet, isObjectType, isTypeFlagSet } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; export class Rule extends Lint.Rules.TypedRule { diff --git a/src/rules/noUnsafeAnyRule.ts b/src/rules/noUnsafeAnyRule.ts index 8519d4ed889..37f18a2ccb8 100644 --- a/src/rules/noUnsafeAnyRule.ts +++ b/src/rules/noUnsafeAnyRule.ts @@ -24,6 +24,7 @@ import { isTypeNodeKind, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; import { isLowerCase } from "../utils"; diff --git a/src/rules/noUseBeforeDeclareRule.ts b/src/rules/noUseBeforeDeclareRule.ts index c8af65f744c..9dac76cb4e4 100644 --- a/src/rules/noUseBeforeDeclareRule.ts +++ b/src/rules/noUseBeforeDeclareRule.ts @@ -15,10 +15,11 @@ * limitations under the License. */ +import { isBindingElement } from "tsutils"; import * as ts from "typescript"; -import { isBindingElement } from "tsutils"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/noUseBeforeDeclare.examples"; export class Rule extends Lint.Rules.TypedRule { diff --git a/src/rules/noVoidExpressionRule.ts b/src/rules/noVoidExpressionRule.ts index 560a5caf8f8..798924dd4b6 100644 --- a/src/rules/noVoidExpressionRule.ts +++ b/src/rules/noVoidExpressionRule.ts @@ -17,6 +17,7 @@ import { isTypeFlagSet } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_IGNORE_ARROW_FUNCTION_SHORTHAND = "ignore-arrow-function-shorthand"; diff --git a/src/rules/objectLiteralKeyQuotesRule.ts b/src/rules/objectLiteralKeyQuotesRule.ts index ab517926570..ef7ef030be4 100644 --- a/src/rules/objectLiteralKeyQuotesRule.ts +++ b/src/rules/objectLiteralKeyQuotesRule.ts @@ -17,6 +17,7 @@ import { isObjectLiteralExpression, isValidPropertyName } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_ALWAYS = "always"; diff --git a/src/rules/objectLiteralShorthandRule.ts b/src/rules/objectLiteralShorthandRule.ts index ac029cf184e..de9a2d070bd 100644 --- a/src/rules/objectLiteralShorthandRule.ts +++ b/src/rules/objectLiteralShorthandRule.ts @@ -25,6 +25,7 @@ import { isShorthandPropertyAssignment, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from ".."; const OPTION_NEVER = "never"; diff --git a/src/rules/objectLiteralSortKeysRule.ts b/src/rules/objectLiteralSortKeysRule.ts index 2faff310158..0d7fcc2c9a9 100644 --- a/src/rules/objectLiteralSortKeysRule.ts +++ b/src/rules/objectLiteralSortKeysRule.ts @@ -26,6 +26,7 @@ import * as ts from "typescript"; import { showWarningOnce } from "../error"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/objectLiteralSortKeys.examples"; const OPTION_IGNORE_CASE = "ignore-case"; @@ -143,7 +144,9 @@ export class Rule extends Lint.Rules.OptionallyTypedRule { if (options.matchDeclarationOrder && options.matchDeclarationOrderOnly) { showWarningOnce( `"${OPTION_MATCH_DECLARATION_ORDER}" will be ignored since ` + - `"${OPTION_MATCH_DECLARATION_ORDER_ONLY}" has been enabled for ${this.ruleName}.` + `"${OPTION_MATCH_DECLARATION_ORDER_ONLY}" has been enabled for ${ + this.ruleName + }.`, ); return []; } @@ -174,7 +177,13 @@ function parseOptions(ruleArguments: any[]): Options { function walk(ctx: Lint.WalkContext, checker?: ts.TypeChecker): void { const { sourceFile, - options: { ignoreCase, localeCompare, matchDeclarationOrder, matchDeclarationOrderOnly, shorthandFirst }, + options: { + ignoreCase, + localeCompare, + matchDeclarationOrder, + matchDeclarationOrderOnly, + shorthandFirst, + }, } = ctx; ts.forEachChild(sourceFile, function cb(node): void { diff --git a/src/rules/oneVariablePerDeclarationRule.ts b/src/rules/oneVariablePerDeclarationRule.ts index f3c9d08a6c8..dc87ddd2554 100644 --- a/src/rules/oneVariablePerDeclarationRule.ts +++ b/src/rules/oneVariablePerDeclarationRule.ts @@ -19,6 +19,7 @@ import { isForStatement, isVariableStatement } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/oneVariablePerDeclaration.examples"; const OPTION_IGNORE_FOR_LOOP = "ignore-for-loop"; diff --git a/src/rules/onlyArrowFunctionsRule.ts b/src/rules/onlyArrowFunctionsRule.ts index 3acdb8e1227..d8b9fad3e87 100644 --- a/src/rules/onlyArrowFunctionsRule.ts +++ b/src/rules/onlyArrowFunctionsRule.ts @@ -19,6 +19,7 @@ import * as utils from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/onlyArrowFunctions.examples"; const OPTION_ALLOW_DECLARATIONS = "allow-declarations"; diff --git a/src/rules/preferConstRule.ts b/src/rules/preferConstRule.ts index ab55262025f..1cf7610e342 100644 --- a/src/rules/preferConstRule.ts +++ b/src/rules/preferConstRule.ts @@ -15,10 +15,10 @@ * limitations under the License. */ +import * as utils from "tsutils"; import * as ts from "typescript"; -import * as Lint from "../index"; -import * as utils from "tsutils"; +import * as Lint from "../index"; const OPTION_DESTRUCTURING_ALL = "all"; const OPTION_DESTRUCTURING_ANY = "any"; diff --git a/src/rules/preferForOfRule.ts b/src/rules/preferForOfRule.ts index ce6097ef6d2..b75b1fdeb93 100644 --- a/src/rules/preferForOfRule.ts +++ b/src/rules/preferForOfRule.ts @@ -17,6 +17,7 @@ import * as utils from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; import { unwrapParentheses } from "../language/utils"; diff --git a/src/rules/preferTemplateRule.ts b/src/rules/preferTemplateRule.ts index 93b74a1d2d3..179c3b9e47f 100644 --- a/src/rules/preferTemplateRule.ts +++ b/src/rules/preferTemplateRule.ts @@ -19,6 +19,7 @@ import { isBinaryExpression } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/preferTemplate.examples"; const OPTION_SINGLE_CONCAT = "allow-single-concat"; diff --git a/src/rules/preferWhileRule.ts b/src/rules/preferWhileRule.ts index 90b9d6fd582..b49b72e3267 100644 --- a/src/rules/preferWhileRule.ts +++ b/src/rules/preferWhileRule.ts @@ -17,7 +17,9 @@ import { isForStatement } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; + import { codeExamples } from "./code-examples/preferWhile.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/promiseFunctionAsyncRule.ts b/src/rules/promiseFunctionAsyncRule.ts index c15df7d3af2..1627212e38c 100644 --- a/src/rules/promiseFunctionAsyncRule.ts +++ b/src/rules/promiseFunctionAsyncRule.ts @@ -17,6 +17,7 @@ import { hasModifier } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_FUNCTION_DECLARATION = "check-function-declaration"; diff --git a/src/rules/quotemarkRule.ts b/src/rules/quotemarkRule.ts index aef05c8c963..055d4ebe6cd 100644 --- a/src/rules/quotemarkRule.ts +++ b/src/rules/quotemarkRule.ts @@ -17,6 +17,7 @@ import { isNoSubstitutionTemplateLiteral, isSameLine, isStringLiteral } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_SINGLE = "single"; diff --git a/src/rules/radixRule.ts b/src/rules/radixRule.ts index a158b2914e8..b5871d81c4a 100644 --- a/src/rules/radixRule.ts +++ b/src/rules/radixRule.ts @@ -19,6 +19,7 @@ import { isCallExpression, isIdentifier, isPropertyAccessExpression } from "tsut import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/radix.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/spaceBeforeFunctionParenRule.ts b/src/rules/spaceBeforeFunctionParenRule.ts index 440a149df75..81ec458ef47 100644 --- a/src/rules/spaceBeforeFunctionParenRule.ts +++ b/src/rules/spaceBeforeFunctionParenRule.ts @@ -17,6 +17,7 @@ import { getChildOfKind, hasModifier } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const ALWAYS_OR_NEVER = { diff --git a/src/rules/spaceWithinParensRule.ts b/src/rules/spaceWithinParensRule.ts index aa8e077de6f..3fe696b6f00 100644 --- a/src/rules/spaceWithinParensRule.ts +++ b/src/rules/spaceWithinParensRule.ts @@ -16,8 +16,8 @@ */ import { forEachToken } from "tsutils"; - import * as ts from "typescript"; + import * as Lint from "../index"; interface Options { diff --git a/src/rules/strictBooleanExpressionsRule.ts b/src/rules/strictBooleanExpressionsRule.ts index 11807019287..55495ad46f7 100644 --- a/src/rules/strictBooleanExpressionsRule.ts +++ b/src/rules/strictBooleanExpressionsRule.ts @@ -17,6 +17,7 @@ import { isTypeFlagSet } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; const OPTION_ALLOW_NULL_UNION = "allow-null-union"; diff --git a/src/rules/strictTypePredicatesRule.ts b/src/rules/strictTypePredicatesRule.ts index 2a878137f2a..64886babebf 100644 --- a/src/rules/strictTypePredicatesRule.ts +++ b/src/rules/strictTypePredicatesRule.ts @@ -22,8 +22,8 @@ import { isTypeFlagSet, isUnionType, } from "tsutils"; - import * as ts from "typescript"; + import { showWarningOnce } from "../error"; import * as Lint from "../index"; diff --git a/src/rules/switchDefaultRule.ts b/src/rules/switchDefaultRule.ts index 6a23ec6313d..ac99f66445f 100644 --- a/src/rules/switchDefaultRule.ts +++ b/src/rules/switchDefaultRule.ts @@ -19,6 +19,7 @@ import { isDefaultClause } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/switchDefault.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/rules/typedefRule.ts b/src/rules/typedefRule.ts index e4096781920..778e3000309 100644 --- a/src/rules/typedefRule.ts +++ b/src/rules/typedefRule.ts @@ -19,6 +19,7 @@ import * as utils from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/typedef.examples"; interface Options { diff --git a/src/rules/useDefaultTypeParameterRule.ts b/src/rules/useDefaultTypeParameterRule.ts index 23493bcb23a..2c1c134e2f4 100644 --- a/src/rules/useDefaultTypeParameterRule.ts +++ b/src/rules/useDefaultTypeParameterRule.ts @@ -22,6 +22,7 @@ import { isTypeAliasDeclaration, } from "tsutils"; import * as ts from "typescript"; + import * as Lint from "../index"; import { find } from "../utils"; diff --git a/src/rules/useIsnanRule.ts b/src/rules/useIsnanRule.ts index 14bd71d8372..6d44a0cde89 100644 --- a/src/rules/useIsnanRule.ts +++ b/src/rules/useIsnanRule.ts @@ -19,6 +19,7 @@ import { isBinaryExpression } from "tsutils"; import * as ts from "typescript"; import * as Lint from "../index"; + import { codeExamples } from "./code-examples/useIsnan.examples"; export class Rule extends Lint.Rules.AbstractRule { diff --git a/src/verify/parse.ts b/src/verify/parse.ts index ef7998af602..2bffe3a1fe1 100644 --- a/src/verify/parse.ts +++ b/src/verify/parse.ts @@ -20,6 +20,7 @@ import * as ts from "typescript"; import { format } from "util"; import { flatMap, mapDefined } from "../utils"; + import { CodeLine, EndErrorLine, diff --git a/test/configurationTests.ts b/test/configurationTests.ts index e5f087a72d1..c3c542430a0 100644 --- a/test/configurationTests.ts +++ b/test/configurationTests.ts @@ -27,7 +27,8 @@ import { parseConfigFile, RawConfigFile, } from "../src/configuration"; -import { IOptions, RuleSeverity } from "./../src/language/rule/rule"; +import { IOptions, RuleSeverity } from "../src/language/rule/rule"; + import { createTempFile } from "./utils"; describe("Configuration", () => { diff --git a/test/executable/executableTests.ts b/test/executable/executableTests.ts index b4f89b89382..c28ea1a6965 100644 --- a/test/executable/executableTests.ts +++ b/test/executable/executableTests.ts @@ -20,6 +20,7 @@ import * as fs from "fs"; import * as os from "os"; import * as path from "path"; import * as semver from "semver"; + import { Logger, Options, run, Status } from "../../src/runner"; import { denormalizeWinPath } from "../../src/utils"; import { getNormalizedTypescriptVersion } from "../../src/verify/parse"; diff --git a/test/formatters/checkstyleFormatterTests.ts b/test/formatters/checkstyleFormatterTests.ts index 52fccea52de..257c7710997 100644 --- a/test/formatters/checkstyleFormatterTests.ts +++ b/test/formatters/checkstyleFormatterTests.ts @@ -19,6 +19,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("Checkstyle Formatter", () => { diff --git a/test/formatters/codeFrameFormatterTests.ts b/test/formatters/codeFrameFormatterTests.ts index 270073f75bb..bb9bbd7e291 100644 --- a/test/formatters/codeFrameFormatterTests.ts +++ b/test/formatters/codeFrameFormatterTests.ts @@ -16,10 +16,10 @@ import { assert } from "chai"; import chalk from "chalk"; - import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("CodeFrame Formatter", () => { diff --git a/test/formatters/externalFormatterTests.ts b/test/formatters/externalFormatterTests.ts index db09fbce618..fbdaf435165 100644 --- a/test/formatters/externalFormatterTests.ts +++ b/test/formatters/externalFormatterTests.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { dedent } from "../../src/utils"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("External Formatter", () => { diff --git a/test/formatters/fileslistFormatterTests.ts b/test/formatters/fileslistFormatterTests.ts index ac15bccbeed..5180f240346 100644 --- a/test/formatters/fileslistFormatterTests.ts +++ b/test/formatters/fileslistFormatterTests.ts @@ -18,6 +18,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("Files-list Formatter", () => { diff --git a/test/formatters/jsonFormatterTests.ts b/test/formatters/jsonFormatterTests.ts index a428bbc184f..b86505ee6c6 100644 --- a/test/formatters/jsonFormatterTests.ts +++ b/test/formatters/jsonFormatterTests.ts @@ -18,6 +18,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, IRuleFailureJson, Replacement, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("JSON Formatter", () => { diff --git a/test/formatters/junitFormatterTests.ts b/test/formatters/junitFormatterTests.ts index 04bbcdfe63a..519e712a564 100644 --- a/test/formatters/junitFormatterTests.ts +++ b/test/formatters/junitFormatterTests.ts @@ -19,6 +19,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("JUnit Formatter", () => { diff --git a/test/formatters/msbuildFormatterTests.ts b/test/formatters/msbuildFormatterTests.ts index 13847e85788..ec55f9e65fa 100644 --- a/test/formatters/msbuildFormatterTests.ts +++ b/test/formatters/msbuildFormatterTests.ts @@ -19,6 +19,7 @@ import * as path from "path"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("MSBuild Formatter", () => { diff --git a/test/formatters/pmdFormatterTests.ts b/test/formatters/pmdFormatterTests.ts index ffe672d276e..34e7a1e8e8b 100644 --- a/test/formatters/pmdFormatterTests.ts +++ b/test/formatters/pmdFormatterTests.ts @@ -18,6 +18,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("PMD Formatter", () => { diff --git a/test/formatters/proseFormatterTests.ts b/test/formatters/proseFormatterTests.ts index e111f94c70b..4b388740c3b 100644 --- a/test/formatters/proseFormatterTests.ts +++ b/test/formatters/proseFormatterTests.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { dedent } from "../../src/utils"; import { IFormatter, RuleFailure, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("Prose Formatter", () => { diff --git a/test/formatters/stylishFormatterTests.ts b/test/formatters/stylishFormatterTests.ts index eb398f477e3..181f3d936e1 100644 --- a/test/formatters/stylishFormatterTests.ts +++ b/test/formatters/stylishFormatterTests.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { dedent } from "../../src/utils"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("Stylish Formatter", () => { diff --git a/test/formatters/tapFormatterTests.ts b/test/formatters/tapFormatterTests.ts index bd6b8525841..8b31d1a1e00 100644 --- a/test/formatters/tapFormatterTests.ts +++ b/test/formatters/tapFormatterTests.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { dedent } from "../../src/utils"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("TAP Formatter", () => { diff --git a/test/formatters/utils.ts b/test/formatters/utils.ts index d426bd8762d..f83e5d51f71 100644 --- a/test/formatters/utils.ts +++ b/test/formatters/utils.ts @@ -15,6 +15,7 @@ * limitations under the License. */ import * as ts from "typescript"; + import { Fix, RuleFailure, RuleSeverity } from "../../src/language/rule/rule"; export function createFailure( diff --git a/test/formatters/verboseFormatterTests.ts b/test/formatters/verboseFormatterTests.ts index ac338a509c2..3b6ef9c8bcc 100644 --- a/test/formatters/verboseFormatterTests.ts +++ b/test/formatters/verboseFormatterTests.ts @@ -19,6 +19,7 @@ import * as ts from "typescript"; import { dedent } from "../../src/utils"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("Verbose Formatter", () => { diff --git a/test/formatters/vsoFormatterTests.ts b/test/formatters/vsoFormatterTests.ts index cb1a767fabf..ce417aa7cee 100644 --- a/test/formatters/vsoFormatterTests.ts +++ b/test/formatters/vsoFormatterTests.ts @@ -18,6 +18,7 @@ import { assert } from "chai"; import * as ts from "typescript"; import { IFormatter, TestUtils } from "../lint"; + import { createFailure } from "./utils"; describe("VSO Formatter", () => { diff --git a/test/linterTests.ts b/test/linterTests.ts index 05a50f95707..d5a0d7e2f90 100644 --- a/test/linterTests.ts +++ b/test/linterTests.ts @@ -18,9 +18,11 @@ import { assert } from "chai"; import * as fs from "fs"; import { createSourceFile, ScriptTarget } from "typescript"; + import { DEFAULT_CONFIG } from "../src/configuration"; import { Replacement, RuleFailure } from "../src/language/rule/rule"; import { Linter } from "../src/linter"; + import { createTempFile } from "./utils"; class TestLinter extends Linter { diff --git a/test/rule-tester/parseTests.ts b/test/rule-tester/parseTests.ts index a5398b3a0f5..7beb27da788 100644 --- a/test/rule-tester/parseTests.ts +++ b/test/rule-tester/parseTests.ts @@ -17,6 +17,7 @@ import { assert } from "chai"; import * as parse from "../../src/verify/parse"; + import * as testData from "./testData"; describe("Rule Test Parse", () => { diff --git a/test/ruleLoaderTests.ts b/test/ruleLoaderTests.ts index a780290e816..f41a8c7e775 100644 --- a/test/ruleLoaderTests.ts +++ b/test/ruleLoaderTests.ts @@ -18,9 +18,11 @@ import { assert } from "chai"; import * as fs from "fs"; import * as path from "path"; + import { rules as allRules, RULES_EXCLUDED_FROM_ALL_CONFIG } from "../src/configs/all"; +import { IOptions } from "../src/language/rule/rule"; import { camelize } from "../src/utils"; -import { IOptions } from "./../src/language/rule/rule"; + import { findRule, loadRules, RuleConstructor } from "./lint"; const builtRulesDir = "build/src/rules"; diff --git a/test/runner/runnerTests.ts b/test/runner/runnerTests.ts index a2aba633f8e..02400c41c6c 100644 --- a/test/runner/runnerTests.ts +++ b/test/runner/runnerTests.ts @@ -15,6 +15,7 @@ */ import { assert } from "chai"; + import { Options, run, Status } from "../../src/runner"; const customRulesOptions: Options = { diff --git a/test/utilsTests.ts b/test/utilsTests.ts index a1023b07f7b..acd6e68ebd3 100644 --- a/test/utilsTests.ts +++ b/test/utilsTests.ts @@ -15,6 +15,7 @@ */ import { assert } from "chai"; + import { arrayify, dedent, escapeRegExp } from "../src/utils"; describe("Utils", () => {