Skip to content

Commit

Permalink
Enable a few more eslint rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgee committed Nov 30, 2015
1 parent 318e190 commit b439927
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-else-return": 2,
"no-empty-label": 2,
"no-empty-pattern": 2,
"no-eq-null": 2,
Expand Down Expand Up @@ -100,11 +101,10 @@
"yoda": 2,

// ignored best practices rules
"no-else-return": 0,
"no-invalid-this": 0,
"no-magic-numbers": 0,
"no-param-reassign": 0,
"no-warning-comments": 0,
"no-warning-comments": 2,
"vars-on-top": 0,


Expand All @@ -127,10 +127,10 @@
"no-undef": 2,
"no-unused-vars": 2,
"no-use-before-define": 2,
"no-undefined": 2,

// ignore variable rules
"init-declarations": 0,
"no-undefined": 0,


/*
Expand Down
2 changes: 1 addition & 1 deletion config/basemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define({
title: 'Basemaps', // tilte for widget
mapStartBasemap: 'streets', // must match one of the basemap keys below
//basemaps to show in menu. define in basemaps object below and reference by name here
// TODO Is this array necessary when the same keys are explicitly included/excluded below?

basemapsToShow: ['streets', 'satellite', 'hybrid', 'topo', 'lightGray', 'gray', 'national-geographic', 'osm', 'oceans'],

// define all valid custom basemaps here. Object of Basemap objects. For custom basemaps, the key name and basemap id must match.
Expand Down
3 changes: 1 addition & 2 deletions widgets/AttributesTable/_QueryTaskMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ define([
if (this.featureOptions.buffer && this.bufferParameters && this.bufferParameters.distance) {
this.executeBuffer();
return;
} else {
this.featureOptions.buffer = false;
}
this.featureOptions.buffer = false;

var url = this.getQueryTaskURL();
if (!url) {
Expand Down
18 changes: 9 additions & 9 deletions widgets/Export.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ define([
this.results = options.results;
this.grid = options.grid;

if (options.excel !== undefined) {
if (typeof(options.excel) !== 'undefined') {
this.excel = options.excel;
}
if (options.csv !== undefined) {
if (typeof(options.csv) !== 'undefined') {
this.csv = options.csv;
}
/*
Expand All @@ -156,9 +156,8 @@ define([
getFileName: function (extension) {
if (this.filename) {
return (typeof this.filename === 'function' ? this.filename(this) + extension : this.filename + extension);
} else {
return 'result' + extension;
}
return 'result' + extension;
},

/*******************************
Expand Down Expand Up @@ -487,7 +486,7 @@ define([
});

// feature detection
if (link.download !== undefined) {
if (typeof(link.download) !== 'undefined') {
// Browsers that support HTML5 download attribute
if (useBlob) {
url = window.URL.createObjectURL(blob);
Expand All @@ -505,12 +504,13 @@ define([
//feature detection using IE10+ routine
} else if (navigator.msSaveOrOpenBlob) {
return navigator.msSaveOrOpenBlob(blob, fileName);
} else {
window.open(dataURI);
window.focus();
return null;
}

// catch all. for which browsers?
window.open(dataURI);
window.focus();
return null;

}
});
});
2 changes: 1 addition & 1 deletion widgets/PrintPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ define([
this.printTask = new PrintTask(this.printTaskURL);
this.printparams = new PrintParameters();
this.printparams.map = this.map;
this.printparams.outSpatialReference = (this.outWkid && this.outWkid !== undefined) ? new SpatialReference(this.outWkid) : this.map.spatialReference;
this.printparams.outSpatialReference = (this.outWkid && typeof(this.outWkid) !== 'undefined') ? new SpatialReference(this.outWkid) : this.map.spatialReference;
if (this.showLayout) {
this.mapUnitsToMeters = this.getUnitToMetersFactor(this.map._params.units); //Print Plus Enhancements (this may break in future API releases)
if (isNaN(this.mapUnitsToMeters.x) || isNaN(this.mapUnitsToMeters.y)) {
Expand Down

0 comments on commit b439927

Please sign in to comment.