From bb8503fcea1e18bca397f3f76bda5e0f6a27d8da Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 22 Jan 2017 18:40:59 +0100 Subject: [PATCH] Adapt jshint for ES6 modules, fix semicolons --- .jshintrc | 1 + lib/adjust_axis.js | 2 +- lib/common/acosh.js | 2 +- lib/common/adjust_lat.js | 2 +- lib/common/adjust_lon.js | 2 +- lib/common/asinh.js | 2 +- lib/common/asinz.js | 2 +- lib/common/atanh.js | 2 +- lib/common/cosh.js | 2 +- lib/common/e0fn.js | 2 +- lib/common/e1fn.js | 2 +- lib/common/e2fn.js | 2 +- lib/common/e3fn.js | 2 +- lib/common/fL.js | 2 +- lib/common/gN.js | 2 +- lib/common/imlfn.js | 2 +- lib/common/inverseNadCvt.js | 2 +- lib/common/invlatiso.js | 2 +- lib/common/iqsfnz.js | 2 +- lib/common/latiso.js | 2 +- lib/common/mlfn.js | 2 +- lib/common/msfnz.js | 2 +- lib/common/nadInterBreakout.js | 2 +- lib/common/nad_cvt.js | 2 +- lib/common/nad_intr.js | 2 +- lib/common/phi2z.js | 2 +- lib/common/pj_enfn.js | 2 +- lib/common/pj_inv_mlfn.js | 2 +- lib/common/pj_mlfn.js | 2 +- lib/common/qsfnz.js | 2 +- lib/common/sign.js | 2 +- lib/common/sinh.js | 2 +- lib/common/srat.js | 2 +- lib/common/tanh.js | 2 +- lib/common/toPoint.js | 2 +- lib/common/tsfnz.js | 2 +- lib/datumUtils.js | 2 +- lib/datum_transform.js | 2 +- lib/extend.js | 2 +- lib/global.js | 2 +- lib/includedProjections.js | 2 +- lib/projString.js | 2 +- lib/transform.js | 2 +- lib/wkt.js | 2 +- package.json | 2 +- 45 files changed, 45 insertions(+), 44 deletions(-) diff --git a/.jshintrc b/.jshintrc index c076384a..86a6e6fa 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,4 +1,5 @@ { + "esversion": 6, "curly": true, "eqeqeq": true, "latedef": "nofunc", diff --git a/lib/adjust_axis.js b/lib/adjust_axis.js index afdff6b1..0579dfce 100644 --- a/lib/adjust_axis.js +++ b/lib/adjust_axis.js @@ -49,4 +49,4 @@ export default function(crs, denorm, point) { } } return out; -}; +} diff --git a/lib/common/acosh.js b/lib/common/acosh.js index 6895b28c..4997f3cd 100644 --- a/lib/common/acosh.js +++ b/lib/common/acosh.js @@ -1,3 +1,3 @@ export default function(x) { return 2 * Math.log(Math.sqrt((x + 1) / 2) + Math.sqrt((x - 1) / 2)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/adjust_lat.js b/lib/common/adjust_lat.js index 3e677a18..5c4c5bd1 100644 --- a/lib/common/adjust_lat.js +++ b/lib/common/adjust_lat.js @@ -3,4 +3,4 @@ import sign from './sign'; export default function(x) { return (Math.abs(x) < HALF_PI) ? x : (x - (sign(x) * Math.PI)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/adjust_lon.js b/lib/common/adjust_lon.js index ac5ff500..fab41ef1 100644 --- a/lib/common/adjust_lon.js +++ b/lib/common/adjust_lon.js @@ -8,4 +8,4 @@ import sign from './sign'; export default function(x) { return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/asinh.js b/lib/common/asinh.js index b3f7389d..51627eea 100644 --- a/lib/common/asinh.js +++ b/lib/common/asinh.js @@ -1,4 +1,4 @@ export default function(x) { var s = (x >= 0 ? 1 : -1); return s * (Math.log(Math.abs(x) + Math.sqrt(x * x + 1))); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/asinz.js b/lib/common/asinz.js index 26e57d9e..8f27ed69 100644 --- a/lib/common/asinz.js +++ b/lib/common/asinz.js @@ -3,4 +3,4 @@ export default function(x) { x = (x > 1) ? 1 : -1; } return Math.asin(x); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/atanh.js b/lib/common/atanh.js index 667fc7e5..2b082dc4 100644 --- a/lib/common/atanh.js +++ b/lib/common/atanh.js @@ -1,3 +1,3 @@ export default function(x) { return Math.log((x - 1) / (x + 1)) / 2; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/cosh.js b/lib/common/cosh.js index 449636f6..8b5174eb 100644 --- a/lib/common/cosh.js +++ b/lib/common/cosh.js @@ -2,4 +2,4 @@ export default function(x) { var r = Math.exp(x); r = (r + 1 / r) / 2; return r; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/e0fn.js b/lib/common/e0fn.js index 416ad95e..33501ac6 100644 --- a/lib/common/e0fn.js +++ b/lib/common/e0fn.js @@ -1,3 +1,3 @@ export default function(x) { return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x))); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/e1fn.js b/lib/common/e1fn.js index 8c101fc1..c4c85002 100644 --- a/lib/common/e1fn.js +++ b/lib/common/e1fn.js @@ -1,3 +1,3 @@ export default function(x) { return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x))); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/e2fn.js b/lib/common/e2fn.js index 84c41bb8..55539a70 100644 --- a/lib/common/e2fn.js +++ b/lib/common/e2fn.js @@ -1,3 +1,3 @@ export default function(x) { return (0.05859375 * x * x * (1 + 0.75 * x)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/e3fn.js b/lib/common/e3fn.js index d52a1a4e..6010428c 100644 --- a/lib/common/e3fn.js +++ b/lib/common/e3fn.js @@ -1,3 +1,3 @@ export default function(x) { return (x * x * x * (35 / 3072)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/fL.js b/lib/common/fL.js index 562f8733..9b3d3916 100644 --- a/lib/common/fL.js +++ b/lib/common/fL.js @@ -2,4 +2,4 @@ var HALF_PI = Math.PI/2; export default function(x, L) { return 2 * Math.atan(x * Math.exp(L)) - HALF_PI; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/gN.js b/lib/common/gN.js index 15473261..29bd5f05 100644 --- a/lib/common/gN.js +++ b/lib/common/gN.js @@ -1,4 +1,4 @@ export default function(a, e, sinphi) { var temp = e * sinphi; return a / Math.sqrt(1 - temp * temp); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/imlfn.js b/lib/common/imlfn.js index fd3a62bb..70859dc2 100644 --- a/lib/common/imlfn.js +++ b/lib/common/imlfn.js @@ -13,4 +13,4 @@ export default function(ml, e0, e1, e2, e3) { //..reportError("IMLFN-CONV:Latitude failed to converge after 15 iterations"); return NaN; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/inverseNadCvt.js b/lib/common/inverseNadCvt.js index 1a279234..ad9cb071 100644 --- a/lib/common/inverseNadCvt.js +++ b/lib/common/inverseNadCvt.js @@ -28,4 +28,4 @@ export default function(t, val, tb, ct) { val.x = adjust_lon(t.x + ct.ll[0]); val.y = t.y + ct.ll[1]; return val; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/invlatiso.js b/lib/common/invlatiso.js index 11f6c28c..1417f381 100644 --- a/lib/common/invlatiso.js +++ b/lib/common/invlatiso.js @@ -10,4 +10,4 @@ export default function(eccent, ts) { phi = fL(Math.exp(eccent * Math.log((1 + con) / (1 - con)) / 2), ts); } while (Math.abs(phi - Iphi) > 1.0e-12); return phi; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/iqsfnz.js b/lib/common/iqsfnz.js index b4efa306..674d9bc7 100644 --- a/lib/common/iqsfnz.js +++ b/lib/common/iqsfnz.js @@ -29,4 +29,4 @@ export default function(eccent, q) { //console.log("IQSFN-CONV:Latitude failed to converge after 30 iterations"); return NaN; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/latiso.js b/lib/common/latiso.js index eff70864..d667285e 100644 --- a/lib/common/latiso.js +++ b/lib/common/latiso.js @@ -13,4 +13,4 @@ export default function(eccent, phi, sinphi) { var con = eccent * sinphi; return Math.log(Math.tan((HALF_PI + phi) / 2)) + eccent * Math.log((1 - con) / (1 + con)) / 2; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/mlfn.js b/lib/common/mlfn.js index 23612c6f..53dc3d2e 100644 --- a/lib/common/mlfn.js +++ b/lib/common/mlfn.js @@ -1,3 +1,3 @@ export default function(e0, e1, e2, e3, phi) { return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/msfnz.js b/lib/common/msfnz.js index 32255d51..433f3470 100644 --- a/lib/common/msfnz.js +++ b/lib/common/msfnz.js @@ -1,4 +1,4 @@ export default function(eccent, sinphi, cosphi) { var con = eccent * sinphi; return cosphi / (Math.sqrt(1 - con * con)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/nadInterBreakout.js b/lib/common/nadInterBreakout.js index 035a6d04..1fdb9f8c 100644 --- a/lib/common/nadInterBreakout.js +++ b/lib/common/nadInterBreakout.js @@ -23,4 +23,4 @@ export default function(indx, frct, letter, number, ct) { } } return [indx, frct]; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/nad_cvt.js b/lib/common/nad_cvt.js index 269a66b4..e70a0fbc 100644 --- a/lib/common/nad_cvt.js +++ b/lib/common/nad_cvt.js @@ -28,4 +28,4 @@ export default function(pin, inverse, ct) { } } return val; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/nad_intr.js b/lib/common/nad_intr.js index d62913e7..861b5ec5 100644 --- a/lib/common/nad_intr.js +++ b/lib/common/nad_intr.js @@ -64,4 +64,4 @@ export default function(pin, ct) { val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x); val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y); return val; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/phi2z.js b/lib/common/phi2z.js index 270218da..6c01c63f 100644 --- a/lib/common/phi2z.js +++ b/lib/common/phi2z.js @@ -14,4 +14,4 @@ export default function(eccent, ts) { } //console.log("phi2z has NoConvergence"); return -9999; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/pj_enfn.js b/lib/common/pj_enfn.js index b5a541a2..5d9be385 100644 --- a/lib/common/pj_enfn.js +++ b/lib/common/pj_enfn.js @@ -21,4 +21,4 @@ export default function(es) { en[3] = t * (C66 - es * C68); en[4] = t * es * C88; return en; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/pj_inv_mlfn.js b/lib/common/pj_inv_mlfn.js index 353825ee..9575d928 100644 --- a/lib/common/pj_inv_mlfn.js +++ b/lib/common/pj_inv_mlfn.js @@ -18,4 +18,4 @@ export default function(arg, es, en) { } //..reportError("cass:pj_inv_mlfn: Convergence error"); return phi; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/pj_mlfn.js b/lib/common/pj_mlfn.js index b1168912..6e898c3d 100644 --- a/lib/common/pj_mlfn.js +++ b/lib/common/pj_mlfn.js @@ -2,4 +2,4 @@ export default function(phi, sphi, cphi, en) { cphi *= sphi; sphi *= sphi; return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4])))); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/qsfnz.js b/lib/common/qsfnz.js index 2c6eb3d4..6afb50a3 100644 --- a/lib/common/qsfnz.js +++ b/lib/common/qsfnz.js @@ -7,4 +7,4 @@ export default function(eccent, sinphi) { else { return (2 * sinphi); } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/sign.js b/lib/common/sign.js index ebe7cb30..c97da629 100644 --- a/lib/common/sign.js +++ b/lib/common/sign.js @@ -1,3 +1,3 @@ export default function(x) { return x<0 ? -1 : 1; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/sinh.js b/lib/common/sinh.js index 6ad3ba7a..db3fe4d2 100644 --- a/lib/common/sinh.js +++ b/lib/common/sinh.js @@ -2,4 +2,4 @@ export default function(x) { var r = Math.exp(x); r = (r - 1 / r) / 2; return r; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/srat.js b/lib/common/srat.js index ec7f256c..171b6279 100644 --- a/lib/common/srat.js +++ b/lib/common/srat.js @@ -1,3 +1,3 @@ export default function(esinp, exp) { return (Math.pow((1 - esinp) / (1 + esinp), exp)); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/tanh.js b/lib/common/tanh.js index 74eb4ae7..782414a2 100644 --- a/lib/common/tanh.js +++ b/lib/common/tanh.js @@ -2,4 +2,4 @@ export default function(x) { var r = Math.exp(x); r = (r - 1 / r) / (r + 1 / r); return r; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/toPoint.js b/lib/common/toPoint.js index 043cbaa7..7226892e 100644 --- a/lib/common/toPoint.js +++ b/lib/common/toPoint.js @@ -10,4 +10,4 @@ export default function (array){ out.m = array[3]; } return out; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/common/tsfnz.js b/lib/common/tsfnz.js index 23e6030a..d58b6be9 100644 --- a/lib/common/tsfnz.js +++ b/lib/common/tsfnz.js @@ -5,4 +5,4 @@ export default function(eccent, phi, sinphi) { var com = 0.5 * eccent; con = Math.pow(((1 - con) / (1 + con)), com); return (Math.tan(0.5 * (HALF_PI - phi)) / con); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/datumUtils.js b/lib/datumUtils.js index 27d506a5..b072f562 100644 --- a/lib/datumUtils.js +++ b/lib/datumUtils.js @@ -7,7 +7,7 @@ export function compareDatums(source, dest) { if (source.datum_type !== dest.datum_type) { return false; // false, datums are not equal } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) { - // the tolerence for es is to ensure that GRS80 and WGS84 + // the tolerance for es is to ensure that GRS80 and WGS84 // are considered identical return false; } else if (source.datum_type === PJD_3PARAM) { diff --git a/lib/datum_transform.js b/lib/datum_transform.js index 63caeafa..da4bb31f 100644 --- a/lib/datum_transform.js +++ b/lib/datum_transform.js @@ -37,4 +37,4 @@ export default function(source, dest, point) { } return datum.geocentricToGeodetic(point, dest.es, dest.a, dest.b); -}; +} diff --git a/lib/extend.js b/lib/extend.js index 41616977..bcd759f9 100644 --- a/lib/extend.js +++ b/lib/extend.js @@ -11,4 +11,4 @@ export default function(destination, source) { } } return destination; -}; +} diff --git a/lib/global.js b/lib/global.js index e09b1fa1..476a131a 100644 --- a/lib/global.js +++ b/lib/global.js @@ -8,4 +8,4 @@ export default function(defs) { defs.GOOGLE = defs['EPSG:3857']; defs['EPSG:900913'] = defs['EPSG:3857']; defs['EPSG:102113'] = defs['EPSG:3857']; -}; +} diff --git a/lib/includedProjections.js b/lib/includedProjections.js index 69a6533f..f8310635 100644 --- a/lib/includedProjections.js +++ b/lib/includedProjections.js @@ -50,4 +50,4 @@ export default function(proj4){ projs.forEach(function(proj){ proj4.Proj.projections.add(proj); }); -}; \ No newline at end of file +} \ No newline at end of file diff --git a/lib/projString.js b/lib/projString.js index 8fa49b38..d8b77ecc 100644 --- a/lib/projString.js +++ b/lib/projString.js @@ -129,4 +129,4 @@ export default function(defData) { self.datumCode = self.datumCode.toLowerCase(); } return self; -}; +} diff --git a/lib/transform.js b/lib/transform.js index f61015dd..8cb6c964 100644 --- a/lib/transform.js +++ b/lib/transform.js @@ -80,4 +80,4 @@ export default function transform(source, dest, point) { } return point; -}; +} diff --git a/lib/wkt.js b/lib/wkt.js index cd75ba47..3100734e 100644 --- a/lib/wkt.js +++ b/lib/wkt.js @@ -221,4 +221,4 @@ export default function(wkt, self) { sExpr(lisp, obj); cleanWKT(obj.output); return extend(self, obj.output); -}; +} diff --git a/package.json b/package.json index c82fab47..1baedc3d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "grunt-cli": "~0.1.13", "grunt": "~0.4.2", "grunt-contrib-connect": "~0.6.0", - "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-jshint": "~1.1.0", "chai": "~1.8.1", "mocha": "~1.17.1", "grunt-mocha-phantomjs": "~0.4.0",