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:
@@ -4,7 +4,6 @@
|
||||
import ImageBase from './ImageBase.js';
|
||||
import ImageState from './ImageState.js';
|
||||
|
||||
|
||||
/**
|
||||
* A function that is called to trigger asynchronous canvas drawing. It is
|
||||
* called with a "done" callback that should be called when drawing is done.
|
||||
@@ -14,9 +13,7 @@ import ImageState from './ImageState.js';
|
||||
* @typedef {function(function(Error=): void): void} Loader
|
||||
*/
|
||||
|
||||
|
||||
class ImageCanvas extends ImageBase {
|
||||
|
||||
/**
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
@@ -26,8 +23,8 @@ class ImageCanvas extends ImageBase {
|
||||
* support asynchronous canvas drawing.
|
||||
*/
|
||||
constructor(extent, resolution, pixelRatio, canvas, opt_loader) {
|
||||
|
||||
const state = opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;
|
||||
const state =
|
||||
opt_loader !== undefined ? ImageState.IDLE : ImageState.LOADED;
|
||||
|
||||
super(extent, resolution, pixelRatio, state);
|
||||
|
||||
@@ -49,7 +46,6 @@ class ImageCanvas extends ImageBase {
|
||||
* @type {?Error}
|
||||
*/
|
||||
this.error_ = null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,5 +90,4 @@ class ImageCanvas extends ImageBase {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default ImageCanvas;
|
||||
|
||||
Reference in New Issue
Block a user