Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Typescript finds comment inside of template string #216

Closed
@bradzacher

Description

@bradzacher

What version of TypeScript are you using?
2.2.1

What version of typescript-eslint-parser are you using?
2.1.0

What code were you trying to parse?

const str = `${__dirname}/test/*.js`;

module.exports = str;

What happened?

Cannot read property 'loc' of null
TypeError: Cannot read property 'loc' of null
    at getNodeIndent (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/rules/indent.js:328:71)
    at checkNodeIndent (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/rules/indent.js:363:34)
    at nodes.forEach.node (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/rules/indent.js:411:35)
    at Array.forEach (native)
    at checkNodesIndent (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/rules/indent.js:411:19)
    at EventEmitter.Program (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/rules/indent.js:975:21)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:191:7)
    at NodeEventGenerator.applySelector (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/Users/bradzacher/.config/yarn/global/node_modules/eslint/lib/util/node-event-generator.js:294:22)

note that these files seem to work fine, which leads me to believe it's a problem with the asterisk in the template string.

const str = `${__dirname}`;

module.exports = str;
const str = `${__dirname}/asdf.js`;

module.exports = str;

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions