Skip to content

Commit

Permalink
jshinting
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Nov 11, 2013
1 parent 374ad40 commit d892a9b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
examples/**/node_modules/*
47 changes: 47 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{

// environment
"browser": true,
"node": true,
"strict": true,

"globals": {
"define": true,
"L": true,
"chai": true,
"it": true,
"describe": true,
"beforeEach": true,
"afterEech": true
},

// code style
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"forin": false,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"undef": true,
"unused": true,
"quotmark": "single",
"expr": true,

// whitespace
"indent": 4,
"trailing": true,
"white": true,
"smarttabs": true,
"maxlen": 120

// code simplicity - not enforced but nice to check from time to time
// "maxstatements": 20,
// "maxcomplexity": 5
// "maxparams": 4,
// "maxdepth": 4
}
4 changes: 2 additions & 2 deletions examples/leaflet-image/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ L.geoJson(gj).addTo(map);


console.log('Save to image using leaflet-image...');
leafletImage(map, function(err, canvas) {
leafletImage(map, function (err, canvas) {
var out = fs.createWriteStream(__dirname + '/test.png');
var stream = canvas.pngStream();

stream.on('data', function(chunk){
stream.on('data', function (chunk) {
out.write(chunk);
});

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

'use strict';

var jsdom = require('jsdom').jsdom
var jsdom = require('jsdom').jsdom;

// make some globals to fake browser behaviour.
GLOBAL.document = jsdom('<html><head></head><body></body></html>');
Expand Down
7 changes: 3 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var L = require('../index.js');
var chai = require('chai').should();


describe('Leaflet-headless', function () {

describe('basic functions', function () {
Expand Down Expand Up @@ -37,12 +36,12 @@ describe('Leaflet-headless', function () {
map.setView([52, 4], 10);

L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'
}).addTo(map);
})
});

it('has some working imagePath');

});

});

0 comments on commit d892a9b

Please sign in to comment.