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:
@@ -1,32 +1,30 @@
|
||||
import {WebGLWorkerMessageType} from '../../../../src/ol/renderer/webgl/Layer.js';
|
||||
import {create} from '../../../../src/ol/worker/webgl.js';
|
||||
import {
|
||||
WebGLWorkerMessageType
|
||||
} from '../../../../src/ol/renderer/webgl/Layer.js';
|
||||
|
||||
|
||||
describe('ol/worker/webgl', function() {
|
||||
|
||||
describe('ol/worker/webgl', function () {
|
||||
let worker;
|
||||
beforeEach(function() {
|
||||
beforeEach(function () {
|
||||
worker = create();
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
afterEach(function () {
|
||||
if (worker) {
|
||||
worker.terminate();
|
||||
}
|
||||
worker = null;
|
||||
});
|
||||
|
||||
describe('messaging', function() {
|
||||
describe('GENERATE_BUFFERS', function() {
|
||||
it('responds with buffer data', function(done) {
|
||||
worker.addEventListener('error', function(error) {
|
||||
describe('messaging', function () {
|
||||
describe('GENERATE_BUFFERS', function () {
|
||||
it('responds with buffer data', function (done) {
|
||||
worker.addEventListener('error', function (error) {
|
||||
expect().fail(error.message);
|
||||
});
|
||||
|
||||
worker.addEventListener('message', function(event) {
|
||||
expect(event.data.type).to.eql(WebGLWorkerMessageType.GENERATE_BUFFERS);
|
||||
worker.addEventListener('message', function (event) {
|
||||
expect(event.data.type).to.eql(
|
||||
WebGLWorkerMessageType.GENERATE_BUFFERS
|
||||
);
|
||||
expect(event.data.renderInstructions.byteLength).to.greaterThan(0);
|
||||
expect(event.data.indexBuffer.byteLength).to.greaterThan(0);
|
||||
expect(event.data.vertexBuffer.byteLength).to.greaterThan(0);
|
||||
@@ -42,12 +40,11 @@ describe('ol/worker/webgl', function() {
|
||||
renderInstructions: instructions,
|
||||
customAttributesCount: 0,
|
||||
testInt: 101,
|
||||
testString: 'abcd'
|
||||
testString: 'abcd',
|
||||
};
|
||||
|
||||
worker.postMessage(message);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user