Skip to content

Commit a8387b9

Browse files
Update babel to v7 (stereobooster#114)
1 parent ead83c2 commit a8387b9

File tree

6 files changed

+9
-19
lines changed

6 files changed

+9
-19
lines changed

.babelrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets": ["env", "react"],
3-
"plugins": ["transform-object-rest-spread", "transform-class-properties"]
2+
"presets": ["@babel/env", "@babel/react"],
3+
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-proposal-object-rest-spread"]
44
}

package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,18 @@
2929
"keywords": [],
3030
"author": "stereobooster <[email protected]>",
3131
"license": "MIT",
32-
"dependencies": {},
3332
"peerDependencies": {
3433
"prop-types": ">=15",
3534
"react": ">=0.14.x",
3635
"react-waypoint": ">=8.0.0"
3736
},
3837
"devDependencies": {
3938
"@types/react": "16.4.13",
40-
"babel-loader": "8.0.2",
41-
"babel-plugin-transform-class-properties": "6.24.1",
42-
"babel-plugin-transform-object-rest-spread": "6.26.0",
43-
"babel-preset-env": "1.7.0",
44-
"babel-preset-react": "6.24.1",
39+
"babel-loader": "7.1.5",
40+
"@babel/plugin-proposal-class-properties": "^7.1.0",
41+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
42+
"@babel/preset-env": "^7.1.0",
43+
"@babel/preset-react": "^7.0.0",
4544
"gh-pages": "1.2.0",
4645
"jest-canvas-mock": "1.1.0",
4746
"kcd-scripts": "0.45.0",

src/__tests__/__snapshots__/IdealImage.js.snap

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`IdealImage Renders a snapshot that is good 1`] = `
44
<div
5-
className={undefined}
65
onClick={[Function]}
76
onKeyPress={[Function]}
87
style={
@@ -12,9 +11,7 @@ exports[`IdealImage Renders a snapshot that is good 1`] = `
1211
}
1312
>
1413
<svg
15-
className={undefined}
1614
height={2095}
17-
style={undefined}
1815
width={3500}
1916
/>
2017
</div>

src/__tests__/__snapshots__/icon.js.snap

-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`Download icon Should render a snapshot that is good 1`] = `
44
<svg
5-
className={undefined}
65
height={24}
76
viewBox="0 0 24 24"
87
width={24}
@@ -21,7 +20,6 @@ exports[`Download icon Should render a snapshot that is good 1`] = `
2120

2221
exports[`Loading icon Should render a snapshot that is good 1`] = `
2322
<svg
24-
className={undefined}
2523
height={24}
2624
viewBox="0 0 24 24"
2725
width={24}
@@ -40,7 +38,6 @@ exports[`Loading icon Should render a snapshot that is good 1`] = `
4038

4139
exports[`Offline icon Should render a snapshot that is good 1`] = `
4240
<svg
43-
className={undefined}
4441
height={24}
4542
viewBox="0 0 24 24"
4643
width={24}
@@ -59,7 +56,6 @@ exports[`Offline icon Should render a snapshot that is good 1`] = `
5956

6057
exports[`Warning icon Should render a snapshot that is good 1`] = `
6158
<svg
62-
className={undefined}
6359
height={24}
6460
viewBox="0 0 24 24"
6561
width={24}

src/__tests__/__snapshots__/idealImageWithDefaults.js.snap

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
exports[`IdealImageWithDefaults Renders a snapshot that is good 1`] = `
44
<div
5-
className={undefined}
65
onClick={[Function]}
76
onKeyPress={[Function]}
87
style={
@@ -15,7 +14,6 @@ exports[`IdealImageWithDefaults Renders a snapshot that is good 1`] = `
1514
}
1615
>
1716
<svg
18-
className={undefined}
1917
height={2095}
2018
style={
2119
Object {

src/components/IdealImage/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ export default class IdealImage extends Component {
310310
srcSet: this.props.srcSet,
311311
maxImageWidth:
312312
this.props.srcSet.length > 1
313-
? guessMaxImageWidth(this.state.dimensions)
313+
? guessMaxImageWidth(this.state.dimensions) // eslint-disable-line react/no-access-state-in-setstate
314314
: 0,
315315
supportsWebp,
316316
})
317317
const {getUrl} = this.props
318318
const url = getUrl ? getUrl(pickedSrc) : pickedSrc.src
319319
const shouldAutoDownload = this.props.shouldAutoDownload({
320-
...this.state,
320+
...this.state, // eslint-disable-line react/no-access-state-in-setstate
321321
size: pickedSrc.size,
322322
})
323323
this.setState({pickedSrc, shouldAutoDownload, url})

0 commit comments

Comments
 (0)