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
+16 -16
View File
@@ -5,39 +5,39 @@ import {get as getProjection, transform} from '../../../../src/ol/proj.js';
describe('ol.reproj', function() {
describe('#calculateSourceResolution', function() {
var proj3857 = getProjection('EPSG:3857');
var proj4326 = getProjection('EPSG:4326');
var origin = [0, 0];
var point3857 = [50, 40];
var point4326 = transform(point3857, proj3857, proj4326);
const proj3857 = getProjection('EPSG:3857');
const proj4326 = getProjection('EPSG:4326');
const origin = [0, 0];
const point3857 = [50, 40];
const point4326 = transform(point3857, proj3857, proj4326);
it('is identity for identical projection', function() {
var result;
var resolution = 500;
let result;
const resolution = 500;
result = _ol_reproj_.calculateSourceResolution(
proj3857, proj3857, origin, resolution);
proj3857, proj3857, origin, resolution);
expect(result).to.be(resolution);
result = _ol_reproj_.calculateSourceResolution(
proj3857, proj3857, point3857, resolution);
proj3857, proj3857, point3857, resolution);
expect(result).to.be(resolution);
result = _ol_reproj_.calculateSourceResolution(
proj4326, proj4326, point4326, resolution);
proj4326, proj4326, point4326, resolution);
expect(result).to.be(resolution);
});
it('calculates correctly', function() {
var resolution4326 = 5;
const resolution4326 = 5;
var resolution3857 = _ol_reproj_.calculateSourceResolution(
proj3857, proj4326, point4326, resolution4326);
const resolution3857 = _ol_reproj_.calculateSourceResolution(
proj3857, proj4326, point4326, resolution4326);
expect(resolution3857).not.to.be(resolution4326);
expect(resolution3857).to.roughlyEqual(
5 * proj4326.getMetersPerUnit(), 1e-4);
5 * proj4326.getMetersPerUnit(), 1e-4);
var result = _ol_reproj_.calculateSourceResolution(
proj4326, proj3857, point3857, resolution3857);
const result = _ol_reproj_.calculateSourceResolution(
proj4326, proj3857, point3857, resolution3857);
expect(result).to.be(resolution4326);
});
});