Update to latest eslint
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
"no-dupe-keys": 2,
|
||||
"no-duplicate-case": 2,
|
||||
"no-empty": 2,
|
||||
"no-empty-class": 2,
|
||||
"no-empty-character-class": 2,
|
||||
"no-ex-assign": 2,
|
||||
"no-extra-boolean-cast": 2,
|
||||
"no-extra-parens": 0,
|
||||
@@ -55,7 +55,7 @@
|
||||
"no-negated-in-lhs": 2,
|
||||
"no-obj-calls": 2,
|
||||
"no-regex-spaces": 2,
|
||||
"no-reserved-keys": 2, // Important for IE
|
||||
"quote-props": [2, "as-needed", {"keywords": true}],
|
||||
"no-sparse-arrays": 0,
|
||||
|
||||
// Optimizer and coverage will handle/highlight this and can be useful for debugging
|
||||
@@ -175,7 +175,7 @@
|
||||
"no-ternary": 0,
|
||||
"no-trailing-spaces": 2,
|
||||
"no-underscore-dangle": 0,
|
||||
"no-wrap-func": 2,
|
||||
"no-extra-parens": [2, "functions"],
|
||||
"one-var": 0,
|
||||
"operator-assignment": 0,
|
||||
"padded-blocks": 0,
|
||||
@@ -192,7 +192,7 @@
|
||||
"space-infix-ops": 2,
|
||||
"space-return-throw-case": 2,
|
||||
"space-unary-ops": 2,
|
||||
"spaced-line-comment": 2,
|
||||
"spaced-comment": [2, "always", {"markers": [","]}],
|
||||
"wrap-regex": 1,
|
||||
|
||||
"no-var": 1
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*eslint-disable no-process-env */
|
||||
/* eslint-disable no-process-env */
|
||||
module.exports = function(grunt) {
|
||||
|
||||
grunt.initConfig({
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
var _ = require('underscore'),
|
||||
runner = require('./util/template-runner'),
|
||||
|
||||
eco, dust, Handlebars, Mustache, eco;
|
||||
eco, dust, Handlebars, Mustache;
|
||||
|
||||
try {
|
||||
dust = require('dustjs-linkedin');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*global define */
|
||||
/* global define */
|
||||
import {isArray} from '../utils';
|
||||
|
||||
let SourceNode;
|
||||
|
||||
@@ -471,7 +471,7 @@ JavaScriptCompiler.prototype = {
|
||||
|
||||
let len = parts.length;
|
||||
for (; i < len; i++) {
|
||||
/*eslint-disable no-loop-func */
|
||||
/* eslint-disable no-loop-func */
|
||||
this.replaceStack((current) => {
|
||||
let lookup = this.nameLookup(current, parts[i], type);
|
||||
// We want to ensure that zero and false are handled properly if the context (falsy flag)
|
||||
@@ -483,7 +483,7 @@ JavaScriptCompiler.prototype = {
|
||||
return [' && ', lookup];
|
||||
}
|
||||
});
|
||||
/*eslint-enable no-loop-func */
|
||||
/* eslint-enable no-loop-func */
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*eslint-disable new-cap */
|
||||
/* eslint-disable new-cap */
|
||||
import Visitor from './visitor';
|
||||
|
||||
export function print(ast) {
|
||||
@@ -168,4 +168,4 @@ PrintVisitor.prototype.Hash = function(hash) {
|
||||
PrintVisitor.prototype.HashPair = function(pair) {
|
||||
return pair.key + '=' + this.accept(pair.value);
|
||||
};
|
||||
/*eslint-enable new-cap */
|
||||
/* eslint-enable new-cap */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*global window */
|
||||
/* global window */
|
||||
export default function(Handlebars) {
|
||||
/* istanbul ignore next */
|
||||
let root = typeof global !== 'undefined' ? global : window,
|
||||
|
||||
@@ -31,7 +31,7 @@ export let toString = Object.prototype.toString;
|
||||
|
||||
// Sourced from lodash
|
||||
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
|
||||
/*eslint-disable func-style */
|
||||
/* eslint-disable func-style */
|
||||
let isFunction = function(value) {
|
||||
return typeof value === 'function';
|
||||
};
|
||||
@@ -43,7 +43,7 @@ if (isFunction(/x/)) {
|
||||
};
|
||||
}
|
||||
export {isFunction};
|
||||
/*eslint-enable func-style */
|
||||
/* eslint-enable func-style */
|
||||
|
||||
/* istanbul ignore next */
|
||||
export const isArray = Array.isArray || function(value) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*eslint-disable no-console */
|
||||
/* eslint-disable no-console */
|
||||
import Async from 'async';
|
||||
import fs from 'fs';
|
||||
import * as Handlebars from './handlebars';
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
"grunt-contrib-requirejs": "0.x",
|
||||
"grunt-contrib-uglify": "0.x",
|
||||
"grunt-contrib-watch": "0.x",
|
||||
"grunt-eslint": "^11.0.0",
|
||||
"grunt-eslint": "^17.1.0",
|
||||
"grunt-saucelabs": "8.x",
|
||||
"grunt-webpack": "^1.0.8",
|
||||
"istanbul": "^0.3.0",
|
||||
|
||||
+2
-2
@@ -61,14 +61,14 @@ describe('basic context', function() {
|
||||
shouldCompileTo('num: {{num1/num2}}', {num1: {num2: 0}}, 'num: 0');
|
||||
});
|
||||
it('false', function() {
|
||||
/*eslint-disable no-new-wrappers */
|
||||
/* eslint-disable no-new-wrappers */
|
||||
shouldCompileTo('val1: {{val1}}, val2: {{val2}}', {val1: false, val2: new Boolean(false)}, 'val1: false, val2: false');
|
||||
shouldCompileTo('val: {{.}}', false, 'val: false');
|
||||
shouldCompileTo('val: {{val1/val2}}', {val1: {val2: false}}, 'val: false');
|
||||
|
||||
shouldCompileTo('val1: {{{val1}}}, val2: {{{val2}}}', {val1: false, val2: new Boolean(false)}, 'val1: false, val2: false');
|
||||
shouldCompileTo('val: {{{val1/val2}}}', {val1: {val2: false}}, 'val: false');
|
||||
/*eslint-enable */
|
||||
/* eslint-enable */
|
||||
});
|
||||
|
||||
it('should handle undefined and null', function() {
|
||||
|
||||
+2
-2
@@ -257,7 +257,7 @@ describe('builtin helpers', function() {
|
||||
});
|
||||
|
||||
describe('#log', function() {
|
||||
/*eslint-disable no-console */
|
||||
/* eslint-disable no-console */
|
||||
if (typeof console === 'undefined') {
|
||||
return;
|
||||
}
|
||||
@@ -408,7 +408,7 @@ describe('builtin helpers', function() {
|
||||
shouldCompileTo(string, hash, '');
|
||||
equals(true, called);
|
||||
});
|
||||
/*eslint-enable no-console */
|
||||
/* eslint-enable no-console */
|
||||
});
|
||||
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -19,12 +19,12 @@ global.CompilerContext = {
|
||||
};
|
||||
|
||||
function safeEval(templateSpec) {
|
||||
/*eslint-disable no-eval, no-console */
|
||||
/* eslint-disable no-eval, no-console */
|
||||
try {
|
||||
return eval('(' + templateSpec + ')');
|
||||
} catch (err) {
|
||||
console.error(templateSpec);
|
||||
throw err;
|
||||
}
|
||||
/*eslint-enable no-eval, no-console */
|
||||
/* eslint-enable no-eval, no-console */
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -13,12 +13,12 @@ global.CompilerContext = {
|
||||
};
|
||||
|
||||
function safeEval(templateSpec) {
|
||||
/*eslint-disable no-eval, no-console */
|
||||
/* eslint-disable no-eval, no-console */
|
||||
try {
|
||||
return eval('(' + templateSpec + ')');
|
||||
} catch (err) {
|
||||
console.error(templateSpec);
|
||||
throw err;
|
||||
}
|
||||
/*eslint-enable no-eval, no-console */
|
||||
/* eslint-enable no-eval, no-console */
|
||||
}
|
||||
|
||||
Vendored
+3
-5
@@ -1,4 +1,4 @@
|
||||
/*eslint-disable no-console */
|
||||
/* eslint-disable no-console */
|
||||
var fs = require('fs'),
|
||||
Mocha = require('mocha'),
|
||||
path = require('path');
|
||||
@@ -7,8 +7,6 @@ var errors = 0,
|
||||
testDir = path.dirname(__dirname),
|
||||
grep = process.argv[2];
|
||||
|
||||
var files = [ testDir + '/basic.js' ];
|
||||
|
||||
var files = fs.readdirSync(testDir)
|
||||
.filter(function(name) { return (/.*\.js$/).test(name); })
|
||||
.map(function(name) { return testDir + '/' + name; });
|
||||
@@ -16,9 +14,9 @@ var files = fs.readdirSync(testDir)
|
||||
run('./runtime', function() {
|
||||
run('./browser', function() {
|
||||
run('./node', function() {
|
||||
/*eslint-disable no-process-exit */
|
||||
/* eslint-disable no-process-exit */
|
||||
process.exit(errors);
|
||||
/*eslint-enable no-process-exit */
|
||||
/* eslint-enable no-process-exit */
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Vendored
+2
-2
@@ -39,12 +39,12 @@ global.CompilerContext = {
|
||||
};
|
||||
|
||||
function safeEval(templateSpec) {
|
||||
/*eslint-disable no-eval, no-console */
|
||||
/* eslint-disable no-eval, no-console */
|
||||
try {
|
||||
return eval('(' + templateSpec + ')');
|
||||
} catch (err) {
|
||||
console.error(templateSpec);
|
||||
throw err;
|
||||
}
|
||||
/*eslint-enable no-eval, no-console */
|
||||
/* eslint-enable no-eval, no-console */
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ describe('javascript-compiler api', function() {
|
||||
handlebarsEnv.JavaScriptCompiler.prototype.nameLookup = function(parent, name) {
|
||||
return parent + '.bar_' + name;
|
||||
};
|
||||
/*eslint-disable camelcase */
|
||||
/* eslint-disable camelcase */
|
||||
shouldCompileTo('{{foo}}', { bar_foo: 'food' }, 'food');
|
||||
/*eslint-enable camelcase */
|
||||
/* eslint-enable camelcase */
|
||||
});
|
||||
|
||||
// Tests nameLookup dot vs. bracket behavior. Bracket is required in certain cases
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/*eslint-disable no-console */
|
||||
/* eslint-disable no-console */
|
||||
describe('precompiler', function() {
|
||||
// NOP Under non-node environments
|
||||
if (typeof process === 'undefined') {
|
||||
|
||||
+2
-2
@@ -103,13 +103,13 @@ describe('Regressions', function() {
|
||||
});
|
||||
|
||||
it('GH-534: Object prototype aliases', function() {
|
||||
/*eslint-disable no-extend-native */
|
||||
/* eslint-disable no-extend-native */
|
||||
Object.prototype[0xD834] = true;
|
||||
|
||||
shouldCompileTo('{{foo}}', { foo: 'bar' }, 'bar');
|
||||
|
||||
delete Object.prototype[0xD834];
|
||||
/*eslint-enable no-extend-native */
|
||||
/* eslint-enable no-extend-native */
|
||||
});
|
||||
|
||||
it('GH-437: Matching escaping', function() {
|
||||
|
||||
+2
-2
@@ -34,9 +34,9 @@ describe('spec', function() {
|
||||
var data = _.clone(test.data);
|
||||
if (data.lambda) {
|
||||
// Blergh
|
||||
/*eslint-disable no-eval */
|
||||
/* eslint-disable no-eval */
|
||||
data.lambda = eval('(' + data.lambda.js + ')');
|
||||
/*eslint-enable no-eval */
|
||||
/* eslint-enable no-eval */
|
||||
}
|
||||
it(name + ' - ' + test.name, function() {
|
||||
if (test.partials) {
|
||||
|
||||
Reference in New Issue
Block a user