diff --git a/.eslintrc b/.eslintrc index 1f172e75a..f1bdc7e22 100644 --- a/.eslintrc +++ b/.eslintrc @@ -69,6 +69,7 @@ "no-shadow-restricted-names": "error", "no-template-curly-in-string": "warn", "no-throw-literal": "error", + "no-trailing-spaces": "warn", "no-undef": "error", "no-undef-init": "warn", "no-unexpected-multiline": "error", diff --git a/modules/actions/straighten_nodes.js b/modules/actions/straighten_nodes.js index 42d764123..04aa3063d 100644 --- a/modules/actions/straighten_nodes.js +++ b/modules/actions/straighten_nodes.js @@ -8,7 +8,7 @@ export function actionStraightenNodes(nodeIDs, projection) { return geoVecDot(a, b, o) / geoVecDot(b, b, o); } - // returns the endpoints of the long axis of symmetry of the `points` bounding rect + // returns the endpoints of the long axis of symmetry of the `points` bounding rect function getEndpoints(points) { var ssr = geoGetSmallestSurroundingRectangle(points); diff --git a/modules/core/localizer.js b/modules/core/localizer.js index f26f789db..06a7c5282 100644 --- a/modules/core/localizer.js +++ b/modules/core/localizer.js @@ -322,7 +322,7 @@ export function coreLocalizer() { // Returns the localized text wrapped in an HTML element encoding the locale info localizer.t.html = function(stringId, replacements, locale) { const info = localizer.tInfo(stringId, replacements, locale); - // text may be empty or undefined if `replacements.default` is + // text may be empty or undefined if `replacements.default` is return info.text ? localizer.htmlForLocalizedText(info.text, info.locale) : ''; }; diff --git a/modules/services/openstreetcam.js b/modules/services/openstreetcam.js index 1755182c2..3e6360b3a 100644 --- a/modules/services/openstreetcam.js +++ b/modules/services/openstreetcam.js @@ -223,10 +223,10 @@ export default { lineStrings.push({ type: 'LineString', coordinates: images.map(function (d) { return d.loc; }).filter(Boolean), - properties: { + properties: { captured_at: images[0] ? images[0].captured_at: null, captured_by: images[0] ? images[0].captured_by: null, - key: sequenceKey + key: sequenceKey } }); } diff --git a/modules/util/jxon.js b/modules/util/jxon.js index 714d06d9d..ee33f83ee 100644 --- a/modules/util/jxon.js +++ b/modules/util/jxon.js @@ -89,7 +89,7 @@ export var JXON = new (function () { if (oParentObj instanceof String || oParentObj instanceof Number || oParentObj instanceof Boolean) { oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString())); /* verbosity level is 0 */ } else if (oParentObj.constructor === Date) { - oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString())); + oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString())); } for (var sName in oParentObj) { @@ -121,10 +121,10 @@ export var JXON = new (function () { this.build = function (oXMLParent, nVerbosity /* optional */, bFreeze /* optional */, bNesteAttributes /* optional */) { var _nVerb = arguments.length > 1 && typeof nVerbosity === 'number' ? nVerbosity & 3 : /* put here the default verbosity level: */ 1; - return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3); + return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3); }; - this.unbuild = function (oObjTree) { + this.unbuild = function (oObjTree) { var oNewDoc = document.implementation.createDocument('', '', null); loadObjTree(oNewDoc, oNewDoc, oObjTree); return oNewDoc; diff --git a/package.json b/package.json index d79c3169d..b0a8dfcb3 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "dist:svg:temaki": "svg-sprite --symbol --symbol-dest . --shape-id-generator \"temaki-%s\" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@ideditor/temaki/icons/*.svg", "imagery": "node scripts/update_imagery.js", "lint": "eslint scripts test/spec modules", + "lint:fix": "eslint scripts test/spec modules --fix", "start": "npm-run-all -s build start:server", "quickstart": "npm-run-all -s build:dev start:server", "start:server": "node scripts/server.js", diff --git a/test/spec/services/openstreetcam.js b/test/spec/services/openstreetcam.js index a00ab3a40..04aad0a40 100644 --- a/test/spec/services/openstreetcam.js +++ b/test/spec/services/openstreetcam.js @@ -256,7 +256,7 @@ describe('iD.serviceOpenstreetcam', function() { properties: { captured_at: undefined, captured_by: undefined, - key: '100' + key: '100' } }]); });