Make the typescript preset require a filename unless the user configured it for general use.
This commit is contained in:
@@ -5,6 +5,16 @@ export default declare(api => {
|
||||
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
// If the Typescript plugin already ran, it will have decided whether
|
||||
// or not this is a TSX file.
|
||||
if (
|
||||
parserOpts.plugins.some(
|
||||
p => (Array.isArray(p) ? p[0] : p) === "typescript",
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
parserOpts.plugins.push("jsx");
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user