Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

parserOptions.ecmaFeatures.jsx option not passed to estree  #24

Copy link
Copy link
Closed
@JamesHenry

Description

@JamesHenry
Issue body actions

This issue was initially reported here: eslint/typescript-eslint-parser#594


What version of TypeScript are you using?
3.1.1

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

What code were you trying to parse?

const RuleTester = require("eslint").RuleTester;

const ruleTester = new RuleTester({
    parserOptions: {
        ecmaVersion: 6,
        sourceType: "module",
        ecmaFeatures: {
            jsx: true,
        },
    },
    parser: "typescript-eslint-parser",
});

ruleTester.run("no-unused-vars", rule, {
    valid: [
		`
const Foo = function () {}
function render() {
    return (<Foo />);
}
		`,
	],
	invalid: [],
})

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingSomething isn't workingpackage: parserIssues related to @typescript-eslint/parserIssues related to @typescript-eslint/parser

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.