Remove lint

This commit is contained in:
Andreas Hocevar
2021-06-28 18:10:51 +02:00
parent b5bb9382e2
commit 79f5f46d27
135 changed files with 1040 additions and 2374 deletions

View File

@@ -86,19 +86,13 @@ describe('ol.color', function () {
expect(fromString('rgba(255, 255, 0, 0.0)')).to.eql([255, 255, 0, 0]);
// opacity 0.0000000000000000 (float with 16 digits)
expect(fromString('rgba(255, 255, 0, 0.0000000000000000)')).to.eql([
255,
255,
0,
0,
255, 255, 0, 0,
]);
// opacity 0.1 (simple float)
expect(fromString('rgba(255, 255, 0, 0.1)')).to.eql([255, 255, 0, 0.1]);
// opacity 0.1111111111111111 (float with 16 digits)
expect(fromString('rgba(255, 255, 0, 0.1111111111111111)')).to.eql([
255,
255,
0,
0.1111111111111111,
255, 255, 0, 0.1111111111111111,
]);
// opacity 1
expect(fromString('rgba(255, 255, 0, 1)')).to.eql([255, 255, 0, 1]);
@@ -106,10 +100,7 @@ describe('ol.color', function () {
expect(fromString('rgba(255, 255, 0, 1.0)')).to.eql([255, 255, 0, 1]);
// opacity 1.0000000000000000
expect(fromString('rgba(255, 255, 0, 1.0000000000000000)')).to.eql([
255,
255,
0,
1,
255, 255, 0, 1,
]);
// with 30 decimal digits
expect(
@@ -118,9 +109,9 @@ describe('ol.color', function () {
});
it('ignores whitespace before, between & after numbers (rgba)', function () {
expect(
fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')
).to.eql([0, 0, 255, 0.4711]);
expect(fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')).to.eql(
[0, 0, 255, 0.4711]
);
});
it('throws an error on invalid colors', function () {

View File

@@ -47,9 +47,8 @@ describe('ol.control.ZoomSlider', function () {
const zoomSliderContainer = zoomSliderContainers[0];
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
let hasUnselectableCls = zoomSliderContainer.classList.contains(
'ol-unselectable'
);
let hasUnselectableCls =
zoomSliderContainer.classList.contains('ol-unselectable');
expect(hasUnselectableCls).to.be(true);
const zoomSliderThumbs = zoomSliderContainer.querySelectorAll(
@@ -60,9 +59,8 @@ describe('ol.control.ZoomSlider', function () {
const zoomSliderThumb = zoomSliderThumbs[0];
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
hasUnselectableCls = zoomSliderThumb.classList.contains(
'ol-unselectable'
);
hasUnselectableCls =
zoomSliderThumb.classList.contains('ol-unselectable');
expect(hasUnselectableCls).to.be(true);
});
});

View File

@@ -1793,29 +1793,13 @@ describe('ol.format.GML3', function () {
it('creates 3D Features with the expected geometries', function () {
const expectedGeometry1 = [
4.46386854,
51.91122415,
46.04679351,
4.46382399,
51.91120839,
4.46386854, 51.91122415, 46.04679351, 4.46382399, 51.91120839,
46.04679382,
];
const expectedGeometry2 = [
4.46385491,
51.91119276,
46.06074531,
4.4638264,
51.91118582,
46.06074609,
4.46380612,
51.91121772,
46.06074168,
4.46383463,
51.91122465,
46.06074089,
4.46385491,
51.91119276,
46.06074531,
4.46385491, 51.91119276, 46.06074531, 4.4638264, 51.91118582,
46.06074609, 4.46380612, 51.91121772, 46.06074168, 4.46383463,
51.91122465, 46.06074089, 4.46385491, 51.91119276, 46.06074531,
];
const expectedGeometry3 = [4.46383715, 51.91125849, 46.04679348];

View File

@@ -22,9 +22,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function () {
const options = {
featureProjection: 'EPSG:3857',
extent: [
1824704.739223726,
6141868.096770482,
1827150.7241288517,
1824704.739223726, 6141868.096770482, 1827150.7241288517,
6144314.081675608,
],
};
@@ -134,9 +132,7 @@ describe('ol.format.MVT', function () {
const options = {
featureProjection: 'EPSG:3857',
extent: [
1824704.739223726,
6141868.096770482,
1827150.7241288517,
1824704.739223726, 6141868.096770482, 1827150.7241288517,
6144314.081675608,
],
};

View File

@@ -139,10 +139,7 @@ describe('ol.format.WFS', function () {
expect(feature.getId()).to.equal('1');
expect(feature.get('name')).to.equal('My Polygon with hole');
expect(feature.get('boundedBy')).to.eql([
47.003018,
-0.768746,
47.925567,
0.532597,
47.003018, -0.768746, 47.925567, 0.532597,
]);
expect(feature.getGeometry()).to.be.an(MultiPolygon);
expect(feature.getGeometry().getFlatCoordinates()).to.have.length(60);
@@ -205,10 +202,7 @@ describe('ol.format.WFS', function () {
});
it('returns the correct bounds', function () {
expect(response.bounds).to.eql([
3197.88,
306457.313,
280339.156,
613850.438,
3197.88, 306457.313, 280339.156, 613850.438,
]);
});
});

View File

@@ -117,10 +117,7 @@ describe('ol.format.WMSCapabilities', function () {
},
]);
expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql([
-71.63,
41.75,
-70.78,
42.9,
-71.63, 41.75, -70.78, 42.9,
]);
expect(layer.Layer[0].Style).to.eql([
{

View File

@@ -55,10 +55,7 @@ describe('ol.format.WMSGetFeatureInfo', function () {
const feature = features[0];
expect(feature.getGeometry()).to.be(undefined);
expect(feature.get('boundedBy')).to.eql([
-531138.686422,
5386348.414671,
-117252.819653,
6144475.186022,
-531138.686422, 5386348.414671, -117252.819653, 6144475.186022,
]);
});

View File

@@ -19,9 +19,7 @@ describe('ol.layer.Graticule', function () {
it('creates a graticule without labels', function () {
createGraticule();
const extent = [
-25614353.926475704,
-7827151.696402049,
25614353.926475704,
-25614353.926475704, -7827151.696402049, 25614353.926475704,
7827151.696402049,
];
const projection = getProjection('EPSG:3857');
@@ -45,9 +43,7 @@ describe('ol.layer.Graticule', function () {
layers: [graticule],
});
const extent = [
-25614353.926475704,
-7827151.696402049,
25614353.926475704,
-25614353.926475704, -7827151.696402049, 25614353.926475704,
7827151.696402049,
];
const projection = getProjection('EPSG:3857');
@@ -97,9 +93,7 @@ describe('ol.layer.Graticule', function () {
layers: [graticule],
});
const extent = [
-25614353.926475704,
-7827151.696402049,
25614353.926475704,
-25614353.926475704, -7827151.696402049, 25614353.926475704,
7827151.696402049,
];
const projection = getProjection('EPSG:3857');
@@ -183,9 +177,7 @@ describe('ol.layer.Graticule', function () {
latLabelStyle: latLabelStyle,
});
const extent = [
-25614353.926475704,
-7827151.696402049,
25614353.926475704,
-25614353.926475704, -7827151.696402049, 25614353.926475704,
7827151.696402049,
];
const projection = getProjection('EPSG:3857');
@@ -224,9 +216,7 @@ describe('ol.layer.Graticule', function () {
layers: [graticule],
});
const extent = [
-25614353.926475704,
-7827151.696402049,
25614353.926475704,
-25614353.926475704, -7827151.696402049, 25614353.926475704,
7827151.696402049,
];
const projection = getProjection('EPSG:3857');

View File

@@ -330,8 +330,7 @@ describe('ol.layer.Layer', function () {
inView: true,
},
{
when:
'view resolution is greater than minResolution (with maxResolution)',
when: 'view resolution is greater than minResolution (with maxResolution)',
minResolution: 2,
maxResolution: 4,
view: {
@@ -369,8 +368,7 @@ describe('ol.layer.Layer', function () {
inView: false,
},
{
when:
'view resolution is greater than maxResolution (with minResolution)',
when: 'view resolution is greater than maxResolution (with minResolution)',
minResolution: 2,
maxResolution: 4,
view: {

View File

@@ -1018,9 +1018,8 @@ describe('ol.Map', function () {
it('gets coordinates in view projection', function (done) {
map.renderSync();
const coordinateMercator = map.getCoordinateFromPixelInternal(
screenCenter
);
const coordinateMercator =
map.getCoordinateFromPixelInternal(screenCenter);
expect(coordinateMercator[0]).to.roughlyEqual(centerMercator[0], 1e-5);
expect(coordinateMercator[1]).to.roughlyEqual(centerMercator[1], 1e-5);
done();

View File

@@ -39,9 +39,7 @@ describe('hitdetect', function () {
0
);
expect(Array.prototype.slice.call(imageData.data, 0, 3)).to.eql([
255,
255,
252,
255, 255, 252,
]);
});
it('detects hit at the correct position', function () {

View File

@@ -271,18 +271,12 @@ describe('ol.render.canvas.Immediate', function () {
};
const transform = [
0.0004088332670837288,
0,
0,
-0.0004088332670837288,
4480.991370439071,
0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071,
1529.5752568707105,
];
const extent = [
-10960437.252092224,
2762924.0275091752,
-7572748.158493212,
-10960437.252092224, 2762924.0275091752, -7572748.158493212,
3741317.9895594316,
];

View File

@@ -121,28 +121,7 @@ describe('ol.render.canvas.TextBuilder', function () {
builder.drawText(feature.getGeometry(), feature);
});
expect(builder.coordinates).to.eql([
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
]);
});
@@ -219,28 +198,7 @@ describe('ol.render.canvas.TextBuilder', function () {
builder.drawText(feature.getGeometry(), feature);
});
expect(builder.coordinates).to.eql([
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
]);
});

View File

@@ -353,14 +353,7 @@ describe('ol.render.canvas.Builder', function () {
const flat = [-110, 45, 110, 45, 110, -45, -110, -45, -110, 45];
replay.appendFlatLineCoordinates(flat, 0, flat.length, 2, true, true);
expect(replay.coordinates).to.eql([
110,
45,
110,
-45,
-110,
-45,
-110,
45,
110, 45, 110, -45, -110, -45, -110, 45,
]);
});

View File

@@ -385,9 +385,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function () {
target.style.height = '100px';
document.body.appendChild(target);
const extent = [
1824704.739223726,
6141868.096770482,
1827150.7241288517,
1824704.739223726, 6141868.096770482, 1827150.7241288517,
6144314.081675608,
];
const source = new VectorTileSource({

View File

@@ -593,8 +593,7 @@ describe('ol.renderer.webgl.PointsLayer', function () {
expect(getCache(features[0], renderer).feature).to.be(features[0]);
expect(getCache(features[0], renderer).geometry.getCoordinates()).to.eql([
10,
20,
10, 20,
]);
expect(getCache(features[0], renderer).properties['test']).to.be(
features[0].get('test')
@@ -649,10 +648,7 @@ describe('ol.renderer.webgl.PointsLayer', function () {
zoom: 7,
},
extent: [
11.1932373046875,
46.429931640625,
18.8067626953125,
57.570068359375,
11.1932373046875, 46.429931640625, 18.8067626953125, 57.570068359375,
],
size: [693, 1014],
layerIndex: 0,

View File

@@ -5,9 +5,7 @@ describe('ol.source.ImageStatic', function () {
let extent, pixelRatio, projection, resolution;
beforeEach(function () {
extent = [
-13637278.73946974,
4543799.13271362,
-13617443.330629736,
-13637278.73946974, 4543799.13271362, -13617443.330629736,
4553927.038961405,
];
pixelRatio = 1;
@@ -20,9 +18,7 @@ describe('ol.source.ImageStatic', function () {
const source = new Static({
url: 'spec/ol/source/images/12-655-1583.png',
imageExtent: [
-13629027.891360067,
4539747.983913189,
-13619243.951739565,
-13629027.891360067, 4539747.983913189, -13619243.951739565,
4559315.863154193,
],
projection: projection,
@@ -43,9 +39,7 @@ describe('ol.source.ImageStatic', function () {
const source = new Static({
url: 'spec/ol/source/images/12-655-1583.png',
imageExtent: [
-13629027.891360067,
4539747.983913189,
-13609460.012119063,
-13629027.891360067, 4539747.983913189, -13609460.012119063,
4549531.923533691,
],
projection: projection,
@@ -66,9 +60,7 @@ describe('ol.source.ImageStatic', function () {
const source = new Static({
url: 'spec/ol/source/images/12-655-1583.png',
imageExtent: [
-13629027.891360067,
4539747.983913189,
-13619243.951739565,
-13629027.891360067, 4539747.983913189, -13619243.951739565,
4559315.863154193,
],
imageSize: [254, 254],
@@ -90,9 +82,7 @@ describe('ol.source.ImageStatic', function () {
const source = new Static({
url: 'spec/ol/source/images/12-655-1583.png',
imageExtent: [
-13629027.891360067,
4539747.983913189,
-13619243.951739565,
-13629027.891360067, 4539747.983913189, -13619243.951739565,
4549531.923533691,
],
projection: projection,

View File

@@ -79,9 +79,7 @@ describe('ol.source.TileJSON', function () {
it('returns attributions, but not when outside bounds', function () {
tileJSON.bounds = [
-10.764179999935878,
49.528423000201656,
1.9134115551745678,
-10.764179999935878, 49.528423000201656, 1.9134115551745678,
61.3311509999582,
];
const source = new TileJSON({

View File

@@ -70,9 +70,7 @@ describe('ol.source.TileWMS', function () {
const queryData = uri.searchParams;
const bbox = queryData.get('BBOX').split(',');
const expected = [
-10331840.239250705,
-15341217.324948018,
-4696291.017841229,
-10331840.239250705, -15341217.324948018, -4696291.017841229,
-9705668.103538541,
];
for (let i = 0, ii = bbox.length; i < ii; ++i) {

View File

@@ -247,9 +247,7 @@ describe('ol.source.VectorTile', function () {
}
const extent = [
665584.2026596286,
7033250.839875697,
667162.0221431496,
665584.2026596286, 7033250.839875697, 667162.0221431496,
7035280.378636755,
];
@@ -257,20 +255,7 @@ describe('ol.source.VectorTile', function () {
tileGrid: new TileGrid({
origin: [218128, 6126002],
resolutions: [
4096,
2048,
1024,
512,
256,
128,
64,
32,
16,
8,
4,
2,
1,
0.5,
4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5,
],
}),
tileUrlFunction: tileUrlFunction,
@@ -391,9 +376,7 @@ describe('ol.source.VectorTile', function () {
target.style.height = '100px';
document.body.appendChild(target);
const extent = [
1824704.739223726,
6141868.096770482,
1827150.7241288517,
1824704.739223726, 6141868.096770482, 1827150.7241288517,
6144314.081675608,
];
source = new VectorTileSource({

View File

@@ -47,35 +47,22 @@ describe('ol.tilegrid.WMTS', function () {
expect(tileGrid.resolutions_).to.be.an('array');
expect(tileGrid.resolutions_).to.have.length(20);
expect(tileGrid.resolutions_).to.eql([
156543.03392811998,
78271.51696419998,
39135.758481959994,
19567.879241008,
9783.939620504,
4891.969810252,
2445.984905126,
1222.9924525644,
611.4962262807999,
305.74811314039994,
152.87405657047998,
76.43702828523999,
38.21851414248,
19.109257071295996,
9.554628535647998,
4.777314267823999,
2.3886571339119995,
1.1943285669559998,
0.5971642834779999,
156543.03392811998, 78271.51696419998, 39135.758481959994,
19567.879241008, 9783.939620504, 4891.969810252, 2445.984905126,
1222.9924525644, 611.4962262807999, 305.74811314039994,
152.87405657047998, 76.43702828523999, 38.21851414248,
19.109257071295996, 9.554628535647998, 4.777314267823999,
2.3886571339119995, 1.1943285669559998, 0.5971642834779999,
0.29858214174039993,
]);
expect(tileGrid.origins_).to.be.an('array');
expect(tileGrid.origins_).to.have.length(20);
expect(tileGrid.origins_).to.eql(
Array.apply(null, Array(20)).map(Array.prototype.valueOf, [
-20037508.3428,
20037508.3428,
])
Array.apply(null, Array(20)).map(
Array.prototype.valueOf,
[-20037508.3428, 20037508.3428]
)
);
expect(tileGrid.tileSizes_).to.be.an('array');
@@ -133,37 +120,22 @@ describe('ol.tilegrid.WMTS', function () {
expect(tileGrid.resolutions_).to.be.an('array');
expect(tileGrid.resolutions_).to.have.length(22);
expect(tileGrid.resolutions_).to.eql([
156543.033928041,
78271.51696402048,
39135.758482010235,
19567.87924100512,
9783.93962050256,
4891.96981025128,
2445.98490512564,
1222.99245256282,
611.49622628141,
305.7481131407048,
152.8740565703525,
76.43702828517624,
38.21851414258813,
19.10925707129406,
9.554628535647032,
4.777314267823516,
2.388657133911758,
1.194328566955879,
0.5971642834779395,
0.2985821417389697,
0.1492910708694849,
0.0746455354347424,
156543.033928041, 78271.51696402048, 39135.758482010235,
19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564,
1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525,
76.43702828517624, 38.21851414258813, 19.10925707129406,
9.554628535647032, 4.777314267823516, 2.388657133911758,
1.194328566955879, 0.5971642834779395, 0.2985821417389697,
0.1492910708694849, 0.0746455354347424,
]);
expect(tileGrid.origins_).to.be.an('array');
expect(tileGrid.origins_).to.have.length(22);
expect(tileGrid.origins_).to.eql(
Array.apply(null, Array(22)).map(Array.prototype.valueOf, [
-20037508,
20037508,
])
Array.apply(null, Array(22)).map(
Array.prototype.valueOf,
[-20037508, 20037508]
)
);
expect(tileGrid.tileSizes_).to.be.an('array');
@@ -210,35 +182,21 @@ describe('ol.tilegrid.WMTS', function () {
expect(tileGrid.resolutions_).to.be.an('array');
expect(tileGrid.resolutions_).to.have.length(20);
expect(tileGrid.resolutions_).to.eql([
156543.033928041,
78271.51696402048,
39135.758482010235,
19567.87924100512,
9783.93962050256,
4891.96981025128,
2445.98490512564,
1222.99245256282,
611.49622628141,
305.7481131407048,
152.8740565703525,
76.43702828517624,
38.21851414258813,
19.10925707129406,
9.554628535647032,
4.777314267823516,
2.388657133911758,
1.194328566955879,
0.5971642834779395,
0.2985821417389697,
156543.033928041, 78271.51696402048, 39135.758482010235,
19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564,
1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525,
76.43702828517624, 38.21851414258813, 19.10925707129406,
9.554628535647032, 4.777314267823516, 2.388657133911758,
1.194328566955879, 0.5971642834779395, 0.2985821417389697,
]);
expect(tileGrid.origins_).to.be.an('array');
expect(tileGrid.origins_).to.have.length(20);
expect(tileGrid.origins_).to.eql(
Array.apply(null, Array(20)).map(Array.prototype.valueOf, [
-20037508,
20037508,
])
Array.apply(null, Array(20)).map(
Array.prototype.valueOf,
[-20037508, 20037508]
)
);
expect(tileGrid.tileSizes_).to.be.an('array');
@@ -264,17 +222,16 @@ describe('ol.tilegrid.WMTS', function () {
expect(tileGrid.resolutions_).to.be.an('array');
expect(tileGrid.resolutions_).to.have.length(2);
expect(tileGrid.resolutions_).to.eql([
156543.033928041,
78271.51696402048,
156543.033928041, 78271.51696402048,
]);
expect(tileGrid.origins_).to.be.an('array');
expect(tileGrid.origins_).to.have.length(2);
expect(tileGrid.origins_).to.eql(
Array.apply(null, Array(2)).map(Array.prototype.valueOf, [
-20037508,
20037508,
])
Array.apply(null, Array(2)).map(
Array.prototype.valueOf,
[-20037508, 20037508]
)
);
expect(tileGrid.tileSizes_).to.be.an('array');

View File

@@ -15,8 +15,7 @@ describe('ol.VectorTile', function () {
const loader = tile.loader_;
listen(tile, 'change', function (e) {
expect(tile.getFeatures()[0].getGeometry().getFlatCoordinates()).to.eql([
-9724792.346778862,
4164041.638405114,
-9724792.346778862, 4164041.638405114,
]);
done();
});