diff options
author | kpdecker <kpdecker@gmail.com> | 2015-09-01 17:56:32 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-09-01 17:56:32 -0500 |
commit | 0aef72cb8ee694911952d5447b08349a952aee90 (patch) | |
tree | f0c13a154a822519ba2b689ba8edd480953d4f3b | |
parent | bff5fab8f9d42e21950be00dcf1cedf4dc1a565b (diff) | |
download | handlebars.js-0aef72cb8ee694911952d5447b08349a952aee90.zip handlebars.js-0aef72cb8ee694911952d5447b08349a952aee90.tar.gz handlebars.js-0aef72cb8ee694911952d5447b08349a952aee90.tar.bz2 |
Update to latest eslint
-rw-r--r-- | .eslintrc | 8 | ||||
-rw-r--r-- | Gruntfile.js | 2 | ||||
-rw-r--r-- | bench/throughput.js | 2 | ||||
-rw-r--r-- | lib/handlebars/compiler/code-gen.js | 2 | ||||
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 4 | ||||
-rw-r--r-- | lib/handlebars/compiler/printer.js | 4 | ||||
-rw-r--r-- | lib/handlebars/no-conflict.js | 2 | ||||
-rw-r--r-- | lib/handlebars/utils.js | 4 | ||||
-rw-r--r-- | lib/precompiler.js | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | spec/basic.js | 4 | ||||
-rw-r--r-- | spec/builtins.js | 4 | ||||
-rw-r--r-- | spec/env/browser.js | 4 | ||||
-rw-r--r-- | spec/env/node.js | 4 | ||||
-rw-r--r-- | spec/env/runner.js | 8 | ||||
-rw-r--r-- | spec/env/runtime.js | 4 | ||||
-rw-r--r-- | spec/javascript-compiler.js | 4 | ||||
-rw-r--r-- | spec/precompiler.js | 2 | ||||
-rw-r--r-- | spec/regressions.js | 4 | ||||
-rw-r--r-- | spec/spec.js | 4 |
20 files changed, 36 insertions, 38 deletions
@@ -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 diff --git a/Gruntfile.js b/Gruntfile.js index 2850a90..3bb1c16 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,4 @@ -/*eslint-disable no-process-env */ +/* eslint-disable no-process-env */ module.exports = function(grunt) { grunt.initConfig({ diff --git a/bench/throughput.js b/bench/throughput.js index 9f1f798..e8ea5d9 100644 --- a/bench/throughput.js +++ b/bench/throughput.js @@ -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'); diff --git a/lib/handlebars/compiler/code-gen.js b/lib/handlebars/compiler/code-gen.js index 6541fe8..5ec052f 100644 --- a/lib/handlebars/compiler/code-gen.js +++ b/lib/handlebars/compiler/code-gen.js @@ -1,4 +1,4 @@ -/*global define */ +/* global define */ import {isArray} from '../utils'; let SourceNode; diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index ede0b5e..ff583c7 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -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 */ } }, diff --git a/lib/handlebars/compiler/printer.js b/lib/handlebars/compiler/printer.js index 66e7c7d..6ad43ba 100644 --- a/lib/handlebars/compiler/printer.js +++ b/lib/handlebars/compiler/printer.js @@ -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 */ diff --git a/lib/handlebars/no-conflict.js b/lib/handlebars/no-conflict.js index a421f57..ad41e96 100644 --- a/lib/handlebars/no-conflict.js +++ b/lib/handlebars/no-conflict.js @@ -1,4 +1,4 @@ -/*global window */ +/* global window */ export default function(Handlebars) { /* istanbul ignore next */ let root = typeof global !== 'undefined' ? global : window, diff --git a/lib/handlebars/utils.js b/lib/handlebars/utils.js index d34646b..1cf7e32 100644 --- a/lib/handlebars/utils.js +++ b/lib/handlebars/utils.js @@ -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) { diff --git a/lib/precompiler.js b/lib/precompiler.js index 9f23ef6..a20d141 100644 --- a/lib/precompiler.js +++ b/lib/precompiler.js @@ -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'; diff --git a/package.json b/package.json index 814e527..2fc5e12 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/spec/basic.js b/spec/basic.js index 8859545..e4b2536 100644 --- a/spec/basic.js +++ b/spec/basic.js @@ -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() { diff --git a/spec/builtins.js b/spec/builtins.js index f06a1ad..dc1df0a 100644 --- a/spec/builtins.js +++ b/spec/builtins.js @@ -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 */ }); diff --git a/spec/env/browser.js b/spec/env/browser.js index c9414d4..8049dda 100644 --- a/spec/env/browser.js +++ b/spec/env/browser.js @@ -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 */ } diff --git a/spec/env/node.js b/spec/env/node.js index 62d9fe9..881609d 100644 --- a/spec/env/node.js +++ b/spec/env/node.js @@ -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 */ } diff --git a/spec/env/runner.js b/spec/env/runner.js index 98d2482..4ff1e7e 100644 --- a/spec/env/runner.js +++ b/spec/env/runner.js @@ -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 */ }); }); }); diff --git a/spec/env/runtime.js b/spec/env/runtime.js index a7b42f5..9d1c049 100644 --- a/spec/env/runtime.js +++ b/spec/env/runtime.js @@ -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 */ } diff --git a/spec/javascript-compiler.js b/spec/javascript-compiler.js index 28e6988..5a10388 100644 --- a/spec/javascript-compiler.js +++ b/spec/javascript-compiler.js @@ -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 diff --git a/spec/precompiler.js b/spec/precompiler.js index e1ad5ad..f9759a9 100644 --- a/spec/precompiler.js +++ b/spec/precompiler.js @@ -1,4 +1,4 @@ -/*eslint-disable no-console */ +/* eslint-disable no-console */ describe('precompiler', function() { // NOP Under non-node environments if (typeof process === 'undefined') { diff --git a/spec/regressions.js b/spec/regressions.js index e8942a4..825ee35 100644 --- a/spec/regressions.js +++ b/spec/regressions.js @@ -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() { diff --git a/spec/spec.js b/spec/spec.js index ae1ec38..221d32e 100644 --- a/spec/spec.js +++ b/spec/spec.js @@ -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) { |