From 04304307e37b4d9e9fa02354f05c31a2c58352c0 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Fri, 30 Mar 2018 15:00:00 +0300 Subject: [PATCH] Auto import React, don't import it in GB code When imported directly in GB code, GB's eslint errors out because it finds React as an unused import. So, leaving it out and auto-importing it in the RN project. --- .babelrc | 1 + gutenberg | 2 +- package.json | 1 + yarn.lock | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 2c6d3fd5762374..e4134d073ff2f7 100644 --- a/.babelrc +++ b/.babelrc @@ -3,6 +3,7 @@ "babel-preset-react-native-stage-0/decorator-support" ], "plugins": [ + "react-require", [ "module-resolver", { diff --git a/gutenberg b/gutenberg index a3d5ab4af34941..c96b10bf06c6cd 160000 --- a/gutenberg +++ b/gutenberg @@ -1 +1 @@ -Subproject commit a3d5ab4af34941e5afb12eba3b620dce565a78e6 +Subproject commit c96b10bf06c6cd9099085f3d2e8536fe2743230a diff --git a/package.json b/package.json index b6367b925afd51..6bb2774ca739a8 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "private": true, "devDependencies": { "@wordpress/babel-preset-default": "^1.1.2", + "babel-plugin-react-require": "^3.0.0", "babel-plugin-transform-async-generator-functions": "^6.24.1", "babel-preset-react-native-stage-0": "^1.0.1", "cross-env": "^5.1.4", diff --git a/yarn.lock b/yarn.lock index d2ad7407c77f94..4ee69737124edd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -517,6 +517,10 @@ babel-plugin-module-resolver@^3.1.0: reselect "^3.0.1" resolve "^1.4.0" +babel-plugin-react-require@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-react-require/-/babel-plugin-react-require-3.0.0.tgz#2e4e7b4496b93a654a1c80042276de4e4eeb20e3" + babel-plugin-react-transform@2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/babel-plugin-react-transform/-/babel-plugin-react-transform-2.0.2.tgz#515bbfa996893981142d90b1f9b1635de2995109"