Skip to content

Commit 6cfbc26

Browse files
committed
Use eslint-env "shared-node-browser" for shared handlebars code
1 parent b65135a commit 6cfbc26

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

lib/.eslintrc.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
22
env: {
3-
// Handlebars should run natively in the browser
4-
node: false
3+
// Handlebars not use node or browser-specific apis
4+
'shared-node-browser': true,
5+
node: false,
6+
browser: false
57
}
68
};

lib/handlebars/compiler/code-gen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global define */
1+
/* global define, require */
22
import { isArray } from '../utils';
33

44
let SourceNode;
@@ -8,7 +8,7 @@ try {
88
if (typeof define !== 'function' || !define.amd) {
99
// We don't support this in AMD environments. For these environments, we assume that
1010
// they are running on the browser and thus have no need for the source-map library.
11-
let SourceMap = require('source-map'); // eslint-disable-line no-undef
11+
let SourceMap = require('source-map');
1212
SourceNode = SourceMap.SourceNode;
1313
}
1414
} catch (err) {

lib/handlebars/no-conflict.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
/* global global, window */
12
export default function(Handlebars) {
23
/* istanbul ignore next */
3-
let root = typeof global !== 'undefined' ? global : window, // eslint-disable-line no-undef
4+
let root = typeof global !== 'undefined' ? global : window,
45
$Handlebars = root.Handlebars;
56
/* istanbul ignore next */
67
Handlebars.noConflict = function() {

0 commit comments

Comments
 (0)