未验证 提交 9959d7ef 编写于 作者: B Bogdan Chadkin 提交者: GitHub

Use babel 7 jsx syntax (#17043)

For some reason babel-plugin-syntax-jsx of babel 6 was used instead of
babel 7 version.
上级 0f41062d
import { NodePath, PluginObj, types as BabelTypes } from '@babel/core'
import jsx from '@babel/plugin-syntax-jsx'
export default function ({
types: t,
......@@ -6,7 +7,7 @@ export default function ({
types: typeof BabelTypes
}): PluginObj<any> {
return {
inherits: require('babel-plugin-syntax-jsx'),
inherits: jsx,
visitor: {
JSXElement(_path, state) {
state.set('jsx', true)
......
......@@ -67,6 +67,7 @@
"@babel/plugin-proposal-object-rest-spread": "7.11.0",
"@babel/plugin-syntax-bigint": "7.8.3",
"@babel/plugin-syntax-dynamic-import": "7.8.3",
"@babel/plugin-syntax-jsx": "7.10.4",
"@babel/plugin-transform-modules-commonjs": "7.10.4",
"@babel/plugin-transform-runtime": "7.11.5",
"@babel/preset-env": "7.11.5",
......@@ -78,7 +79,6 @@
"@next/react-dev-overlay": "9.5.4-canary.14",
"@next/react-refresh-utils": "9.5.4-canary.14",
"ast-types": "0.13.2",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-define": "2.0.0",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"browserslist": "4.13.0",
......
/* eslint-disable import/no-extraneous-dependencies */
declare module '@babel/plugin-transform-modules-commonjs'
declare module '@babel/plugin-syntax-jsx'
declare module 'browserslist'
declare module 'cssnano-simple' {
import { Plugin } from 'postcss'
......
......@@ -766,19 +766,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.0"
"@babel/plugin-syntax-jsx@^7.10.4":
"@babel/plugin-syntax-jsx@7.10.4", "@babel/plugin-syntax-jsx@^7.10.4", "@babel/plugin-syntax-jsx@^7.2.0":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.10.4.tgz#39abaae3cbf710c4373d8429484e6ba21340166c"
integrity sha512-KCg9mio9jwiARCB7WAcQ7Y1q+qicILjoK8LP/VkPkEKaf5dkaZZK1EcTe91a3JJlZ3qy6L5s9X52boEYi8DM9g==
dependencies:
"@babel/helper-plugin-utils" "^7.10.4"
"@babel/plugin-syntax-jsx@^7.2.0":
version "7.7.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.7.4.tgz#dab2b56a36fb6c3c222a1fbc71f7bf97f327a9ec"
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-logical-assignment-operators@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册