Skip to content

Commit

Permalink
Specify environments for non-Solidus global JS variables
Browse files Browse the repository at this point in the history
We can specify ESLint environments to pre-define global JS variables not
defined by Solidus; this way we can whitelist several vars found within
the project's codebase without the need to specify them one by one

See https://eslint.org/docs/user-guide/configuring#specifying-environments
for details
  • Loading branch information
aitbw committed Jun 5, 2019
1 parent b6f84f4 commit cd7e843
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"extends": "airbnb-base",
"env": {
"browser": true,
"jquery": true
},
"rules": {
"camelcase": 0,
"comma-dangle": 0,
Expand Down Expand Up @@ -29,11 +33,9 @@
"vars-on-top": 0
},
"globals": {
"$": "readonly",
"accounting": "readonly",
"addVariantFromStockLocation": "writable",
"adjustShipmentItems": "writable",
"document": "readonly",
"error": "writable",
"flatpickr": "readonly",
"Handlebars": "readonly",
Expand All @@ -42,7 +44,6 @@
"shipments": "writable",
"Sortable": "readonly",
"Spree": "readonly",
"Turbolinks": "readonly",
"window": "readonly"
"Turbolinks": "readonly"
}
}

0 comments on commit cd7e843

Please sign in to comment.