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

Fix: support ecmaFeatures.jsx flag #595

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ exports.parseForESLint = function parseForESLint(code, options) {
options = Object.assign({}, options, { jsx: tsx });
}
}
if (typeof options.jsx !== "boolean" &&
options.ecmaFeatures &&
typeof options.ecmaFeatures.jsx === "boolean") {
// allow the user to override the jsx setting
options.jsx = options.ecmaFeatures.jsx;
}

const ast = parse(code, options);
const extraOptions = {
Expand Down