Closed bradzacher closed 5 years ago
Looking at the parser code, it just passes the raw parserOptions
object into typescript-estree
, however typescript-estree
has its jsx
option on the root options object, not on ecmaFeatures
.
Workaround is to set jsx: true
on the base parserOptions
object:
const ruleTester = new RuleTester({
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
- ecmaFeatures: {
- jsx: true,
- },
+ jsx: true,
},
parser: "typescript-eslint-parser",
});
This issue has been migrated to the new project here: typescript-eslint/typescript-eslint#24
Thanks!
What version of TypeScript are you using? 3.1.1
What version of
typescript-eslint-parser
are you using? 21.0.2What code were you trying to parse?
What did you expect to happen? The code should parse successfully, so I can test the rule.
What happened?
Parsing error: \'>\' expected.
see astexplorer repl Note the parser has the
jsx
option set to true