Update eslint dependency to 1.5.1, update code for new rules.

This commit is contained in:
David Anson 2015-09-26 22:22:22 -07:00
parent bf07e3b845
commit 7af794bb21
5 changed files with 46 additions and 39 deletions

View file

@ -1,35 +1,31 @@
{
"ecmaFeatures": {},
"parser": "espree",
"env": {
"browser": false,
"node": true,
"amd": false,
"mocha": false,
"jasmine": false
"node": true
},
"parser": "espree",
"ecmaFeatures": {},
"rules": {
"no-alert": 2,
"no-array-constructor": 2,
"no-bitwise": 0,
"no-caller": 2,
"no-catch-shadow": 2,
"no-comma-dangle": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-console": 2,
"no-const-assign": 2,
"no-constant-condition": 2,
"no-continue": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-div-regex": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-dupe-args": 2,
"no-duplicate-case": 2,
"no-else-return": 2,
"no-empty": 2,
"no-empty-class": 2,
"no-empty-character-class": 2,
"no-empty-label": 2,
"no-eq-null": 2,
@ -40,14 +36,15 @@
"no-extra-boolean-cast": 2,
"no-extra-parens": 0,
"no-extra-semi": 2,
"no-extra-strict": 2,
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implicit-coercion": 0,
"no-implied-eval": 2,
"no-inline-comments": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-invalid-this": 0,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
@ -55,7 +52,7 @@
"no-lone-blocks": 2,
"no-lonely-if": 2,
"no-loop-func": 2,
"no-mixed-requires": [2, true],
"no-mixed-requires": [2, false],
"no-mixed-spaces-and-tabs": [2, false],
"linebreak-style": [0, "unix"],
"no-multi-spaces": 2,
@ -80,15 +77,14 @@
"no-proto": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-reserved-keys": 2,
"no-restricted-modules": 0,
"no-restricted-modules": 2,
"no-restricted-syntax": 2,
"no-return-assign": 2,
"no-script-url": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
"no-space-before-semi": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-sync": 0,
@ -106,17 +102,21 @@
"no-unused-expressions": 2,
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
"no-use-before-define": 2,
"no-useless-call": 2,
"no-useless-concat": 2,
"no-void": 2,
"no-var": 0,
"prefer-const": 2,
"no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "anywhere" }],
"no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
"no-with": 2,
"no-wrap-func": 2,
"array-bracket-spacing": [2, "always"],
"arrow-parens": 2,
"arrow-spacing": 2,
"accessor-pairs": 2,
"block-scoped-var": 2,
"block-spacing": 2,
"brace-style": [2, "1tbs"],
"callback-return": 0,
"camelcase": 2,
"comma-dangle": [2, "never"],
"comma-spacing": 2,
@ -124,7 +124,7 @@
"complexity": [2, 11],
"computed-property-spacing": [2, "never"],
"consistent-return": 2,
"consistent-this": [2, "self"],
"consistent-this": [2, "that"],
"constructor-super": 2,
"curly": [2, "all"],
"default-case": 2,
@ -134,16 +134,18 @@
"eqeqeq": 2,
"func-names": 2,
"func-style": [2, "declaration"],
"generator-star": 2,
"generator-star-spacing": 2,
"global-strict": [2, "always"],
"global-require": 0,
"guard-for-in": 2,
"handle-callback-err": 2,
"indent": [2, 2],
"id-length": 0,
"indent": [2, 2, {"SwitchCase": 1}],
"init-declarations": 2,
"jsx-quotes": [2, "prefer-double"],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"lines-around-comment": 0,
"max-depth": [2, 4],
"max-len": [2, 80, 2],
"max-len": [2, 80, 4],
"max-nested-callbacks": [2, 3],
"max-params": [2, 5],
"max-statements": [2, 20],
@ -152,29 +154,34 @@
"newline-after-var": 0,
"object-curly-spacing": [2, "always"],
"object-shorthand": 0,
"one-var": 0,
"one-var": [2, "never"],
"operator-assignment": [2, "always"],
"operator-linebreak": 2,
"padded-blocks": [2, "never"],
"operator-linebreak": [2, "after"],
"padded-blocks": 0,
"prefer-arrow-callback": 0,
"prefer-const": 0,
"prefer-spread": 0,
"prefer-reflect": 0,
"prefer-template": 0,
"quote-props": 2,
"quotes": [2, "double"],
"radix": 2,
"id-match": 2,
"require-jsdoc": 0,
"require-yield": 2,
"semi": 2,
"semi-spacing": [2, {"before": false, "after": true}],
"sort-vars": 0,
"space-after-function-name": [2, "never"],
"space-after-keywords": [2, "always"],
"space-before-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "never"],
"space-before-function-parentheses": [2, "never"],
"space-in-brackets": [2, "always", { "propertyName": false }],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-return-throw-case": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": 0,
"spaced-line-comment": [2, "always"],
"strict": 2,
"spaced-comment": 2,
"strict": [2, "global"],
"use-isnan": 2,
"valid-jsdoc": 2,
"valid-typeof": 2,

View file

@ -29,10 +29,10 @@ rules.forEach(function forRule(rule) {
// Class for results with toString for pretty display
function Results() { }
Results.prototype.toString = function resultsToString() {
var self = this;
var that = this;
var results = [];
Object.keys(self).forEach(function forFile(file) {
var fileResults = self[file];
Object.keys(that).forEach(function forFile(file) {
var fileResults = that[file];
Object.keys(fileResults).forEach(function forRule(rule) {
var ruleResults = fileResults[rule];
ruleResults.forEach(function forLine(lineNumber) {

View file

@ -25,7 +25,7 @@
"devDependencies": {
"browserify": "^11.2.0",
"cpy": "^3.4.1",
"eslint": "^0.24.1",
"eslint": "^1.5.1",
"istanbul": "^0.3.21",
"nodeunit": "^0.9.1",
"q": "^1.4.0",

View file

@ -41,7 +41,7 @@ function createTestForFile(file) {
var results = {};
lines.forEach(function forLine(line, lineNum) {
var regex = /\{(MD\d+)(?::(\d+))?\}/g;
var match;
var match = null;
while ((match = regex.exec(line))) {
var rule = match[1];
var errors = results[rule] || [];