Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JamesHenry opened this issue Jan 15, 2019 · 1 comment · Fixed by #85
Closed

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

JamesHenry opened this issue Jan 15, 2019 · 1 comment · Fixed by #85
Assignees
Labels
bug Something isn't working package: parser Issues related to @typescript-eslint/parser

Comments

@JamesHenry
Copy link
Member

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

@bradzacher
Copy link
Member

TODO - migrate PR eslint/typescript-eslint-parser#595

@bradzacher bradzacher added the bug Something isn't working label Jan 18, 2019
@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants