diff --git a/.eslintrc b/.eslintrc index 35c4f288..396e53f7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,8 @@ "rules": { "no-mixed-spaces-and-tabs": [2, "smart-tabs"], "indent": [2, "tab", {"VariableDeclarator": 0}], + "curly": 2, + "spaced-comment": 2, "strict": 0, "wrap-iife": 0, "key-spacing": 0 diff --git a/spec/suites/SpecHelper.js b/spec/suites/SpecHelper.js index 4c2c484b..034e6293 100644 --- a/spec/suites/SpecHelper.js +++ b/spec/suites/SpecHelper.js @@ -1,6 +1,5 @@ if (!Array.prototype.map) { - /*eslint no-extend-native:0*/ - Array.prototype.map = function (fun /*, thisp */) { + Array.prototype.map = function (fun) { "use strict"; if (this === undefined || this === null) { diff --git a/spec/suites/core/EventsSpec.js b/spec/suites/core/EventsSpec.js index 819cb214..2c25301f 100644 --- a/spec/suites/core/EventsSpec.js +++ b/spec/suites/core/EventsSpec.js @@ -242,7 +242,7 @@ describe('Events', function () { expect(obj.listens('test')).to.be(false); - //Add and remove a listener + // Add and remove a listener obj.addEventListener('test', spy, foo2); obj.removeEventListener('test', spy, foo2); diff --git a/spec/suites/core/UtilSpec.js b/spec/suites/core/UtilSpec.js index 2554b99b..b4cd2442 100644 --- a/spec/suites/core/UtilSpec.js +++ b/spec/suites/core/UtilSpec.js @@ -230,7 +230,7 @@ describe('Util', function () { describe('#isArray', function () { expect(L.Util.isArray([1, 2, 3])).to.be(true); - /*eslint no-array-constructor:0*/ + /* eslint no-array-constructor: 0 */ expect(L.Util.isArray(new Array(1, 2, 3))).to.be(true); expect(L.Util.isArray('blabla')).to.be(false); expect(L.Util.isArray({0: 1, 1: 2})).to.be(false); diff --git a/spec/suites/geo/ProjectionSpec.js b/spec/suites/geo/ProjectionSpec.js index 5e919fed..354608d3 100644 --- a/spec/suites/geo/ProjectionSpec.js +++ b/spec/suites/geo/ProjectionSpec.js @@ -3,7 +3,7 @@ describe("Projection.Mercator", function () { describe("#project", function () { it("projects a center point", function () { - //edge cases + // edge cases expect(p.project(new L.LatLng(0, 0))).near(new L.Point(0, 0)); }); @@ -51,7 +51,7 @@ describe("Projection.SphericalMercator", function () { describe("#project", function () { it("projects a center point", function () { - //edge cases + // edge cases expect(p.project(new L.LatLng(0, 0))).near(new L.Point(0, 0)); }); diff --git a/spec/suites/geometry/PolyUtilSpec.js b/spec/suites/geometry/PolyUtilSpec.js index 6dcf7839..d4bc3590 100644 --- a/spec/suites/geometry/PolyUtilSpec.js +++ b/spec/suites/geometry/PolyUtilSpec.js @@ -10,7 +10,7 @@ describe('PolyUtil', function () { new L.Point(10, 15) ]; - //check clip without rounding + // check clip without rounding var clipped = L.PolyUtil.clipPolygon(points, bounds); for (var i = 0, len = clipped.length; i < len; i++) { @@ -24,7 +24,7 @@ describe('PolyUtil', function () { new L.Point(10, 10) ]); - //check clip with rounding + // check clip with rounding var clippedRounded = L.PolyUtil.clipPolygon(points, bounds, true); for (i = 0, len = clippedRounded.length; i < len; i++) { diff --git a/src/geo/LatLngBounds.js b/src/geo/LatLngBounds.js index 8b52c843..19b30ebb 100644 --- a/src/geo/LatLngBounds.js +++ b/src/geo/LatLngBounds.js @@ -165,7 +165,7 @@ L.LatLngBounds.prototype = { } }; -//TODO International date line? +// TODO International date line? L.latLngBounds = function (a, b) { // (LatLngBounds) or (LatLng, LatLng) if (!a || a instanceof L.LatLngBounds) { diff --git a/src/geometry/Bounds.js b/src/geometry/Bounds.js index 07bc5312..884c7bf8 100644 --- a/src/geometry/Bounds.js +++ b/src/geometry/Bounds.js @@ -2,7 +2,7 @@ * L.Bounds represents a rectangular area on the screen in pixel coordinates. */ -L.Bounds = function (a, b) { //(Point, Point) or Point[] +L.Bounds = function (a, b) { // (Point, Point) or Point[] if (!a) { return; } var points = b ? [a, b] : a; diff --git a/src/geometry/LineUtil.js b/src/geometry/LineUtil.js index e3abcffa..8c0897c8 100644 --- a/src/geometry/LineUtil.js +++ b/src/geometry/LineUtil.js @@ -155,7 +155,7 @@ L.LineUtil = { return new L.Point(x, y, round); }, - _getBitCode: function (/*Point*/ p, bounds) { + _getBitCode: function (p, bounds) { var code = 0; if (p.x < bounds.min.x) { // left diff --git a/src/map/anim/Map.PanAnimation.js b/src/map/anim/Map.PanAnimation.js index ca3fcd8b..37fc8b7b 100644 --- a/src/map/anim/Map.PanAnimation.js +++ b/src/map/anim/Map.PanAnimation.js @@ -44,7 +44,7 @@ L.Map.include({ if (!offset.x && !offset.y) { return this.fire('moveend'); } - //If we pan too far then chrome gets issues with tiles + // If we pan too far, Chrome gets issues with tiles // and makes them disappear or appear in the wrong place (slightly offset) #2602 if (options.animate !== true && !this.getSize().contains(offset)) { this._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom()); diff --git a/src/map/ext/Map.Geolocation.js b/src/map/ext/Map.Geolocation.js index 02a60420..34834fb2 100644 --- a/src/map/ext/Map.Geolocation.js +++ b/src/map/ext/Map.Geolocation.js @@ -12,7 +12,7 @@ L.Map.include({ // enableHighAccuracy: false }, - locate: function (/*Object*/ options) { + locate: function (options) { options = this._locateOptions = L.extend({}, this._defaultLocateOptions, options);