diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-19 00:05:53 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-19 00:05:53 +0300 |
commit | a7eb806e93e44a35b6853491820d24b60c25bb1c (patch) | |
tree | fe2959ef5bfa6d3efbfcd97e98cd97131f376abf | |
parent | 3695c6bc6d95e650600441ccfa382c682ace5558 (diff) |
add global __webpack_public_path__ to eslint config
-rw-r--r-- | .eslintrc | 1 | ||||
-rw-r--r-- | app/assets/javascripts/repo/monaco_loader.js | 6 | ||||
-rw-r--r-- | app/assets/javascripts/webpack.js | 2 | ||||
-rw-r--r-- | spec/javascripts/repo/monaco_loader_spec.js | 2 |
4 files changed, 4 insertions, 7 deletions
diff --git a/.eslintrc b/.eslintrc index 3e07edbccfe..44ad6a4896c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,6 +6,7 @@ }, "extends": "airbnb-base", "globals": { + "__webpack_public_path__": true, "_": false, "gl": false, "gon": false, diff --git a/app/assets/javascripts/repo/monaco_loader.js b/app/assets/javascripts/repo/monaco_loader.js index ad1370a7730..af83a1ec0b4 100644 --- a/app/assets/javascripts/repo/monaco_loader.js +++ b/app/assets/javascripts/repo/monaco_loader.js @@ -1,13 +1,11 @@ -/* eslint-disable no-underscore-dangle, camelcase */ -/* global __webpack_public_path__ */ - import monacoContext from 'monaco-editor/dev/vs/loader'; monacoContext.require.config({ paths: { - vs: `${__webpack_public_path__}monaco-editor/vs`, + vs: `${__webpack_public_path__}monaco-editor/vs`, // eslint-disable-line camelcase }, }); +// eslint-disable-next-line no-underscore-dangle window.__monaco_context__ = monacoContext; export default monacoContext.require; diff --git a/app/assets/javascripts/webpack.js b/app/assets/javascripts/webpack.js index 9a9cf395fb8..ced847294ae 100644 --- a/app/assets/javascripts/webpack.js +++ b/app/assets/javascripts/webpack.js @@ -5,5 +5,5 @@ */ if (gon && gon.webpack_public_path) { - __webpack_public_path__ = gon.webpack_public_path; // eslint-disable-line + __webpack_public_path__ = gon.webpack_public_path; // eslint-disable-line camelcase } diff --git a/spec/javascripts/repo/monaco_loader_spec.js b/spec/javascripts/repo/monaco_loader_spec.js index 1c6d70f9271..887a80160fc 100644 --- a/spec/javascripts/repo/monaco_loader_spec.js +++ b/spec/javascripts/repo/monaco_loader_spec.js @@ -1,5 +1,3 @@ -/* global __webpack_public_path__ */ - import monacoContext from 'monaco-editor/dev/vs/loader'; import monacoLoader from '~/repo/monaco_loader'; |