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,13 +2,12 @@
|
||||
* @module ol/render/canvas/BuilderGroup
|
||||
*/
|
||||
|
||||
import {createEmpty} from '../../extent.js';
|
||||
import Builder from './Builder.js';
|
||||
import ImageBuilder from './ImageBuilder.js';
|
||||
import LineStringBuilder from './LineStringBuilder.js';
|
||||
import PolygonBuilder from './PolygonBuilder.js';
|
||||
import TextBuilder from './TextBuilder.js';
|
||||
|
||||
import {createEmpty} from '../../extent.js';
|
||||
|
||||
/**
|
||||
* @type {Object<import("./BuilderType").default, typeof Builder>}
|
||||
@@ -19,10 +18,9 @@ const BATCH_CONSTRUCTORS = {
|
||||
'Image': ImageBuilder,
|
||||
'LineString': LineStringBuilder,
|
||||
'Polygon': PolygonBuilder,
|
||||
'Text': TextBuilder
|
||||
'Text': TextBuilder,
|
||||
};
|
||||
|
||||
|
||||
class BuilderGroup {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
@@ -32,7 +30,6 @@ class BuilderGroup {
|
||||
* @param {boolean} declutter Decluttering enabled.
|
||||
*/
|
||||
constructor(tolerance, maxExtent, resolution, pixelRatio, declutter) {
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @private
|
||||
@@ -126,8 +123,12 @@ class BuilderGroup {
|
||||
let replay = replays[builderType];
|
||||
if (replay === undefined) {
|
||||
const Constructor = BATCH_CONSTRUCTORS[builderType];
|
||||
replay = new Constructor(this.tolerance_, this.maxExtent_,
|
||||
this.resolution_, this.pixelRatio_);
|
||||
replay = new Constructor(
|
||||
this.tolerance_,
|
||||
this.maxExtent_,
|
||||
this.resolution_,
|
||||
this.pixelRatio_
|
||||
);
|
||||
replays[builderType] = replay;
|
||||
}
|
||||
return replay;
|
||||
|
||||
Reference in New Issue
Block a user