Skip to content

Commit

Permalink
fix NodeJS undefined (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
huan committed Feb 2, 2021
1 parent 332f764 commit 7c409c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/eslint-plugin-tslint": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
"@typescript-eslint/parser": "^3.10.1",
"@wwwouter/tslint-contrib": "^1.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^7.19.0",
Expand Down
5 changes: 5 additions & 0 deletions tests/detect-patterns.spec.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ test('Should pass linting for good-patterns/**/*.ts', async t => {
t.pass(`${baseName}: good pattern source codes is good`)
} else {
t.fail(`${baseName}: good pattern source codes mis-detected as bad`)
report.results.forEach(result => {
result.messages.forEach(message => {
console.error('Error:', message.ruleId, message.message)
})
})
}
}
})
8 changes: 8 additions & 0 deletions tests/fixtures/good-patterns/env-node.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* https://stackoverflow.com/q/64089216/1123955
*/
const timer: NodeJS.Timeout = setTimeout(
() => { console.info('timeout') },
100,
)
clearTimeout(timer)

0 comments on commit 7c409c0

Please sign in to comment.