Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
JSHint in Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw committed Nov 20, 2013
1 parent 85ef122 commit 2e3e243
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"globals": {
"L": false,
"require": false,
"module": false,
"console": false,
"document": false,
"window": false
},
"globalstrict": true,
"loopfunc": true
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"leaflet-hash": "0.2.1"
},
"scripts": {
"test": "mocha-phantomjs test/index.html"
"test": "jshint src/*.js && mocha-phantomjs test/index.html"
},
"devDependencies": {
"leaflet-hash": "git://github.com/mlevans/leaflet-hash.git#b039a3aa4e2492a5c7448075172ac26769e601d6",
Expand All @@ -29,7 +29,8 @@
"sinon": "1.7.3",
"mocha-phantomjs": "3.1.6",
"happen": "0.1.3",
"browserify": "2.35.4"
"browserify": "2.35.4",
"jshint": "~2.3.0"
},
"optionalDependencies": {},
"engines": {
Expand Down
1 change: 1 addition & 0 deletions src/geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var util = require('./util'),
// Low-level geocoding interface - wraps specific API calls and their
// return values.
module.exports = function(_) {

var geocoder = {}, url;

geocoder.getURL = function(_) {
Expand Down
3 changes: 1 addition & 2 deletions src/legend_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ var LegendControl = L.Control.extend({

for (var i in this._legends) {
if (this._legends.hasOwnProperty(i) && this._legends[i]) {
var div = this._container.appendChild(document.createElement('div'));
div.className = 'map-legend wax-legend';
var div = L.DomUtil.create('div', 'map-legend wax-legend', this._container);
div.innerHTML = this.options.sanitizer(i);
hide = 'block';
}
Expand Down
4 changes: 2 additions & 2 deletions src/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var util = require('./util'),
gridControl = require('./grid_control'),
legendControl = require('./legend_control');

var Map = L.Map.extend({
var LMap = L.Map.extend({
includes: [require('./load_tilejson')],

options: {
Expand Down Expand Up @@ -116,5 +116,5 @@ var Map = L.Map.extend({
});

module.exports = function(element, _, options) {
return new Map(element, _, options);
return new LMap(element, _, options);
};

0 comments on commit 2e3e243

Please sign in to comment.