Enable allowNamespaces in transform-typescript by default (#12765)
This commit is contained in:
parent
16e9f1c8e5
commit
a93bbce867
@ -51,9 +51,9 @@ export default declare((api, opts) => {
|
||||
const JSX_PRAGMA_REGEX = /\*?\s*@jsx((?:Frag)?)\s+([^\s]+)/;
|
||||
|
||||
const {
|
||||
allowNamespaces = true,
|
||||
jsxPragma = "React.createElement",
|
||||
jsxPragmaFrag = "React.Fragment",
|
||||
allowNamespaces = false,
|
||||
onlyRemoveTypeImports = false,
|
||||
} = opts;
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import { OptionValidator } from "@babel/helper-validator-option";
|
||||
const v = new OptionValidator("@babel/preset-typescript");
|
||||
|
||||
export default function normalizeOptions(options = {}) {
|
||||
let { allowNamespaces, jsxPragma, onlyRemoveTypeImports } = options;
|
||||
let { allowNamespaces = true, jsxPragma, onlyRemoveTypeImports } = options;
|
||||
|
||||
if (process.env.BABEL_8_BREAKING) {
|
||||
const TopLevelOptions = {
|
||||
|
||||
@ -78,7 +78,7 @@ describe("normalize options", () => {
|
||||
expect(normalizeOptions({})).toMatchInlineSnapshot(`
|
||||
Object {
|
||||
"allExtensions": false,
|
||||
"allowNamespaces": undefined,
|
||||
"allowNamespaces": true,
|
||||
"isTSX": false,
|
||||
"jsxPragma": undefined,
|
||||
"jsxPragmaFrag": "React.Fragment",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user