Update eslint configuration to latest format/rules.

This commit is contained in:
David Anson 2016-07-05 00:06:48 -07:00
parent b17dcb2ed9
commit c668c7c6a9
3 changed files with 224 additions and 208 deletions

View file

@ -1,212 +1,228 @@
{ {
"parser": "espree",
"ecmaFeatures": {},
"env": { "env": {
"node": true "node": true
}, },
"rules": { "rules": {
"no-alert": 2, "no-alert": "error",
"no-array-constructor": 2, "no-array-constructor": "error",
"no-bitwise": 0, "no-bitwise": "off",
"no-caller": 2, "no-caller": "error",
"no-case-declarations": 2, "no-case-declarations": "error",
"no-catch-shadow": 2, "no-catch-shadow": "error",
"no-class-assign": 2, "no-class-assign": "error",
"no-cond-assign": 2, "no-cond-assign": "error",
"no-confusing-arrow": 2, "no-confusing-arrow": "error",
"no-console": 2, "no-console": "error",
"no-const-assign": 2, "no-const-assign": "error",
"no-constant-condition": 2, "no-constant-condition": "error",
"no-continue": 2, "no-continue": "error",
"no-control-regex": 2, "no-control-regex": "error",
"no-debugger": 2, "no-debugger": "error",
"no-delete-var": 2, "no-delete-var": "error",
"no-div-regex": 2, "no-div-regex": "error",
"no-dupe-class-members": 2, "no-dupe-args": "error",
"no-dupe-keys": 2, "no-dupe-class-members": "error",
"no-dupe-args": 2, "no-dupe-keys": "error",
"no-duplicate-case": 2, "no-duplicate-case": "error",
"no-else-return": 2, "no-duplicate-imports": "error",
"no-empty": 2, "no-else-return": "error",
"no-empty-character-class": 2, "no-empty": "error",
"no-empty-function": 0, "no-empty-character-class": "error",
"no-empty-pattern": 2, "no-empty-function": "off",
"no-eq-null": 2, "no-empty-pattern": "error",
"no-eval": 2, "no-eq-null": "error",
"no-ex-assign": 2, "no-eval": "error",
"no-extend-native": 2, "no-ex-assign": "error",
"no-extra-bind": 2, "no-extend-native": "error",
"no-extra-boolean-cast": 2, "no-extra-bind": "error",
"no-extra-label": 2, "no-extra-boolean-cast": "error",
"no-extra-parens": 0, "no-extra-label": "error",
"no-extra-semi": 2, "no-extra-parens": "off",
"no-fallthrough": 2, "no-extra-semi": "error",
"no-floating-decimal": 2, "no-fallthrough": "error",
"no-func-assign": 2, "no-floating-decimal": "error",
"no-implicit-coercion": [2, {"boolean": false, "number": true, "string": true}], "no-func-assign": "error",
"no-implicit-globals": 2, "no-implicit-coercion": "off",
"no-implied-eval": 2, "no-implicit-globals": "error",
"no-inline-comments": 0, "no-implied-eval": "error",
"no-inner-declarations": [2, "functions"], "no-inline-comments": "error",
"no-invalid-regexp": 2, "no-inner-declarations": "error",
"no-invalid-this": 0, "no-invalid-regexp": "error",
"no-irregular-whitespace": 2, "no-invalid-this": "off",
"no-iterator": 2, "no-irregular-whitespace": "error",
"no-label-var": 2, "no-iterator": "error",
"no-labels": 2, "no-label-var": "error",
"no-lone-blocks": 2, "no-labels": "error",
"no-lonely-if": 2, "no-lone-blocks": "error",
"no-loop-func": 2, "no-lonely-if": "error",
"no-mixed-requires": [2, false], "no-loop-func": "error",
"no-mixed-spaces-and-tabs": [2, false], "no-magic-numbers": "off",
"linebreak-style": [0, "unix"], "no-mixed-operators": "error",
"no-multi-spaces": 2, "no-mixed-requires": "error",
"no-multi-str": 2, "no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": [2, {"max": 2}], "no-multi-spaces": "error",
"no-native-reassign": 2, "no-multi-str": "error",
"no-negated-condition": 0, "no-multiple-empty-lines": "error",
"no-negated-in-lhs": 2, "no-native-reassign": "error",
"no-nested-ternary": 0, "no-negated-condition": "error",
"no-new": 2, "no-negated-in-lhs": "error",
"no-new-func": 2, "no-nested-ternary": "off",
"no-new-object": 2, "no-new": "error",
"no-new-require": 2, "no-new-func": "error",
"no-new-symbol": 2, "no-new-object": "error",
"no-new-wrappers": 2, "no-new-require": "error",
"no-obj-calls": 2, "no-new-symbol": "error",
"no-octal": 2, "no-new-wrappers": "error",
"no-octal-escape": 2, "no-obj-calls": "error",
"no-param-reassign": 0, "no-octal": "error",
"no-path-concat": 2, "no-octal-escape": "error",
"no-plusplus": 0, "no-param-reassign": "off",
"no-process-env": 2, "no-path-concat": "error",
"no-process-exit": 2, "no-plusplus": "off",
"no-proto": 2, "no-process-env": "error",
"no-redeclare": 2, "no-process-exit": "error",
"no-regex-spaces": 2, "no-proto": "error",
"no-restricted-imports": 2, "no-prototype-builtins": "error",
"no-restricted-modules": 2, "no-redeclare": "error",
"no-restricted-syntax": 2, "no-regex-spaces": "error",
"no-return-assign": 2, "no-restricted-globals": "error",
"no-script-url": 2, "no-restricted-imports": "error",
"no-self-assign": 2, "no-restricted-modules": "error",
"no-self-compare": 2, "no-restricted-syntax": "error",
"no-sequences": 2, "no-return-assign": "error",
"no-shadow": 2, "no-script-url": "error",
"no-shadow-restricted-names": 2, "no-self-assign": "error",
"no-whitespace-before-property": 2, "no-self-compare": "error",
"no-spaced-func": 2, "no-sequences": "error",
"no-sparse-arrays": 2, "no-shadow": "error",
"no-sync": 0, "no-shadow-restricted-names": "error",
"no-ternary": 0, "no-whitespace-before-property": "error",
"no-trailing-spaces": 2, "no-spaced-func": "error",
"no-this-before-super": 2, "no-sparse-arrays": "error",
"no-throw-literal": 2, "no-sync": "off",
"no-undef": 2, "no-ternary": "off",
"no-undef-init": 2, "no-trailing-spaces": "error",
"no-undefined": 0, "no-this-before-super": "error",
"no-unexpected-multiline": 2, "no-throw-literal": "error",
"no-underscore-dangle": 2, "no-undef": "error",
"no-unmodified-loop-condition": 2, "no-undef-init": "error",
"no-unneeded-ternary": 2, "no-undefined": "off",
"no-unreachable": 2, "no-unexpected-multiline": "error",
"no-unused-expressions": 2, "no-underscore-dangle": "error",
"no-unused-labels": 2, "no-unmodified-loop-condition": "error",
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}], "no-unneeded-ternary": "error",
"no-use-before-define": 2, "no-unreachable": "error",
"no-useless-call": 2, "no-unsafe-finally": "error",
"no-useless-concat": 2, "no-unused-expressions": "error",
"no-useless-constructor": 2, "no-unused-labels": "error",
"no-void": 2, "no-unused-vars": "error",
"no-var": 0, "no-use-before-define": "error",
"no-warning-comments": [2, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], "no-useless-call": "error",
"no-with": 2, "no-useless-computed-key": "error",
"no-magic-numbers": 0, "no-useless-concat": "error",
"no-useless-constructor": "error",
"array-bracket-spacing": [2, "always"], "no-useless-escape": "error",
"array-callback-return": 2, "no-useless-rename": "error",
"arrow-body-style": [2, "as-needed"], "no-void": "error",
"arrow-parens": 2, "no-var": "off",
"arrow-spacing": 2, "no-warning-comments": "error",
"accessor-pairs": 2, "no-with": "error",
"block-scoped-var": 2, "array-bracket-spacing": ["error", "always"],
"block-spacing": 2, "array-callback-return": "error",
"brace-style": [2, "1tbs"], "arrow-body-style": "error",
"callback-return": 0, "arrow-parens": "error",
"camelcase": 2, "arrow-spacing": "error",
"comma-dangle": [2, "never"], "accessor-pairs": "error",
"comma-spacing": 2, "block-scoped-var": "error",
"comma-style": 2, "block-spacing": "error",
"complexity": [2, 11], "brace-style": "error",
"computed-property-spacing": [2, "never"], "callback-return": "off",
"consistent-return": 0, "camelcase": "error",
"consistent-this": [2, "that"], "comma-dangle": "error",
"constructor-super": 2, "comma-spacing": "error",
"curly": [2, "all"], "comma-style": "error",
"default-case": 2, "complexity": "error",
"dot-location": [2, "property"], "computed-property-spacing": "error",
"dot-notation": [2, { "allowKeywords": true }], "consistent-return": "off",
"eol-last": 2, "consistent-this": "error",
"eqeqeq": 2, "constructor-super": "error",
"func-names": 2, "curly": "error",
"func-style": [2, "declaration"], "default-case": "error",
"generator-star-spacing": 2, "dot-location": ["error", "property"],
"global-require": 0, "dot-notation": "error",
"guard-for-in": 2, "eol-last": "error",
"handle-callback-err": 2, "eqeqeq": "error",
"id-length": 0, "func-names": "error",
"indent": [2, 2, {"SwitchCase": 1}], "func-style": ["error", "declaration"],
"init-declarations": 2, "generator-star-spacing": "error",
"jsx-quotes": [2, "prefer-double"], "global-require": "off",
"key-spacing": [2, { "beforeColon": false, "afterColon": true }], "guard-for-in": "error",
"keyword-spacing": 2, "handle-callback-err": "error",
"lines-around-comment": 0, "id-blacklist": "error",
"max-depth": [2, 4], "id-length": "off",
"max-len": [2, 80, 4], "id-match": "error",
"max-nested-callbacks": [2, 3], "indent": ["error", 2, { "SwitchCase": 1 }],
"max-params": [2, 5], "init-declarations": "error",
"max-statements": [2, 21], "jsx-quotes": "error",
"new-cap": 2, "key-spacing": "error",
"new-parens": 2, "keyword-spacing": "error",
"newline-after-var": 0, "linebreak-style": "off",
"newline-per-chained-call": 0, "lines-around-comment": "off",
"object-curly-spacing": [2, "always"], "max-depth": "error",
"object-shorthand": 0, "max-len": "error",
"one-var": [2, "never"], "max-lines": "off",
"one-var-declaration-per-line": 2, "max-nested-callbacks": "error",
"operator-assignment": [2, "always"], "max-params": ["error", 5],
"operator-linebreak": [2, "after"], "max-statements": ["error", 21],
"padded-blocks": 0, "max-statements-per-line": "error",
"prefer-arrow-callback": 0, "new-cap": "error",
"prefer-const": 0, "new-parens": "error",
"prefer-reflect": 0, "newline-after-var": "off",
"prefer-rest-params": 0, "newline-before-return": "off",
"prefer-spread": 0, "newline-per-chained-call": "off",
"prefer-template": 0, "object-curly-newline": "off",
"quote-props": 2, "object-curly-spacing": ["error", "always"],
"quotes": [2, "double"], "object-property-newline": "error",
"radix": 2, "object-shorthand": "off",
"id-match": 2, "one-var": "off",
"id-blacklist": 2, "one-var-declaration-per-line": "error",
"require-jsdoc": 0, "operator-assignment": "error",
"require-yield": 2, "operator-linebreak": ["error", "after"],
"semi": 2, "padded-blocks": "off",
"semi-spacing": [2, {"before": false, "after": true}], "prefer-arrow-callback": "off",
"sort-vars": 0, "prefer-const": "off",
"sort-imports": 2, "prefer-reflect": "off",
"space-before-blocks": [2, "always"], "prefer-rest-params": "off",
"space-before-function-paren": [2, "never"], "prefer-spread": "off",
"space-in-parens": [2, "never"], "prefer-template": "off",
"space-infix-ops": 2, "quote-props": "error",
"space-unary-ops": [2, { "words": true, "nonwords": false }], "quotes": "error",
"spaced-comment": 2, "radix": "error",
"strict": [2, "global"], "require-jsdoc": "off",
"template-curly-spacing": 2, "require-yield": "error",
"use-isnan": 2, "rest-spread-spacing": "error",
"valid-jsdoc": 2, "semi": "error",
"valid-typeof": 2, "semi-spacing": "error",
"vars-on-top": 0, "sort-imports": "error",
"wrap-iife": 2, "sort-vars": "error",
"wrap-regex": 0, "space-before-blocks": "error",
"yield-star-spacing": 2, "space-before-function-paren": ["error", "never"],
"yoda": [2, "never"] "space-in-parens": "error",
"space-infix-ops": "error",
"space-unary-ops": "error",
"spaced-comment": "error",
"strict": "error",
"template-curly-spacing": "error",
"unicode-bom": "error",
"use-isnan": "error",
"valid-jsdoc": "error",
"valid-typeof": "error",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error",
"yoda": "error"
} }
} }

View file

@ -32,7 +32,7 @@ rules.forEach(function forRule(rule) {
// }); // });
// Class for results with toString for pretty display // Class for results with toString for pretty display
function Results() { } function Results() {}
Results.prototype.toString = function resultsToString(useAlias) { Results.prototype.toString = function resultsToString(useAlias) {
var that = this; var that = this;
var results = []; var results = [];

View file

@ -861,8 +861,8 @@ module.exports = [
errors.push(child.lineNumber); errors.push(child.lineNumber);
} }
lastChildRightSpaceLineNumber = lastChildRightSpaceLineNumber =
(child.content.trimRight().length !== child.content.length) ? (child.content.trimRight().length === child.content.length) ?
child.lineNumber : 0; 0 : child.lineNumber;
index++; index++;
} }
}); });