From f8ea5629cb07beabc08e0967b9db1562b1db91b8 Mon Sep 17 00:00:00 2001 From: Sylvester Keil Date: Thu, 25 Feb 2016 14:04:59 +0100 Subject: [PATCH] Update eslint --- .eslintrc | 189 +++++++++++++++---------------------------------- lib/mailer.js | 4 +- test/.eslintrc | 8 +++ 3 files changed, 66 insertions(+), 135 deletions(-) create mode 100644 test/.eslintrc diff --git a/.eslintrc b/.eslintrc index 54cc528..d7ee51d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,136 +1,59 @@ -// vi: set ft=javascript : -{ - "ecmaFeatures": { - "blockBindings": true, - "generators": true - }, +# vi: set ft=yaml - "env": { - "node": true, - "mocha": true - }, +root: true - "rules": { - "no-alert": 0, - "no-array-constructor": 2, - "no-bitwise": 0, - "no-caller": 2, - "no-catch-shadow": 2, - "no-comma-dangle": 2, - "no-cond-assign": 2, - "no-console": 0, - "no-constant-condition": 2, - "no-control-regex": 2, - "no-debugger": 1, - "no-delete-var": 2, - "no-div-regex": 0, - "no-dupe-keys": 2, - "no-else-return": 0, - "no-empty": 2, - "no-empty-class": 2, - "no-empty-label": 2, - "no-eq-null": 0, - "no-eval": 2, - "no-ex-assign": 2, - "no-extend-native": 2, - "no-extra-boolean-cast": 2, - "no-extra-parens": 0, - "no-extra-semi": 2, - "no-extra-strict": 2, - "no-fallthrough": 2, - "no-floating-decimal": 0, - "no-func-assign": 2, - "no-implied-eval": 2, - "no-inner-declarations": [2, "functions"], - "no-invalid-regexp": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-lonely-if": 0, - "no-loop-func": 2, - "no-mixed-requires": [0, false], - "no-multi-str": 2, - "no-multi-spaces": 0, - "no-native-reassign": 2, - "no-negated-in-lhs": 2, - "no-nested-ternary": 0, - "no-new": 0, - "no-new-func": 2, - "no-new-object": 2, - "no-new-require": 0, - "no-new-wrappers": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-path-concat": 0, - "no-plusplus": 0, - "no-process-exit": 0, - "no-proto": 2, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-restricted-modules": 0, - "no-return-assign": 2, - "no-script-url": 2, - "no-self-compare": 0, - "no-sequences": 2, - "no-shadow": 2, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-space-before-semi": 2, - "no-sparse-arrays": 2, - "no-sync": 0, - "no-ternary": 0, - "no-undef": 2, - "no-undef-init": 2, - "no-underscore-dangle": 0, - "no-unreachable": 2, - "no-unused-expressions": 0, - "no-unused-vars": [2, {"vars": "local", "args": "none"}], - "no-use-before-define": [2, "nofunc"], - "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], - "no-with": 2, - "no-wrap-func": 2, +extends: + 'eslint:recommended' +env: + node: true + browser: false +parserOptions: + ecmaVersion: 6 + ecmaFeatures: + generators: true - "block-scoped-var": 0, - "brace-style": [0, "1tbs"], - "camelcase": 0, - "complexity": [0, 11], - "consistent-return": 2, - "consistent-this": [0, "that"], - "curly": [0, "multi"], - "default-case": 0, - "dot-notation": 2, - "eqeqeq": 2, - "func-names": 0, - "func-style": [0, "declaration"], - "guard-for-in": 0, - "key-spacing": 0, - "max-depth": [1, 4], - "max-len": [1, 80, 2], - "max-nested-callbacks": [0, 2], - "max-params": [0, 3], - "max-statements": [0, 10], - "handle-callback-err": 0, - "new-cap": 2, - "new-parens": 2, - "one-var": 0, - "quote-props": 0, - "quotes": [2, "single", "avoid-escape"], - "radix": 0, - "semi": 2, - "sort-vars": 0, - "space-after-keywords": [0, "always"], - "space-in-brackets": [0, "never"], - "space-infix-ops": 2, - "space-return-throw-case": 2, - "space-unary-word-ops": 0, - "strict": 0, - "global-strict": [2, "always"], - "use-isnan": 2, - "valid-jsdoc": 0, - "valid-typeof": 2, - "wrap-iife": 0, - "wrap-regex": 0 - } -} +rules: + array-bracket-spacing: 2 + block-spacing: 2 + brace-style: [2, '1tbs', { allowSingleLine: true }] + comma-style: 2 + comma-spacing: 2 + complexity: [1, 10] + consistent-return: 0 + consistent-this: [2, 'self'] + curly: 0 + dot-location: [2, 'property'] + eqeqeq: [2, 'smart'] + indent: [2, 2, { SwitchCase: 1 }] + key-spacing: [1, { beforeColon: false, afterColon: true }] + keyword-spacing: 2 + max-depth: [1, 6] + max-len: [1, 80, 2, { ignoreComments: true, ignoreUrls: true }] + max-nested-callbacks: [1, 4] + new-parens: 2 + no-caller: 2 + no-eval: 2 + no-implied-eval: 2 + no-loop-func: 2 + no-mixed-spaces-and-tabs: 2 + no-multi-str: 2 + no-shadow: 2 + no-spaced-func: 2 + no-trailing-spaces: 2 + no-unexpected-multiline: 2 + no-unneeded-ternary: 2 + no-useless-concat: 2 + no-unreachable: 2 + object-curly-spacing: [2, 'always'] + operator-linebreak: [2, 'after'] + quote-props: [2, 'consistent-as-needed'] + quotes: [2, 'single', 'avoid-escape'] + radix: 2 + semi-spacing: 0 + semi: [2, 'always'] + space-before-blocks: 2 + space-before-function-paren: [2, { anonymous: 'always', named: 'never' }] + space-infix-ops: 2 + space-unary-ops: 2 + strict: [2, 'global'] + wrap-regex: 2 diff --git a/lib/mailer.js b/lib/mailer.js index 918dff6..d639d42 100644 --- a/lib/mailer.js +++ b/lib/mailer.js @@ -113,8 +113,8 @@ Mailer.prototype.send = function (item) { 'X-Mailer': this.name }, - to: options.recipient, - from: options.from, + to: options.recipient, + from: options.from, subject: options.subject, text: options.text, diff --git a/test/.eslintrc b/test/.eslintrc new file mode 100644 index 0000000..af9a29f --- /dev/null +++ b/test/.eslintrc @@ -0,0 +1,8 @@ +# vi: set ft=yaml + +env: + mocha: true +rules: + max-nested-callbacks: [2, 8] + max-len: 0 + no-console: 0