Skip to content

Commit

Permalink
fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
rauchg committed Dec 6, 2016
1 parent 5c614c5 commit d5d823e
Show file tree
Hide file tree
Showing 4 changed files with 1,503 additions and 55 deletions.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -57,6 +58,14 @@
"browser"
],
"rules": {
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-eq-null": 0,
"import/no-unresolved": 0,
"new-cap": 0
}
Expand Down
4 changes: 2 additions & 2 deletions src/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Loading

0 comments on commit d5d823e

Please sign in to comment.