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:
@@ -2,14 +2,13 @@
|
||||
* @module ol/style/IconImage
|
||||
*/
|
||||
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import EventTarget from '../events/Target.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import ImageState from '../ImageState.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import {shared as iconImageCache} from './IconImageCache.js';
|
||||
import {listenImage} from '../Image.js';
|
||||
|
||||
|
||||
class IconImage extends EventTarget {
|
||||
/**
|
||||
* @param {HTMLImageElement|HTMLCanvasElement} image Image.
|
||||
@@ -20,7 +19,6 @@ class IconImage extends EventTarget {
|
||||
* @param {import("../color.js").Color} color Color.
|
||||
*/
|
||||
constructor(image, src, size, crossOrigin, imageState, color) {
|
||||
|
||||
super();
|
||||
|
||||
/**
|
||||
@@ -80,7 +78,6 @@ class IconImage extends EventTarget {
|
||||
* @type {boolean|undefined}
|
||||
*/
|
||||
this.tainted_;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,7 +233,12 @@ class IconImage extends EventTarget {
|
||||
return;
|
||||
}
|
||||
|
||||
const imgData = ctx.getImageData(0, 0, this.image_.width, this.image_.height);
|
||||
const imgData = ctx.getImageData(
|
||||
0,
|
||||
0,
|
||||
this.image_.width,
|
||||
this.image_.height
|
||||
);
|
||||
const data = imgData.data;
|
||||
const r = this.color_[0] / 255.0;
|
||||
const g = this.color_[1] / 255.0;
|
||||
@@ -263,7 +265,6 @@ class IconImage extends EventTarget {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {HTMLImageElement|HTMLCanvasElement} image Image.
|
||||
* @param {string} src Src.
|
||||
@@ -282,5 +283,4 @@ export function get(image, src, size, crossOrigin, imageState, color) {
|
||||
return iconImage;
|
||||
}
|
||||
|
||||
|
||||
export default IconImage;
|
||||
|
||||
Reference in New Issue
Block a user