Skip to content

Commit

Permalink
test(scope): Add failing test for #70.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Dec 24, 2018
1 parent 4a22cf6 commit 86335ff
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"test": "yarn run lint && yarn run test:build && yarn run test:mocha && yarn run test:tslint-v5 && yarn run test:tslint-v6 && yarn run test:tslint-v6-compat",
"test:build": "yarn run test:clean && tsc -p tsconfig.json",
"test:clean": "rimraf build",
"test:debug": "tslint --test ./test/v6/fixtures/issues/68/tslint.json",
"test:debug": "tslint --test ./test/v6/fixtures/issues/70/tslint.json",
"test:issues": "yarn run test:clean && tsc -p tsconfig.json && tslint --test ./test/v6/fixtures/issues/**/tslint.json",
"test:mocha": "mocha build/**/*-spec.js",
"test:tslint-v5": "yarn --cwd ./test/v5 install && yarn --cwd ./test/v5 upgrade && tslint --test ./test/v5/fixtures/**/tslint.json",
Expand Down
14 changes: 14 additions & 0 deletions test/v6/fixtures/issues/70/fixture.ts.lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { of } from 'rxjs'
import { concatMap } from 'rxjs/operators'
import importedFunc from './func'

function localFunc (s: any) {
return of(null)
}

const defaultExportTemplateLiterals_notOk = of(null).pipe(
concatMap(() => importedFunc`bob`),
concatMap(() => localFunc`bob`)
)

[no-unsafe-scope]: Unsafe scopes are forbidden
5 changes: 5 additions & 0 deletions test/v6/fixtures/issues/70/func.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { of } from 'rxjs'

export default function (s: any) {
return of(null)
}
13 changes: 13 additions & 0 deletions test/v6/fixtures/issues/70/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"]
}
17 changes: 17 additions & 0 deletions test/v6/fixtures/issues/70/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"defaultSeverity": "error",
"jsRules": {},
"rules": {
"rxjs-no-unsafe-scope": {
"options": [{
"allowDo": false,
"allowMethods": false,
"allowParameters": true,
"allowProperties": false,
"allowTap": false
}],
"severity": "error"
}
},
"rulesDirectory": "../../../../../build/rules"
}

0 comments on commit 86335ff

Please sign in to comment.