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:
@@ -1,12 +1,11 @@
|
||||
/**
|
||||
* @module ol/Tile
|
||||
*/
|
||||
import TileState from './TileState.js';
|
||||
import {easeIn} from './easing.js';
|
||||
import EventTarget from './events/Target.js';
|
||||
import EventType from './events/EventType.js';
|
||||
import TileState from './TileState.js';
|
||||
import {abstract} from './util.js';
|
||||
|
||||
import {easeIn} from './easing.js';
|
||||
|
||||
/**
|
||||
* A function that takes an {@link module:ol/Tile} for the tile and a
|
||||
@@ -60,7 +59,6 @@ import {abstract} from './util.js';
|
||||
* @api
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {number} [transition=250] A duration for tile opacity
|
||||
@@ -68,7 +66,6 @@ import {abstract} from './util.js';
|
||||
* @api
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* Base class for tiles.
|
||||
@@ -76,7 +73,6 @@ import {abstract} from './util.js';
|
||||
* @abstract
|
||||
*/
|
||||
class Tile extends EventTarget {
|
||||
|
||||
/**
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {TileState} state State.
|
||||
@@ -126,7 +122,8 @@ class Tile extends EventTarget {
|
||||
* The duration for the opacity transition.
|
||||
* @type {number}
|
||||
*/
|
||||
this.transition_ = options.transition === undefined ? 250 : options.transition;
|
||||
this.transition_ =
|
||||
options.transition === undefined ? 250 : options.transition;
|
||||
|
||||
/**
|
||||
* Lookup of start times for rendering transitions. If the start time is
|
||||
@@ -134,7 +131,6 @@ class Tile extends EventTarget {
|
||||
* @type {Object<string, number>}
|
||||
*/
|
||||
this.transitionStarts_ = {};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,8 +143,7 @@ class Tile extends EventTarget {
|
||||
/**
|
||||
* Called by the tile cache when the tile is removed from the cache due to expiry
|
||||
*/
|
||||
release() {
|
||||
}
|
||||
release() {}
|
||||
|
||||
/**
|
||||
* @return {string} Key.
|
||||
@@ -284,7 +279,7 @@ class Tile extends EventTarget {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const delta = time - start + (1000 / 60); // avoid rendering at 0
|
||||
const delta = time - start + 1000 / 60; // avoid rendering at 0
|
||||
if (delta >= this.transition_) {
|
||||
return 1;
|
||||
}
|
||||
@@ -316,5 +311,4 @@ class Tile extends EventTarget {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Tile;
|
||||
|
||||
Reference in New Issue
Block a user