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

@@ -7,7 +7,7 @@ import XYZ from '../../../../src/ol/source/XYZ.js';
where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
function afterRender(source, raster, callback) {
var loading = 0;
let loading = 0;
source.on('tileloadstart', function(event) {
loading++;
@@ -26,7 +26,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
}
var map;
let map;
function createMap(renderer, pixelRatio) {
map = new Map({
target: createMapDiv(200, 200),
@@ -50,17 +50,17 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
it('renders the result of an operation', function(done) {
createMap('canvas', 1);
var source = new XYZ({
const source = new XYZ({
url: 'rendering/ol/data/tiles/osm/{z}/{x}/{y}.png',
transition: 0
});
var raster = new RasterSource({
const raster = new RasterSource({
sources: [source],
operation: function(pixels) {
var pixel = pixels[0];
const pixel = pixels[0];
// swap blue and red
var red = pixel[0];
const red = pixel[0];
pixel[0] = pixel[2];
pixel[2] = red;
return pixel;
@@ -75,7 +75,7 @@ where('Uint8ClampedArray').describe('ol.rendering.source.Raster', function() {
expectResemble(map, 'rendering/ol/source/expected/raster-1.png', IMAGE_TOLERANCE, done);
});
var layer = new ImageLayer({source: raster});
const layer = new ImageLayer({source: raster});
map.addLayer(layer);
});

View File

@@ -6,7 +6,7 @@ import TileWMS from '../../../../src/ol/source/TileWMS.js';
describe('ol.rendering.source.TileWMS', function() {
function tilesLoaded(source, callback) {
var loading = 0;
let loading = 0;
source.on('tileloadstart', function(event) {
loading++;
@@ -23,7 +23,7 @@ describe('ol.rendering.source.TileWMS', function() {
}
var map;
let map;
function createMap(renderer, pixelRatio) {
map = new Map({
target: createMapDiv(200, 200),
@@ -58,7 +58,7 @@ describe('ol.rendering.source.TileWMS', function() {
describe('0px gutter, 1 pixel ratio', function() {
it('tests the canvas renderer', function(done) {
createMap('canvas', 1);
var source = createSource(0);
const source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/0_1.canvas.png', IMAGE_TOLERANCE, done);
});
@@ -70,7 +70,7 @@ describe('ol.rendering.source.TileWMS', function() {
where('WebGL').it('tests the WebGL renderer', function(done) {
assertWebGL();
createMap('webgl', 1);
var source = createSource(0);
const source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/0_1.webgl.png', IMAGE_TOLERANCE, done);
});
@@ -83,7 +83,7 @@ describe('ol.rendering.source.TileWMS', function() {
describe('0px gutter, 2 pixel ratio', function() {
it('tests the canvas renderer', function(done) {
createMap('canvas', 2);
var source = createSource(0);
const source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/0_2.canvas.png', IMAGE_TOLERANCE, done);
});
@@ -95,7 +95,7 @@ describe('ol.rendering.source.TileWMS', function() {
where('WebGL').it('tests the WebGL renderer', function(done) {
assertWebGL();
createMap('webgl', 2);
var source = createSource(0);
const source = createSource(0);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/0_2.webgl.png', IMAGE_TOLERANCE, done);
});
@@ -109,7 +109,7 @@ describe('ol.rendering.source.TileWMS', function() {
describe('20px gutter, 1 pixel ratio', function() {
it('tests the canvas renderer', function(done) {
createMap('canvas', 1);
var source = createSource(20);
const source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/20_1.canvas.png', IMAGE_TOLERANCE, done);
});
@@ -121,7 +121,7 @@ describe('ol.rendering.source.TileWMS', function() {
where('WebGL').it('tests the WebGL renderer', function(done) {
assertWebGL();
createMap('webgl', 1);
var source = createSource(20);
const source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/20_1.webgl.png', IMAGE_TOLERANCE, done);
});
@@ -134,7 +134,7 @@ describe('ol.rendering.source.TileWMS', function() {
describe('20px gutter, 2 pixel ratio', function() {
it('tests the canvas renderer', function(done) {
createMap('canvas', 2);
var source = createSource(20);
const source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/20_2.canvas.png', IMAGE_TOLERANCE, done);
});
@@ -146,7 +146,7 @@ describe('ol.rendering.source.TileWMS', function() {
where('WebGL').it('tests the WebGL renderer', function(done) {
assertWebGL();
createMap('webgl', 2);
var source = createSource(20);
const source = createSource(20);
tilesLoaded(source, function() {
expectResemble(map, 'rendering/ol/source/expected/20_2.webgl.png', IMAGE_TOLERANCE, done);
});