Use blocked scoped variables

In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
This commit is contained in:
Tim Schaub
2018-01-11 23:32:36 -07:00
parent 0bf2b04dee
commit ad62739a6e
684 changed files with 18120 additions and 18184 deletions

View File

@@ -6,60 +6,60 @@ describe('ol.geom.flat.length', function() {
describe('ol.geom.flat.length.lineString', function() {
describe('stride = 2', function() {
var flatCoords = [0, 0, 1, 0, 1, 1, 0, 1];
var stride = 2;
const flatCoords = [0, 0, 1, 0, 1, 1, 0, 1];
const stride = 2;
it('calculates the total length of a lineString', function() {
var offset = 0;
var end = 8;
var expected = 3;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 0;
const end = 8;
const expected = 3;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
it('calculates a partwise length of a lineString (offset)', function() {
var offset = 2;
var end = 8;
var expected = 2;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 2;
const end = 8;
const expected = 2;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
it('calculates a partwise length of a lineString (end)', function() {
var offset = 0;
var end = 4;
var expected = 1;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 0;
const end = 4;
const expected = 1;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
});
describe('stride = 3', function() {
var flatCoords = [0, 0, 42, 1, 0, 42, 1, 1, 42, 0, 1, 42];
var stride = 3;
const flatCoords = [0, 0, 42, 1, 0, 42, 1, 1, 42, 0, 1, 42];
const stride = 3;
it('calculates the total length of a lineString', function() {
var offset = 0;
var end = 12;
var expected = 3;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 0;
const end = 12;
const expected = 3;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
it('calculates a partwise length of a lineString (offset)', function() {
var offset = 3;
var end = 12;
var expected = 2;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 3;
const end = 12;
const expected = 2;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
it('calculates a partwise length of a lineString (end)', function() {
var offset = 0;
var end = 6;
var expected = 1;
var got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const offset = 0;
const end = 6;
const expected = 1;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -69,22 +69,22 @@ describe('ol.geom.flat.length', function() {
describe('ol.geom.flat.length.linearRing', function() {
it('calculates the total length of a simple linearRing', function() {
var flatCoords = [0, 0, 1, 0, 1, 1, 0, 1];
var stride = 2;
var offset = 0;
var end = 8;
var expected = 4;
var got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
const flatCoords = [0, 0, 1, 0, 1, 1, 0, 1];
const stride = 2;
const offset = 0;
const end = 8;
const expected = 4;
const got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
it('calculates the total length of a figure-8 linearRing', function() {
var flatCoords = [0, 0, 1, 0, 1, 1, 0, 1, 0, -1, -1, -1, -1, 0];
var stride = 2;
var offset = 0;
var end = 14;
var expected = 8;
var got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
const flatCoords = [0, 0, 1, 0, 1, 1, 0, 1, 0, -1, -1, -1, -1, 0];
const stride = 2;
const offset = 0;
const end = 14;
const expected = 8;
const got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});