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:
Tim Schaub
2020-04-06 12:25:12 -06:00
parent 53b48baf62
commit 054af09032
790 changed files with 46833 additions and 33765 deletions

View File

@@ -1,10 +1,10 @@
import Map from '../src/ol/Map.js';
import Stamen from '../src/ol/source/Stamen.js';
import TileLayer from '../src/ol/layer/Tile.js';
import TileWMS from '../src/ol/source/TileWMS.js';
import View from '../src/ol/View.js';
import {getCenter} from '../src/ol/extent.js';
import TileLayer from '../src/ol/layer/Tile.js';
import {transformExtent} from '../src/ol/proj.js';
import Stamen from '../src/ol/source/Stamen.js';
import TileWMS from '../src/ol/source/TileWMS.js';
function threeHoursAgo() {
return new Date(Math.round(Date.now() / 3600000) * 3600000 - 3600000 * 3);
@@ -18,25 +18,25 @@ let animationId = null;
const layers = [
new TileLayer({
source: new Stamen({
layer: 'terrain'
})
layer: 'terrain',
}),
}),
new TileLayer({
extent: extent,
source: new TileWMS({
attributions: ['Iowa State University'],
url: 'https://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi',
params: {'LAYERS': 'nexrad-n0r-wmst'}
})
})
params: {'LAYERS': 'nexrad-n0r-wmst'},
}),
}),
];
const map = new Map({
layers: layers,
target: 'map',
view: new View({
center: getCenter(extent),
zoom: 4
})
zoom: 4,
}),
});
function updateInfo() {
@@ -54,14 +54,14 @@ function setTime() {
}
setTime();
const stop = function() {
const stop = function () {
if (animationId !== null) {
window.clearInterval(animationId);
animationId = null;
}
};
const play = function() {
const play = function () {
stop();
animationId = window.setInterval(setTime, 1000 / frameRate);
};