Skip to content

Commit

Permalink
test(scope): Add failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Jul 31, 2018
1 parent 3e66800 commit a72b5e5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/v6/fixtures/issues/54/fixture.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { of } from "rxjs";
import { map, tap } from "rxjs/operators";

ok_mapAnArray () {
const q = '123'
return [ 1, 2, 3 ].map(val => {
return `${q}-${val}`
})
}

notOk_mapAnArrayFromParam (input: { q: string }) {
const { q } = input
return [ 1, 2, 3 ].map(val => {
return `${q}-${val}`
})
}

[no-unsafe-scope]: Unsafe scopes are forbidden
13 changes: 13 additions & 0 deletions test/v6/fixtures/issues/54/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"baseUrl": ".",
"lib": ["es2015"],
"noEmit": true,
"paths": {
"rxjs": ["../../node_modules/rxjs"]
},
"skipLibCheck": true,
"target": "es5"
},
"include": ["fixture.ts"]
}
8 changes: 8 additions & 0 deletions test/v6/fixtures/issues/54/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"defaultSeverity": "error",
"jsRules": {},
"rules": {
"rxjs-no-unsafe-scope": { "severity": "error" }
},
"rulesDirectory": "../../../../../build/rules"
}

0 comments on commit a72b5e5

Please sign in to comment.