Make the typescript preset require a filename unless the user configured it for general use.
This commit is contained in:
@@ -9,6 +9,16 @@ export default declare((api, options) => {
|
||||
|
||||
return {
|
||||
manipulateOptions(opts, parserOpts) {
|
||||
// If the file has already enabled TS, assume that this is not a
|
||||
// valid Flowtype file.
|
||||
if (
|
||||
parserOpts.plugins.some(
|
||||
p => (Array.isArray(p) ? p[0] : p) === "typescript",
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
parserOpts.plugins.push(["flow", { all }]);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user