panuhorsmalahti / gulp-tslint

TypeScript linter plugin for Gulp
MIT License
118 stars 44 forks source link

Template strings not properly parsed #13

Closed arnaudpourbaix closed 9 years ago

arnaudpourbaix commented 9 years ago

Template strings (new feature of TS 1.4) don't seem to be properly handled.

Working example:

throw new Error(`ruleSet "${ruleSet.description}" has no defined output tied to type: ${rule.type}`);

Not working example:

throw new Error(`ruleSet "${ruleSet.description}" has no defined output for type: ${rule.type}`);

Output:

(curly) service.ts[89, 93]: for statements must be braced
(no-unused-expression) service.ts[89, 103]: expected an assignment or function call
(no-unused-expression) service.ts[89, 103]: expected an assignment or function call
(no-unused-expression) service.ts[89, 105]: expected an assignment or function call
(no-unreachable) service.ts[89, 93]: unreachable code
(semicolon) service.ts[89, 113]: missing semicolon

In this example, for was interpreted as an instruction instead of a template string. It results in several errors.

panuhorsmalahti commented 9 years ago

Hmm, could you try installing tslint@latest (e.g. 2.1.1), assuming that you might be on 2.1.0. 2.1.1 appears to have a template string related bugfix. I'll try to take a look at this later.

panuhorsmalahti commented 9 years ago

I added a test case for it, but I can't reproduce the issue. You can run it using

cd test
gulp template

I also bumped the tslint version and made a new release of gulp-tslint.

panuhorsmalahti commented 9 years ago

Closing due to inactivity and no other reports.