Skip to content

Commit

Permalink
Merge pull request #537 from cmv/feature/update-grunt-packages-and-es…
Browse files Browse the repository at this point in the history
…lint-rules

Update grunt packages, node and eslint rules
  • Loading branch information
DavidSpriggs committed Apr 12, 2016
2 parents 069b500 + 4594aff commit e854509
Show file tree
Hide file tree
Showing 54 changed files with 42 additions and 87 deletions.
10 changes: 4 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"dot-notation": 2,
"eqeqeq": 2,
"guard-for-in": 2,
"max-statements": [1, 30, {"ignoreTopLevelFunctions": true}],
"no-alert": 2,
"no-caller": 2,
"no-div-regex": 2,
"no-empty-label": 2,
"no-empty-pattern": 2,
"no-eq-null": 2,
"no-eval": 2,
Expand Down Expand Up @@ -158,6 +158,7 @@
"afterColon": true,
"mode": "strict"
}],
"keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}],
"max-nested-callbacks": [2, 4],
"new-cap": 2,
"new-parens": 2,
Expand All @@ -175,13 +176,10 @@
"after": true
}],
"semi": [2, "always"],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "always"],
"space-before-keywords": [2, "always"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"wrap-regex": 2,

// ignored stylistic rules
Expand Down Expand Up @@ -240,8 +238,8 @@
"browser": true
},
"globals": {
"define": false,
"require": false
"define": true,
"require": true
},
"parser": "babel-eslint",
"extends": "eslint:recommended"
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '0.10'
- '5'
sudo: false
before_install: npm install -g grunt-cli
before_script: grunt build --verbose
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function (grunt) {
src: ['dist']
}
},
autoprefixer: {
postcss: {
build: {
expand: true,
cwd: 'dist/viewer',
Expand Down Expand Up @@ -161,7 +161,7 @@ module.exports = function (grunt) {
// load the tasks
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-postcss');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-csslint');
grunt.loadNpmTasks('grunt-contrib-uglify');
Expand All @@ -177,6 +177,6 @@ module.exports = function (grunt) {
grunt.registerTask('build', 'Compiles all of the assets and copies the files to the build directory.', ['clean', 'copy', 'scripts', 'stylesheets', 'compress:build']);
grunt.registerTask('build-view', 'Compiles all of the assets and copies the files to the build directory starts a web server and opens browser to preview app.', ['clean', 'copy', 'scripts', 'stylesheets', 'compress:build', 'connect:build', 'open:build_browser', 'watch:build']);
grunt.registerTask('scripts', 'Compiles the JavaScript files.', ['eslint', 'uglify']);
grunt.registerTask('stylesheets', 'Auto prefixes css and compiles the stylesheets.', ['csslint:lax', 'autoprefixer', 'cssmin']);
grunt.registerTask('stylesheets', 'Auto prefixes css and compiles the stylesheets.', ['csslint:lax', 'postcss', 'cssmin']);
grunt.registerTask('lint', 'Run eslint and csslint.', ['eslint', 'csslint:strict']);
};
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "ConfigurableMapViewerCMV",
"version": "1.3.4",
"version": "1.4.0",
"author": "cmv.io - https://github.com/cmv/",
"license": "MIT",
"year": "2015",
"year": "2016",
"homepage": "http://cmv.io/",
"repository": "https://github.com/cmv/cmv-app/",
"dependencies": {
"babel-eslint": "4.1.x",
"babel-eslint": "6.0.x",
"csslint": "0.10.x",
"eslint": "1.7.3",
"eslint": "2.5.x",
"grunt": "0.4.x",
"grunt-autoprefixer": "0.7.x",
"grunt-contrib-clean": "0.5.x",
"grunt-contrib-connect": "0.7.x",
"grunt-contrib-copy": "0.5.x",
"grunt-contrib-cssmin": "0.9.x",
"grunt-contrib-csslint": "0.5.x",
"grunt-eslint": "17.3.x",
"grunt-contrib-uglify": "0.4.x",
"grunt-contrib-watch": "0.6.x",
"grunt-newer": "0.7.x",
"grunt-postcss": "0.8.x",
"grunt-contrib-clean": "1.0.x",
"grunt-contrib-connect": "1.0.x",
"grunt-contrib-copy": "1.0.x",
"grunt-contrib-csslint": "1.0.x",
"grunt-contrib-cssmin": "1.0.x",
"grunt-eslint": "18.0.x",
"grunt-contrib-uglify": "1.0.x",
"grunt-contrib-watch": "1.0.x",
"grunt-newer": "1.1.x",
"grunt-open": "0.2.x",
"grunt-contrib-compress": "0.10.x",
"grunt-contrib-compress": "1.2.x",
"proxypage": "*"
},
"engine": "node >= 0.10"
"engine": "node >= 4"
}
1 change: 0 additions & 1 deletion viewer/js/config/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
var path = location.pathname.replace(/[^\/]+$/, '');
window.dojoConfig = {
async: true,
Expand Down
1 change: 0 additions & 1 deletion viewer/js/config/basemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([
//'esri/dijit/Basemap',
//'esri/dijit/BasemapLayer'
], function (/* Basemap, BasemapLayer */) {
'use strict';

return {
map: true, // needs a reference to the map
Expand Down
2 changes: 1 addition & 1 deletion viewer/js/config/find.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint strict: 0, no-console: 0, no-alert: 0*/
/*eslint no-console: 0, no-alert: 0*/
define({
map: true,
zoomExtentFactor: 2,
Expand Down
1 change: 0 additions & 1 deletion viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ define([
'esri/tasks/GeometryService',
'esri/layers/ImageParameters'
], function (units, Extent, esriConfig, /*urlUtils,*/ GeometryService, ImageParameters) {
'use strict';

// url to your proxy page, must be on same machine hosting you app. See proxy folder for readme.
esriConfig.defaults.io.proxyUrl = 'proxy/proxy.ashx';
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Basemaps.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Bookmarks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Directions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
2 changes: 0 additions & 2 deletions viewer/js/gis/dijit/Draw.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down Expand Up @@ -216,7 +215,6 @@ define([
} else {
return false;
}
return false;

},
onLayoutChange: function (open) {
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Find.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/FloatingTitlePane.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/TitlePane',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/FloatingWidgetDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ define([
'dojo/_base/declare',
'dijit/Dialog'
], function (declare, Dialog) {
'use strict';

return declare([Dialog], {
declaredClass: 'gis.dijit.FloatingWidget',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Geocoder.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
// adapted from https://github.com/esri/arcgis-dijit-geocoder-button-js/
define([
'dojo/_base/declare',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Growler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Help.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/Identify.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
Expand Down
9 changes: 4 additions & 5 deletions viewer/js/gis/dijit/LayerControl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dojo/_base/array',
Expand Down Expand Up @@ -181,7 +180,7 @@ define([
this._vectorContainer.getChildren().filter(function (c) {
return _filterList(c);
})).concat(
this.getChildren().filter(function (c) {
this.getChildren().filter(function (c) {
return _filterList(c);
}));
// follow the same logic as when the layers were added
Expand Down Expand Up @@ -237,10 +236,10 @@ define([
_applyLayerControlOptions: function (controlOptions, layer) {
if (typeof controlOptions.includeUnspecifiedLayers === 'undefined' && typeof controlOptions.subLayerInfos === 'undefined' && typeof controlOptions.excludedLayers === 'undefined') {
return;
}
}
var esriLayerInfos = [];
// Case 1: only show the layers that are explicitly listed
if (!controlOptions.includeUnspecifiedLayers && controlOptions.subLayerInfos && controlOptions.subLayerInfos.length !== 0) {
if (!controlOptions.includeUnspecifiedLayers && controlOptions.subLayerInfos && controlOptions.subLayerInfos.length !== 0) {
var subLayerInfos = array.map(controlOptions.subLayerInfos, function (sli) {
return sli.id;
});
Expand Down Expand Up @@ -276,7 +275,7 @@ define([
}), function (l) {
return l.id;
});
layer.setVisibleLayers(visibleIds);
layer.setVisibleLayers(visibleIds);
},
_mixinLayerInfos: function (esriLayerInfos, subLayerInfos) {
// for each of the sublayers, go through the subLayerInfos from the controlOptions and see if defaultVisiblity is set to true or false
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/CSV.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var CSVControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
Expand Down
7 changes: 3 additions & 4 deletions viewer/js/gis/dijit/LayerControl/controls/Dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ define([
legendUtil,
i18n
) {
'use strict';

var DynamicControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down Expand Up @@ -100,8 +99,8 @@ define([
_createSublayers: function (layer) {
// check for single sublayer - if so no sublayer/folder controls
if (layer.layerInfos.length > 1) {
var allLayers = array.map(layer.layerInfos, function (l) {
return l.id;
var allLayers = array.map(layer.layerInfos, function (l) {
return l.id;
});
array.forEach(layer.layerInfos, lang.hitch(this, function (info) {
// see if there was any override needed from the subLayerInfos array in the controlOptions
Expand All @@ -113,7 +112,7 @@ define([
slids = info.subLayerIds,
controlId = layer.id + '-' + info.id + '-sublayer-control',
control;
// it's a top level
// it's a top level
if (pid === -1 || allLayers.indexOf(pid) === -1) {
if (slids === null) {
// it's a top level sublayer
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/Feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var FeatureControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/GeoRSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define([
_Contained,
_Control
) {
'use strict';

var GeoRSSControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var ImageControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/ImageVector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var ImageVectorControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/KML.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var KMLControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/Raster.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define([
_Contained,
_Control
) {
'use strict';

var RasterControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var StreamControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/Tiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
_Control,
legendUtil
) {
'use strict';

var TiledControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/VectorTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define([
_Contained,
_Control
) {
'use strict';

var VectorTileControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/WFS.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ define([
_Contained,
_Control
) {
'use strict';

var WFSControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/WMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define([
_Contained,
_Control
) {
'use strict';

var WMSControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/WebTiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ define([
_Contained,
_Control
) {
'use strict';

var WebTiledControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'overlay', // constant
Expand Down
1 change: 0 additions & 1 deletion viewer/js/gis/dijit/LayerControl/controls/_Control.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*eslint strict: 0*/
define([
'dojo/_base/declare',
'dojo/_base/lang',
Expand Down
Loading

0 comments on commit e854509

Please sign in to comment.