babel-plugin-react-require
Advanced tools
Comparing version 2.1.0 to 3.0.0
@@ -18,2 +18,3 @@ 'use strict'; | ||
Program: { | ||
@@ -20,0 +21,0 @@ enter: function (path, _ref3) { |
{ | ||
"name": "babel-plugin-react-require", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"description": "Babel plugin that adds React import declaration if file contains JSX tags.", | ||
@@ -22,5 +22,3 @@ "keywords": [ | ||
}, | ||
"contributors": [], | ||
"main": "lib", | ||
"bin": {}, | ||
"repository": { | ||
@@ -39,33 +37,24 @@ "type": "git", | ||
}, | ||
"config": {}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"babel-cli": "^6.2.0", | ||
"babel-core": "^6.3.2", | ||
"babel-eslint": "^5.0.0-beta4", | ||
"babel-plugin-syntax-jsx": "^6.1.18", | ||
"babel-plugin-transform-es2015-block-scoping": "^6.1.18", | ||
"babel-plugin-transform-es2015-classes": "^6.3.2", | ||
"babel-plugin-transform-es2015-destructuring": "^6.1.18", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.2.0", | ||
"babel-plugin-transform-es2015-parameters": "^6.1.18", | ||
"babel-plugin-transform-es2015-shorthand-properties": "^6.1.18", | ||
"chai": "^3.4.1", | ||
"eslint": "^1.10.3", | ||
"eslint-config-airbnb": "^2.0.0", | ||
"eslint-plugin-react": "^3.11.2", | ||
"istanbul": "^0.4.1", | ||
"mocha": "^2.3.4", | ||
"mocha-istanbul": "^0.2.0", | ||
"rimraf": "^2.4.4" | ||
}, | ||
"peerDependencies": {}, | ||
"bundledDependencies": [], | ||
"optionalDependencies": {}, | ||
"engines": {}, | ||
"os": [], | ||
"cpu": [], | ||
"preferGlobal": false, | ||
"private": false, | ||
"publishConfig": {} | ||
"babel-cli": "^6.16.0", | ||
"babel-core": "^6.17.0", | ||
"babel-eslint": "^7.0.0", | ||
"babel-plugin-syntax-jsx": "^6.13.0", | ||
"babel-plugin-transform-es2015-block-scoping": "^6.15.0", | ||
"babel-plugin-transform-es2015-classes": "^6.14.0", | ||
"babel-plugin-transform-es2015-destructuring": "^6.16.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.16.0", | ||
"babel-plugin-transform-es2015-parameters": "^6.17.0", | ||
"babel-plugin-transform-es2015-shorthand-properties": "^6.8.0", | ||
"chai": "^3.5.0", | ||
"eslint": "^3.7.1", | ||
"eslint-config-airbnb": "^12.0.0", | ||
"eslint-plugin-import": "^1.16.0", | ||
"eslint-plugin-jsx-a11y": "^2.2.3", | ||
"eslint-plugin-react": "^6.4.1", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.1.2", | ||
"mocha-istanbul": "^0.3.0", | ||
"rimraf": "^2.5.4" | ||
} | ||
} |
@@ -35,3 +35,3 @@ # babel-plugin-react-require | ||
* Install babel-plugin-react-require | ||
* Install `babel-plugin-react-require`. | ||
@@ -42,3 +42,3 @@ ``` | ||
* Add react-require into `.babelrc` | ||
* Add `react-require` into `.babelrc`. This plugin should be defined before `transform-es2015-modules-commonjs` plugin because it's using ES2015 modules syntax to import `React` into scope. | ||
@@ -45,0 +45,0 @@ ```json |
@@ -1,5 +0,4 @@ | ||
'use strict'; | ||
const babel = require('babel-core'); | ||
const assert = require('assert'); | ||
let reactPlugin; | ||
@@ -9,3 +8,3 @@ let transform; | ||
try { | ||
reactPlugin = require('../lib-cov/index').default; | ||
reactPlugin = require('../lib-cov/index').default; // eslint-disable-line import/no-unresolved | ||
} catch (error) { | ||
@@ -17,7 +16,5 @@ reactPlugin = require('../src/index').default; | ||
beforeEach(() => { | ||
transform = (code) => { | ||
return babel.transform(code, { | ||
plugins: ['syntax-jsx', reactPlugin], | ||
}).code; | ||
}; | ||
transform = code => babel.transform(code, { | ||
plugins: ['syntax-jsx', reactPlugin], | ||
}).code; | ||
}); | ||
@@ -24,0 +21,0 @@ |
Sorry, the diff of this file is not supported yet
8540
20
126