Skip to content

Commit

Permalink
cleanup babelrc
Browse files Browse the repository at this point in the history
  • Loading branch information
akiran committed Mar 23, 2018
1 parent 0fc4790 commit 2485508
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
20 changes: 3 additions & 17 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
{
"presets": [
[
"es2015",
{
"modules": false
}
],
"react",
"stage-0"
],
"env": {
"start": {
"presets": ["react-hmre"]
},
"test": {
"presets": ["es2015", "react", "stage-0"]
}
}
"env",
"react"
]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"prepublish": "babel ./src --out-dir ./lib --plugins=transform-class-properties,transform-react-jsx --presets=env",
"test": "jest"
"test": "BABEL_ENV=test jest"
},
"repository": {
"type": "git",
Expand All @@ -32,7 +32,7 @@
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^6.1.2",
"babel-jest": "^22.4.1",
"babel-jest": "^22.4.3",
"babel-loader": "^7.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-react-jsx": "^6.24.1",
Expand All @@ -52,6 +52,7 @@
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^16.2.0",
"regenerator-runtime": "^0.11.1",
"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1"
},
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import hljs from 'highlight.js';
import React from 'react';

class Highlight extends React.Component {
constructor(props) {
super(props)
this.setEl = this.setEl.bind(this)
}
componentDidMount() {
this.highlightCode();
}
Expand All @@ -18,7 +22,7 @@ class Highlight extends React.Component {
}
}

setEl = (el) => {
setEl(el) {
this.el = el;
};

Expand Down

0 comments on commit 2485508

Please sign in to comment.