diff --git a/src/tslintMulti.ts b/src/tslintMulti.ts index 1387b4d2864..2f028dffcc8 100644 --- a/src/tslintMulti.ts +++ b/src/tslintMulti.ts @@ -28,8 +28,8 @@ import { } from "./configuration"; import { EnableDisableRulesWalker } from "./enableDisableRules"; import { findFormatter } from "./formatterLoader"; -import { createLanguageService, wrapProgram } from "./language/languageServiceHost"; import { IFormatter } from "./language/formatter/formatter"; +import { createLanguageService, wrapProgram } from "./language/languageServiceHost"; import { RuleFailure } from "./language/rule/rule"; import { TypedRule } from "./language/rule/typedRule"; import { getSourceFile } from "./language/utils"; diff --git a/test/rules/no-unused-variable/type-checked/a.ts b/test/rules/no-unused-variable/type-checked/a.ts new file mode 100644 index 00000000000..abfc7078006 --- /dev/null +++ b/test/rules/no-unused-variable/type-checked/a.ts @@ -0,0 +1,2 @@ +export class A {} +export var a: A; diff --git a/test/rules/no-unused-variable/type-checked/test.ts.lint b/test/rules/no-unused-variable/type-checked/test.ts.lint new file mode 100644 index 00000000000..de64a5953ac --- /dev/null +++ b/test/rules/no-unused-variable/type-checked/test.ts.lint @@ -0,0 +1,5 @@ +import {a, A} from './a'; + +export class B { + static thing = a; +} diff --git a/test/rules/no-unused-variable/type-checked/tsconfig.json b/test/rules/no-unused-variable/type-checked/tsconfig.json new file mode 100644 index 00000000000..db953a729b9 --- /dev/null +++ b/test/rules/no-unused-variable/type-checked/tsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "declaration": true + } +} \ No newline at end of file diff --git a/test/rules/no-unused-variable/type-checked/tslint.json b/test/rules/no-unused-variable/type-checked/tslint.json new file mode 100644 index 00000000000..e81cc662cf1 --- /dev/null +++ b/test/rules/no-unused-variable/type-checked/tslint.json @@ -0,0 +1,8 @@ +{ + "linterOptions": { + "typeCheck": true + }, + "rules": { + "no-unused-variable": true + } +}