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
+19 -19
View File
@@ -6,7 +6,7 @@ describe('ol.TileCoord', function() {
describe('create', function() {
it('sets x y z properties as expected', function() {
var tileCoord = [1, 2, 3];
const tileCoord = [1, 2, 3];
expect(tileCoord[0]).to.eql(1);
expect(tileCoord[1]).to.eql(2);
expect(tileCoord[2]).to.eql(3);
@@ -15,42 +15,42 @@ describe('ol.TileCoord', function() {
describe('call quadKey', function() {
it('returns expected string', function() {
var tileCoord = [3, 3, 5];
var s = _ol_tilecoord_.quadKey(tileCoord);
const tileCoord = [3, 3, 5];
const s = _ol_tilecoord_.quadKey(tileCoord);
expect(s).to.eql('213');
});
});
describe('getKey()', function() {
it('returns a key for a tile coord', function() {
var key = _ol_tilecoord_.getKey([1, 2, 3]);
const key = _ol_tilecoord_.getKey([1, 2, 3]);
expect(key).to.eql('1/2/3');
});
});
describe('fromKey()', function() {
it('returns a tile coord given a key', function() {
var tileCoord = [1, 2, 3];
var key = _ol_tilecoord_.getKey(tileCoord);
const tileCoord = [1, 2, 3];
const key = _ol_tilecoord_.getKey(tileCoord);
var returned = _ol_tilecoord_.fromKey(key);
const returned = _ol_tilecoord_.fromKey(key);
expect(returned).to.eql(tileCoord);
});
});
describe('hash', function() {
it('produces different hashes for different tile coords', function() {
var tileCoord1 = [3, 2, 1];
var tileCoord2 = [3, 1, 1];
const tileCoord1 = [3, 2, 1];
const tileCoord2 = [3, 1, 1];
expect(_ol_tilecoord_.hash(tileCoord1)).not.to.eql(
_ol_tilecoord_.hash(tileCoord2));
_ol_tilecoord_.hash(tileCoord2));
});
});
describe('withinExtentAndZ', function() {
it('restricts by z', function() {
var tileGrid = new TileGrid({
const tileGrid = new TileGrid({
extent: [10, 20, 30, 40],
tileSize: 10,
resolutions: [2, 1],
@@ -62,7 +62,7 @@ describe('ol.TileCoord', function() {
});
it('restricts by extent when extent defines tile ranges', function() {
var tileGrid = new TileGrid({
const tileGrid = new TileGrid({
extent: [10, 20, 30, 40],
sizes: [[3, -3]],
tileSize: 10,
@@ -74,7 +74,7 @@ describe('ol.TileCoord', function() {
});
it('restricts by extent when sizes define tile ranges', function() {
var tileGrid = new TileGrid({
const tileGrid = new TileGrid({
origin: [10, 20],
sizes: [[3, 3]],
tileSize: 10,
@@ -89,7 +89,7 @@ describe('ol.TileCoord', function() {
});
it('restricts by extent when sizes (neg y) define tile ranges', function() {
var tileGrid = new TileGrid({
const tileGrid = new TileGrid({
origin: [10, 40],
sizes: [[3, -3]],
tileSize: 10,
@@ -104,19 +104,19 @@ describe('ol.TileCoord', function() {
});
it('does not restrict by extent with no extent or sizes', function() {
var tileGrid = new TileGrid({
const tileGrid = new TileGrid({
origin: [10, 20],
tileSize: 10,
resolutions: [1]
});
expect(_ol_tilecoord_.withinExtentAndZ([0, Infinity, 0], tileGrid))
.to.be(true);
.to.be(true);
expect(_ol_tilecoord_.withinExtentAndZ([0, 0, Infinity], tileGrid))
.to.be(true);
.to.be(true);
expect(_ol_tilecoord_.withinExtentAndZ([0, -Infinity, 0], tileGrid))
.to.be(true);
.to.be(true);
expect(_ol_tilecoord_.withinExtentAndZ([0, 0, Infinity], tileGrid))
.to.be(true);
.to.be(true);
});
});