Skip to content

Commit b13c8c3

Browse files
committed
List eslint as an explicit devDependency, upgrade the related packages, fix linting errors, drop unused jest and enzyme deps
1 parent 9f1fd31 commit b13c8c3

File tree

5 files changed

+104
-131
lines changed

5 files changed

+104
-131
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/**
2+
lib/**

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"block-scoped-var": 0,
4848
// Temporarily disabled for test/* until babel/babel-eslint#33 is resolved
4949
"padded-blocks": 0,
50-
50+
"no-param-reassign": 0
5151
},
5252
"plugins": [
5353
"react",

example/index.js

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { render } from 'react-dom';
3-
import { Map, Marker, Popup, TileLayer } from 'react-leaflet';
3+
import { Map, TileLayer } from 'react-leaflet';
44
import HeatmapLayer from '../src/HeatmapLayer';
55
import { addressPoints } from './realworld.10000.js';
66

@@ -9,7 +9,7 @@ class MapExample extends React.Component {
99
state = {
1010
mapHidden: false,
1111
layerHidden: false,
12-
addressPoints: addressPoints
12+
addressPoints
1313
};
1414

1515
componentDidMount() {
@@ -25,38 +25,46 @@ class MapExample extends React.Component {
2525
<input
2626
type="button"
2727
value="Toggle Map"
28-
onClick={() => this.setState({ mapHidden: !this.state.mapHidden })} />
28+
onClick={() => this.setState({ mapHidden: !this.state.mapHidden })}
29+
/>
2930
</div>
3031
);
3132
}
32-
const gradient = { '0.1': '#89BDE0', '0.2': '#96E3E6', '0.4': '#82CEB6', '0.6': '#FAF3A5', '0.8': '#F5D98B', '1.0': '#DE9A96'};
33+
34+
const gradient = {
35+
0.1: '#89BDE0', 0.2: '#96E3E6', 0.4: '#82CEB6',
36+
0.6: '#FAF3A5', 0.8: '#F5D98B', '1.0': '#DE9A96'
37+
};
3338

3439
return (
3540
<div>
36-
<Map center={[0,0]} zoom={13}>
41+
<Map center={[0, 0]} zoom={13}>
3742
{!this.state.layerHidden &&
3843
<HeatmapLayer
39-
fitBoundsOnLoad
40-
fitBoundsOnUpdate
41-
points={this.state.addressPoints}
42-
longitudeExtractor={m => m[1]}
43-
latitudeExtractor={m => m[0]}
44-
gradient={gradient}
45-
intensityExtractor={m => parseFloat(m[2])} />
44+
fitBoundsOnLoad
45+
fitBoundsOnUpdate
46+
points={this.state.addressPoints}
47+
longitudeExtractor={m => m[1]}
48+
latitudeExtractor={m => m[0]}
49+
gradient={gradient}
50+
intensityExtractor={m => parseFloat(m[2])}
51+
/>
4652
}
4753
<TileLayer
48-
url='http://{s}.tile.osm.org/{z}/{x}/{y}.png'
54+
url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"
4955
attribution='&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
5056
/>
5157
</Map>
5258
<input
5359
type="button"
5460
value="Toggle Map"
55-
onClick={() => this.setState({ mapHidden: !this.state.mapHidden })} />
61+
onClick={() => this.setState({ mapHidden: !this.state.mapHidden })}
62+
/>
5663
<input
5764
type="button"
5865
value="Toggle Layer"
59-
onClick={() => this.setState({ layerHidden: !this.state.layerHidden })} />
66+
onClick={() => this.setState({ layerHidden: !this.state.layerHidden })}
67+
/>
6068
</div>
6169
);
6270
}

package.json

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"compile": "npm run clean; npm run transpile",
88
"transpile": "./node_modules/.bin/babel src/HeatmapLayer.js --out-file lib/HeatmapLayer.js",
99
"clean": "rm -rf ./lib/*",
10-
"example": "webpack-dev-server --config ./example/webpack.config.js"
10+
"example": "webpack-dev-server --config ./example/webpack.config.js",
11+
"lint": "eslint ./src ./example/index.js"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -36,8 +37,7 @@
3637
"devDependencies": {
3738
"babel-cli": "^6.6.5",
3839
"babel-core": "^6.7.4",
39-
"babel-eslint": "^5.0.0",
40-
"babel-jest": "^9.0.3",
40+
"babel-eslint": "^7.1.1",
4141
"babel-loader": "^6.2.4",
4242
"babel-plugin-object-assign": "^1.2.1",
4343
"babel-plugin-react-transform": "^2.0.0",
@@ -46,43 +46,19 @@
4646
"babel-preset-es2015": "^6.3.13",
4747
"babel-preset-react": "^6.3.13",
4848
"babel-preset-stage-0": "^6.3.13",
49-
"enzyme": "^2.2.0",
49+
"eslint": "^3.15.0",
5050
"eslint-config-airbnb": "^6.2.0",
5151
"eslint-plugin-arrow-function": "^2.0.0",
52+
"eslint-plugin-lean-imports": "^0.3.3",
5253
"eslint-plugin-react": "^4.2.3",
53-
"jest-cli": "^0.9.2",
5454
"leaflet": "^0.7.7",
5555
"react": "^0.14.7",
5656
"react-addons-test-utils": "^0.14.7",
5757
"react-dom": "^0.14.7",
5858
"react-leaflet": "^0.10.2",
5959
"react-transform-hmr": "^1.0.4",
60-
"webpack-dev-server": "^1.14.1",
61-
"webpack": "^1.12.14"
62-
},
63-
"jest": {
64-
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest/src/index.js",
65-
"unmockedModulePathPatterns": [
66-
"react",
67-
"enzyme",
68-
"react-dom",
69-
"react-addons-test-utils",
70-
"fbjs",
71-
"cheerio",
72-
"htmlparser2",
73-
"underscore",
74-
"lodash",
75-
"domhandler",
76-
"object.assign",
77-
"define-properties",
78-
"function-bind",
79-
"object-keys"
80-
],
81-
"moduleFileExtensions": [
82-
"js",
83-
"json",
84-
"jsx"
85-
]
60+
"webpack": "^1.12.14",
61+
"webpack-dev-server": "^1.14.1"
8662
},
8763
"dependencies": {
8864
"lodash.filter": "^4.3.0",
@@ -93,6 +69,6 @@
9369
"lodash.min": "^4.0.0",
9470
"lodash.pluck": "^3.1.2",
9571
"lodash.reduce": "^4.3.0",
96-
"simpleheat": "*"
72+
"simpleheat": "^0.4.0"
9773
}
9874
}

0 commit comments

Comments
 (0)