You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
import*astsfrom"typescript";import*asLintfrom"tslint/lib/lint";exportclassRuleextendsLint.Rules.TypedRule{publicstaticFAILURE_STRING="setTimeout forbidden with string as param1.";publicapplyWithProgram(sourceFile: ts.SourceFile,program: ts.Program): Lint.RuleFailure[]{returnthis.applyWithWalker(newNoSetTimeoutWithStringWalker(sourceFile,this.getOptions(),program));}}// The walker takes care of all the work.classNoSetTimeoutWithStringWalkerextendsLint.ProgramAwareRuleWalker{publicvisitCallExpression(node: ts.CallExpression){// irrelevant implementation}}
Actual behavior
Error: SetTimeoutString requires type checking
at Rule.TypedRule.apply (C:\dev\seccheck\node_modules\tslint\lib\language\rule\typedRule.js:14:15)
at Linter.lint (C:\Users\trgau\AppData\Roaming\npm\node_modules\tslint\lib\tslint.js:68:37)
at processFile (C:\Users\trgau\AppData\Roaming\npm\node_modules\tslint\lib\tslint-cli.js:138:29)
at C:\Users\trgau\AppData\Roaming\npm\node_modules\tslint\lib\tslint-cli.js:177:74
at Array.forEach (native)
at Object.<anonymous> (C:\Users\trgau\AppData\Roaming\npm\node_modules\tslint\lib\tslint-cli.js:177:41)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
Expected behavior
No errors. I tried using built-in rules that require type checking, and they seem to work fine. In tslint.js, the following if-condition is failing:
Hey @jkillian, haven't looked at it anymore. I am starting on a new project that will involve custom TSLint rules that use the type checker, so I will let you know if I run into a similar problem.
bcherny
added a commit
to bcherny/tslint
that referenced
this issue
Nov 16, 2016
New to TSLint so let me know if I'm doing something wrong...
Bug Report
3.15.1
2.0.0
with
tslint.json
configuration:SetTimeoutStringRule.ts:
Actual behavior
Expected behavior
No errors. I tried using built-in rules that require type checking, and they seem to work fine. In tslint.js, the following if-condition is failing:
Specifically
rule instanceof typedRule_1.TypedRule
.The text was updated successfully, but these errors were encountered: