Use eslint-env "shared-node-browser" for shared handlebars code

This commit is contained in:
Nils Knappmeier
2022-01-07 18:15:48 +01:00
parent b65135acef
commit 6cfbc2653a
3 changed files with 8 additions and 5 deletions
+4 -2
View File
@@ -1,6 +1,8 @@
module.exports = {
env: {
// Handlebars should run natively in the browser
node: false
// Handlebars not use node or browser-specific apis
'shared-node-browser': true,
node: false,
browser: false
}
};
+2 -2
View File
@@ -1,4 +1,4 @@
/* global define */
/* global define, require */
import { isArray } from '../utils';
let SourceNode;
@@ -8,7 +8,7 @@ try {
if (typeof define !== 'function' || !define.amd) {
// We don't support this in AMD environments. For these environments, we assume that
// they are running on the browser and thus have no need for the source-map library.
let SourceMap = require('source-map'); // eslint-disable-line no-undef
let SourceMap = require('source-map');
SourceNode = SourceMap.SourceNode;
}
} catch (err) {
+2 -1
View File
@@ -1,6 +1,7 @@
/* global global, window */
export default function(Handlebars) {
/* istanbul ignore next */
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
let root = typeof global !== 'undefined' ? global : window,
$Handlebars = root.Handlebars;
/* istanbul ignore next */
Handlebars.noConflict = function() {