Skip to content

Commit

Permalink
allow console.warn/error, rm globals
Browse files Browse the repository at this point in the history
  • Loading branch information
trafficonese committed Mar 16, 2024
1 parent 57f1521 commit ee7a52e
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 24 deletions.
19 changes: 8 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
module.exports = {
"parserOptions": {
parserOptions: {
"ecmaVersion": 6
},
"extends": "eslint:recommended",
"rules": {
env: {
browser: true,
node: true,
},
extends: "eslint:recommended",
rules: {
"indent": [
"error",
2
Expand All @@ -21,14 +25,7 @@ module.exports = {
"error",
{"args": "none"}
],
"no-console": "off",
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.name='console'][callee.property.name!=/^(log|warn|error|info|trace)$/]",
"message": "Unexpected property on console object was called"
}
],
"no-console": ["error", { allow: ["warn", "error"] }],
"no-var": "off", // Allow var declarations
"prefer-const": "error", // Enforce the use of const where possible
"no-assign-const": "off"
Expand Down
2 changes: 1 addition & 1 deletion inst/htmlwidgets/bindings/lfx-omnivore-bindings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global LeafletWidget, $, L, DOMParser, topojson, csv2geojson, toGeoJSON */
/* global LeafletWidget, $, L, topojson, csv2geojson, toGeoJSON */

// parse an XML
LeafletWidget.utils.parseXML = function(str) {
Expand Down
8 changes: 1 addition & 7 deletions inst/htmlwidgets/bindings/lfx-search-bindings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global $, LeafletWidget, L, Shiny, HTMLWidgets, google, document */
/* global $, LeafletWidget, L, Shiny, HTMLWidgets, google */

// helper function to conver JS event to Shiny Event
function eventToShiny(e) {
Expand Down Expand Up @@ -402,16 +402,12 @@ LeafletWidget.methods.addReverseSearchGoogle = function(options, group) {
} else {
if(!$.isEmptyObject(displayControl))
displayControl.innerHTML = 'No Results Found';
/* eslint-disable no-console */
console.error('No Results Found');
/* eslint-enable no-console */
}
} else {
if(!$.isEmptyObject(displayControl))
displayControl.innerHTML = 'Reverse Geocoding failed due to: ' + status;
/* eslint-disable no-console */
console.error('Reverse Geocoing failed due to: ' + status);
/* eslint-enable no-console */
}
}
);
Expand Down Expand Up @@ -534,9 +530,7 @@ LeafletWidget.methods.addSearchFeatures = function(targetGroups, options){
if(target) {
searchFeatureGroup.addLayer(target);
} else {
/* eslint-disable no-console */
console.warn('Group with ID "' + v + '" not Found, skipping');
/* eslint-enable no-console */
}
});
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ee7a52e

Please sign in to comment.