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
+34 -34
View File
@@ -6,15 +6,15 @@ describe('ol.geom.flat.interpolate', function() {
describe('ol.geom.flat.interpolate.lineString', function() {
it('returns the expected value for single points', function() {
var flatCoordinates = [0, 1];
var point =
const flatCoordinates = [0, 1];
const point =
_ol_geom_flat_interpolate_.lineString(flatCoordinates, 0, 2, 2, 0.5);
expect(point).to.eql([0, 1]);
});
it('returns the expected value for simple line segments', function() {
var flatCoordinates = [0, 1, 2, 3];
var point =
const flatCoordinates = [0, 1, 2, 3];
const point =
_ol_geom_flat_interpolate_.lineString(flatCoordinates, 0, 4, 2, 0.5);
expect(point).to.eql([1, 2]);
});
@@ -22,58 +22,58 @@ describe('ol.geom.flat.interpolate', function() {
it('returns the expected value when the mid point is an existing ' +
'coordinate',
function() {
var flatCoordinates = [0, 1, 2, 3, 4, 5];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
const flatCoordinates = [0, 1, 2, 3, 4, 5];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([2, 3]);
});
xit('also when vertices are repeated', function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
const flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([2, 3]);
});
it('returns the expected value when the midpoint falls halfway between ' +
'two existing coordinates',
function() {
var flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 8, 2, 0.5);
const flatCoordinates = [0, 1, 2, 3, 4, 5, 6, 7];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 8, 2, 0.5);
expect(point).to.eql([3, 4]);
});
xit('also when vertices are repeated', function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5, 6, 7];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 8, 2, 0.5);
const flatCoordinates = [0, 1, 2, 3, 2, 3, 4, 5, 6, 7];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 8, 2, 0.5);
expect(point).to.eql([3, 4]);
});
it('returns the expected value when the coordinates are not evenly spaced',
function() {
var flatCoordinates = [0, 1, 2, 3, 6, 7];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([3, 4]);
});
function() {
const flatCoordinates = [0, 1, 2, 3, 6, 7];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([3, 4]);
});
xit('also when vertices are repeated',
function() {
var flatCoordinates = [0, 1, 2, 3, 2, 3, 6, 7];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([3, 4]);
});
function() {
const flatCoordinates = [0, 1, 2, 3, 2, 3, 6, 7];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5);
expect(point).to.eql([3, 4]);
});
it('returns the expected value when using opt_dest',
function() {
var flatCoordinates = [0, 1, 2, 3, 6, 7];
var point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5, [0, 0]);
expect(point).to.eql([3, 4]);
});
function() {
const flatCoordinates = [0, 1, 2, 3, 6, 7];
const point = _ol_geom_flat_interpolate_.lineString(
flatCoordinates, 0, 6, 2, 0.5, [0, 0]);
expect(point).to.eql([3, 4]);
});
});