diff --git a/fixtures/issue-33/adds.ts b/fixtures/issue-33/adds.ts new file mode 100644 index 00000000..80ec9122 --- /dev/null +++ b/fixtures/issue-33/adds.ts @@ -0,0 +1 @@ +import "rxjs/add/observable/from"; diff --git a/fixtures/issue-33/fixture.ts b/fixtures/issue-33/fixture.ts new file mode 100644 index 00000000..41041568 --- /dev/null +++ b/fixtures/issue-33/fixture.ts @@ -0,0 +1,3 @@ +import { Observable } from "rxjs/Observable"; + +const ob = Observable.from([]); diff --git a/fixtures/issue-33/tsconfig.json b/fixtures/issue-33/tsconfig.json new file mode 100644 index 00000000..b3f5b268 --- /dev/null +++ b/fixtures/issue-33/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "lib": ["es2015"], + "noEmit": true, + "paths": { + "rxjs": ["../node_modules/rxjs"] + }, + "skipLibCheck": true, + "target": "es5" + }, + "include": ["adds.ts", "fixture.ts"] +} diff --git a/fixtures/issue-33/tslint.json b/fixtures/issue-33/tslint.json new file mode 100644 index 00000000..bf011f05 --- /dev/null +++ b/fixtures/issue-33/tslint.json @@ -0,0 +1,15 @@ +{ + "defaultSeverity": "error", + "jsRules": {}, + "rules": { + "rxjs-add": { + "options": [{ + "allowElsewhere": false, + "allowUnused": false, + "file": "./adds.ts" + }], + "severity": "error" + } + }, + "rulesDirectory": "../../build/rules" +} diff --git a/source/fixtures-spec.ts b/source/fixtures-spec.ts index a6cd3ea7..f316d3c9 100644 --- a/source/fixtures-spec.ts +++ b/source/fixtures-spec.ts @@ -446,6 +446,17 @@ describe("fixtures", function (): void { }); }); + describe("issue-related fixtures", () => { + + describe("issue-33", () => { + + it("should not effect errors", () => { + const result = lint("issue-33", "tslint.json", "adds.ts"); + expect(result).to.have.property("errorCount", 0); + }); + }); + }); + describe("subject-related rules", () => { describe("async-subject-with-unsubscribe", () => {