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:
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
import {assert} from './asserts.js';
|
||||
|
||||
|
||||
/**
|
||||
* An array representing an affine 2d transformation for use with
|
||||
* {@link module:ol/transform} functions. The array has 6 elements.
|
||||
@@ -11,7 +10,6 @@ import {assert} from './asserts.js';
|
||||
* @api
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Collection of affine 2d transformation functions. The functions work on an
|
||||
* array of 6 elements. The element order is compatible with the [SVGMatrix
|
||||
@@ -24,14 +22,12 @@ import {assert} from './asserts.js';
|
||||
* ```
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Transform}
|
||||
*/
|
||||
const tmp_ = new Array(6);
|
||||
|
||||
|
||||
/**
|
||||
* Create an identity transform.
|
||||
* @return {!Transform} Identity transform.
|
||||
@@ -40,7 +36,6 @@ export function create() {
|
||||
return [1, 0, 0, 1, 0, 0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resets the given transform to an identity transform.
|
||||
* @param {!Transform} transform Transform.
|
||||
@@ -50,7 +45,6 @@ export function reset(transform) {
|
||||
return set(transform, 1, 0, 0, 1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Multiply the underlying matrices of two transforms and return the result in
|
||||
* the first transform.
|
||||
@@ -103,7 +97,6 @@ export function set(transform, a, b, c, d, e, f) {
|
||||
return transform;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set transform on one matrix from another matrix.
|
||||
* @param {!Transform} transform1 Matrix to set transform to.
|
||||
@@ -120,7 +113,6 @@ export function setFromArray(transform1, transform2) {
|
||||
return transform1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Transforms the given coordinate with the given transform returning the
|
||||
* resulting, transformed coordinate. The coordinate will be modified in-place.
|
||||
@@ -138,7 +130,6 @@ export function apply(transform, coordinate) {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Applies rotation to the given transform.
|
||||
* @param {!Transform} transform Transform.
|
||||
@@ -151,7 +142,6 @@ export function rotate(transform, angle) {
|
||||
return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Applies scale to a given transform.
|
||||
* @param {!Transform} transform Transform.
|
||||
@@ -185,7 +175,6 @@ export function translate(transform, dx, dy) {
|
||||
return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a composite transform given an initial translation, scale, rotation, and
|
||||
* final translation (in that order only, not commutative).
|
||||
@@ -229,7 +218,6 @@ export function composeCssTransform(dx1, dy1, sx, sy, angle, dx2, dy2) {
|
||||
return toString(compose(create(), dx1, dy1, sx, sy, angle, dx2, dy2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Invert the given transform.
|
||||
* @param {!Transform} source The source transform to invert.
|
||||
|
||||
Reference in New Issue
Block a user