Skip to content

Commit 2485508

Browse files
committedMar 23, 2018
cleanup babelrc
1 parent 0fc4790 commit 2485508

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed
 

‎.babelrc

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
{
22
"presets": [
3-
[
4-
"es2015",
5-
{
6-
"modules": false
7-
}
8-
],
9-
"react",
10-
"stage-0"
11-
],
12-
"env": {
13-
"start": {
14-
"presets": ["react-hmre"]
15-
},
16-
"test": {
17-
"presets": ["es2015", "react", "stage-0"]
18-
}
19-
}
3+
"env",
4+
"react"
5+
]
206
}

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"prepublish": "babel ./src --out-dir ./lib --plugins=transform-class-properties,transform-react-jsx --presets=env",
8-
"test": "jest"
8+
"test": "BABEL_ENV=test jest"
99
},
1010
"repository": {
1111
"type": "git",
@@ -32,7 +32,7 @@
3232
"babel-cli": "^6.26.0",
3333
"babel-core": "^6.26.0",
3434
"babel-eslint": "^6.1.2",
35-
"babel-jest": "^22.4.1",
35+
"babel-jest": "^22.4.3",
3636
"babel-loader": "^7.1.2",
3737
"babel-plugin-transform-class-properties": "^6.24.1",
3838
"babel-plugin-transform-react-jsx": "^6.24.1",
@@ -52,6 +52,7 @@
5252
"react": "^15.5.4",
5353
"react-dom": "^15.5.4",
5454
"react-test-renderer": "^16.2.0",
55+
"regenerator-runtime": "^0.11.1",
5556
"webpack": "^3.6.0",
5657
"webpack-dev-server": "^2.9.1"
5758
},

‎src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import hljs from 'highlight.js';
22
import React from 'react';
33

44
class Highlight extends React.Component {
5+
constructor(props) {
6+
super(props)
7+
this.setEl = this.setEl.bind(this)
8+
}
59
componentDidMount() {
610
this.highlightCode();
711
}
@@ -18,7 +22,7 @@ class Highlight extends React.Component {
1822
}
1923
}
2024

21-
setEl = (el) => {
25+
setEl(el) {
2226
this.el = el;
2327
};
2428

0 commit comments

Comments
 (0)
Please sign in to comment.