Browse Source

fix everything

add-plugins-support 0.0.5
Guillermo Rauch 8 years ago
parent
commit
d5d823e450
  1. 9
      package.json
  2. 4
      src/babel.js
  3. 3
      test/index.js
  4. 1542
      yarn.lock

9
package.json

@ -16,6 +16,7 @@
"ava": "^0.17.0",
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-polyfill": "^6.16.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-react": "^6.16.0",
@ -57,6 +58,14 @@
"browser"
],
"rules": {
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-eq-null": 0,
"import/no-unresolved": 0,
"new-cap": 0
}

4
src/babel.js

@ -29,7 +29,7 @@ export default function ({types: t}) {
visitor: {
JSXOpeningElement(path, state) {
if (state.hasJSXStyle) {
if (state.ignoreClosing === null) {
if (state.ignoreClosing == null) {
// this flag has a two-fold purpose:
// - ignore the opening tag of the parent element
// of the style tag, since we don't want to add
@ -64,7 +64,7 @@ export default function ({types: t}) {
},
JSXElement: {
enter(path, state) {
if (state.hasJSXStyle === null) {
if (state.hasJSXStyle == null) {
const styles = findStyles(path.node.children)
if (styles.length > 0) {

3
test/index.js

@ -6,13 +6,14 @@ import test from 'ava'
import {transformFile} from 'babel-core'
// Ours
import plugin from '../dist/babel'
import plugin from '../src/babel'
import read from './_read'
const transform = file => (
new Promise((resolve, reject) => {
transformFile(path.resolve(__dirname, file), {
plugins: [
'transform-runtime',
plugin
]
}, (err, data) => {

1542
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save