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:
Tim Schaub
2020-04-06 12:25:12 -06:00
parent 53b48baf62
commit 054af09032
790 changed files with 46833 additions and 33765 deletions

View File

@@ -2,7 +2,6 @@
* @module ol/loadingstrategy
*/
/**
* Strategy function for loading all features with a single request.
* @param {import("./extent.js").Extent} extent Extent.
@@ -14,7 +13,6 @@ export function all(extent, resolution) {
return [[-Infinity, -Infinity, Infinity, Infinity]];
}
/**
* Strategy function for loading features based on the view's extent and
* resolution.
@@ -27,7 +25,6 @@ export function bbox(extent, resolution) {
return [extent];
}
/**
* Creates a strategy function for loading features based on a tile grid.
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid.
@@ -41,15 +38,23 @@ export function tile(tileGrid) {
* @param {number} resolution Resolution.
* @return {Array<import("./extent.js").Extent>} Extents.
*/
function(extent, resolution) {
function (extent, resolution) {
const z = tileGrid.getZForResolution(resolution);
const tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
/** @type {Array<import("./extent.js").Extent>} */
const extents = [];
/** @type {import("./tilecoord.js").TileCoord} */
const tileCoord = [z, 0, 0];
for (tileCoord[1] = tileRange.minX; tileCoord[1] <= tileRange.maxX; ++tileCoord[1]) {
for (tileCoord[2] = tileRange.minY; tileCoord[2] <= tileRange.maxY; ++tileCoord[2]) {
for (
tileCoord[1] = tileRange.minX;
tileCoord[1] <= tileRange.maxX;
++tileCoord[1]
) {
for (
tileCoord[2] = tileRange.minY;
tileCoord[2] <= tileRange.maxY;
++tileCoord[2]
) {
extents.push(tileGrid.getTileCoordExtent(tileCoord));
}
}