Make code prettier
This updates ESLint and our shared eslint-config-openlayers to use Prettier. Most formatting changes were automatically applied with this:
npm run lint -- --fix
A few manual changes were required:
* In `examples/offscreen-canvas.js`, the `//eslint-disable-line` comment needed to be moved to the appropriate line to disable the error about the `'worker-loader!./offscreen-canvas.worker.js'` import.
* In `examples/webpack/exapmle-builder.js`, spaces could not be added after a couple `function`s for some reason. While editing this, I reworked `ExampleBuilder` to be a class.
* In `src/ol/format/WMSGetFeatureInfo.js`, the `// @ts-ignore` comment needed to be moved down one line so it applied to the `parsersNS` argument.
This commit is contained in:
+18
-13
@@ -7,7 +7,6 @@
|
||||
* by its min/max tile coordinates and is inclusive of coordinates.
|
||||
*/
|
||||
class TileRange {
|
||||
|
||||
/**
|
||||
* @param {number} minX Minimum X.
|
||||
* @param {number} maxX Maximum X.
|
||||
@@ -15,7 +14,6 @@ class TileRange {
|
||||
* @param {number} maxY Maximum Y.
|
||||
*/
|
||||
constructor(minX, maxX, minY, maxY) {
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
@@ -35,7 +33,6 @@ class TileRange {
|
||||
* @type {number}
|
||||
*/
|
||||
this.maxY = maxY;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,8 +48,12 @@ class TileRange {
|
||||
* @return {boolean} Contains.
|
||||
*/
|
||||
containsTileRange(tileRange) {
|
||||
return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX &&
|
||||
this.minY <= tileRange.minY && tileRange.maxY <= this.maxY;
|
||||
return (
|
||||
this.minX <= tileRange.minX &&
|
||||
tileRange.maxX <= this.maxX &&
|
||||
this.minY <= tileRange.minY &&
|
||||
tileRange.maxY <= this.maxY
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,8 +70,12 @@ class TileRange {
|
||||
* @return {boolean} Equals.
|
||||
*/
|
||||
equals(tileRange) {
|
||||
return this.minX == tileRange.minX && this.minY == tileRange.minY &&
|
||||
this.maxX == tileRange.maxX && this.maxY == tileRange.maxY;
|
||||
return (
|
||||
this.minX == tileRange.minX &&
|
||||
this.minY == tileRange.minY &&
|
||||
this.maxX == tileRange.maxX &&
|
||||
this.maxY == tileRange.maxY
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,14 +122,15 @@ class TileRange {
|
||||
* @return {boolean} Intersects.
|
||||
*/
|
||||
intersects(tileRange) {
|
||||
return this.minX <= tileRange.maxX &&
|
||||
this.maxX >= tileRange.minX &&
|
||||
this.minY <= tileRange.maxY &&
|
||||
this.maxY >= tileRange.minY;
|
||||
return (
|
||||
this.minX <= tileRange.maxX &&
|
||||
this.maxX >= tileRange.minX &&
|
||||
this.minY <= tileRange.maxY &&
|
||||
this.maxY >= tileRange.minY
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {number} minX Minimum X.
|
||||
* @param {number} maxX Maximum X.
|
||||
@@ -145,5 +151,4 @@ export function createOrUpdate(minX, maxX, minY, maxY, tileRange) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default TileRange;
|
||||
|
||||
Reference in New Issue
Block a user