Skip to content

Commit

Permalink
test(unused): Add failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Apr 12, 2019
1 parent 8dd2862 commit 2980e01
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fixtures/no-unused-declaration/unused-types/fixture.ts.fix
@@ -0,0 +1,2 @@
class Person {}

6 changes: 6 additions & 0 deletions fixtures/no-unused-declaration/unused-types/fixture.ts.lint
@@ -0,0 +1,6 @@
interface SomeInterface {}
~~~~~~~~~~~~~ [no-unused-declaration]
type SomeType = {};
~~~~~~~~ [no-unused-declaration]

[no-unused-declaration]: Unused declarations are forbidden
5 changes: 5 additions & 0 deletions fixtures/no-unused-declaration/unused-types/tsconfig.json
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"module": "commonjs"
}
}
8 changes: 8 additions & 0 deletions fixtures/no-unused-declaration/unused-types/tslint.json
@@ -0,0 +1,8 @@
{
"defaultSeverity": "error",
"jsRules": {},
"rules": {
"no-unused-declaration": { "severity": "error" }
},
"rulesDirectory": "../../../build/rules"
}
7 changes: 7 additions & 0 deletions fixtures/no-unused-declaration/used-types/fixture.ts.lint
@@ -0,0 +1,7 @@
interface SomeInterface {}
type SomeType = {};

declare const a: SomeInterface;
declare const b: SomeType;

console.log(a, b);
5 changes: 5 additions & 0 deletions fixtures/no-unused-declaration/used-types/tsconfig.json
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"module": "commonjs"
}
}
8 changes: 8 additions & 0 deletions fixtures/no-unused-declaration/used-types/tslint.json
@@ -0,0 +1,8 @@
{
"defaultSeverity": "error",
"jsRules": {},
"rules": {
"no-unused-declaration": { "severity": "error" }
},
"rulesDirectory": "../../../build/rules"
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"test": "yarn run lint && yarn run test:build && yarn run test:tslint",
"test:build": "yarn run test:clean && tsc -p tsconfig.json",
"test:clean": "rimraf build",
"test:debug": "tslint --test fixtures/no-const-enum/local/tslint.json",
"test:debug": "tslint --test fixtures/no-unused-declaration/**/tslint.json",
"test:tslint": "tslint --test fixtures/**/tslint.json"
},
"version": "1.5.0"
Expand Down

0 comments on commit 2980e01

Please sign in to comment.