Skip to content

Commit

Permalink
Address some eslint warnings and disable 'no-undef'; this is safe acc…
Browse files Browse the repository at this point in the history
…ording to https://eslint.org/docs/latest/rules/no-undef as TypeScript's compiler enforces it.
  • Loading branch information
erictheise committed Jan 2, 2024
1 parent 33ec955 commit 7a1906b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"rules": {
"arrow-body-style": ["warn", "as-needed"],
"no-empty": "off",
"no-undef": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/prefer-for-of": "warn",
"no-var": "warn",
Expand Down
15 changes: 7 additions & 8 deletions js/locationfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
* Version: 0.1
*/
L.LatLngBounds.prototype.modify = function (map, amount) {
let sw = this.getSouthWest(),
ne = this.getNorthEast(),
swPoint = map.latLngToLayerPoint(sw),
const swPoint = map.latLngToLayerPoint(sw),
nePoint = map.latLngToLayerPoint(ne);

let sw = this.getSouthWest(),
ne = this.getNorthEast();
sw = map.layerPointToLatLng(
new L.Point(swPoint.x - amount, swPoint.y + amount)
);
Expand Down Expand Up @@ -108,7 +107,7 @@ L.LocationFilter = L.Control.extend({
anchor: [-10, -10],
size: [13, 13]
});
this._moveMarker.on("drag", function (e) {
this._moveMarker.on("drag", (e) => {

Check warning on line 110 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
const markerPos = that._moveMarker.getLatLng(),
latDelta = markerPos.lat - that._nw.lat,
lngDelta = markerPos.lng - that._nw.lng;
Expand Down Expand Up @@ -152,7 +151,7 @@ L.LocationFilter = L.Control.extend({
marker. Update filter corners and redraw the filter */
_setupResizeMarkerTracking: function (marker, options) {
const that = this;

Check failure on line 153 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

Unexpected aliasing of 'this' to local variable
marker.on("drag", function (e) {
marker.on("drag", (e) => {

Check warning on line 154 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
const curPosition = marker.getLatLng(),
latMarker = options.moveAlong.lat,
lngMarker = options.moveAlong.lng;
Expand All @@ -170,7 +169,7 @@ L.LocationFilter = L.Control.extend({
that._swMarker.getLatLng(),
that._seMarker.getLatLng()
];
corners.sort(function (a, b) {
corners.sort((a, b) => {
if (a.lat != b.lat) return b.lat - a.lat;
else return a.lng - b.lng;
});
Expand All @@ -188,7 +187,7 @@ L.LocationFilter = L.Control.extend({
given marker */
_setupDragendListener: function (marker) {
const that = this;

Check failure on line 189 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

Unexpected aliasing of 'this' to local variable

Check warning on line 189 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

'that' is assigned a value but never used
marker.on("dragend", function (e) {
marker.on("dragend", (e) => {

Check warning on line 190 in js/locationfilter.js

View workflow job for this annotation

GitHub Actions / build

'e' is defined but never used
// that.fire("change", {bounds: that.getBounds()});
});
},
Expand Down

0 comments on commit 7a1906b

Please sign in to comment.