{ // Recommended rules "extends": "eslint:recommended", "parserOptions": { "sourceType": "module" }, // Plugins "plugins": [ "jsdoc", "node" ], // Environments "env": { "browser": true, "es6": true, "node": true, "jquery": true }, "rules": { // Possible Errors "no-extra-parens": "error", "no-prototype-builtins": "error", "no-template-curly-in-string": "error", "no-unsafe-negation": "error", "valid-jsdoc": "error", // Best Practices "accessor-pairs": "error", "array-callback-return": "error", "block-scoped-var": "error", "class-methods-use-this": "error", "complexity": ["error", 5], "consistent-return": "error", "curly": "error", "default-case": "error", "dot-location": ["error", "property"], "dot-notation": ["error", { "allowKeywords": false }], "eqeqeq": ["error", "smart"], "guard-for-in": "error", "no-alert": "error", "no-caller": "error", "no-div-regex": "error", "no-else-return": "error", "no-empty-function": "error", "no-eq-null": "error", "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-extra-label": "error", "no-floating-decimal": "error", "no-global-assign": "error", "no-implicit-coercion": ["error", { "string": false }], "no-implied-eval": "error", "no-lone-blocks": "error", "no-loop-func": "error", "no-multi-spaces": ["error", { "exceptions": { "ImportDeclaration": true } }], "no-multi-str": "error", "no-new-func": "error", "no-new-wrappers": "error", "no-new": "error", "no-octal-escape": "error", "no-param-reassign": ["error", { "props": false }], "no-proto": "error", "no-return-assign": "error", "no-script-url": "error", "no-self-compare": "error", "no-sequences": "error", "no-throw-literal": "error", "no-unmodified-loop-condition": "error", "no-unused-expressions": "error", "no-useless-call": "error", "no-useless-concat": "error", "no-useless-escape": "error", "no-void": "error", "no-warning-comments": "error", "no-with": "error", "radix": "error", "vars-on-top": "error", "wrap-iife": ["error", "outside"], "yoda": "error", // Strict Mode "strict": ["error", "global"], // Variables "init-declarations": ["error", "always"], "no-catch-shadow": "error", "no-label-var": "error", "no-shadow-restricted-names": "error", "no-shadow": ["error", { "builtinGlobals": true }], "no-undef-init": "error", "no-undefined": "error", "no-use-before-define": "error", // Node.js and CommonJS "callback-return": "error", "global-require": "off", "handle-callback-err": "error", "no-mixed-requires": "error", "no-new-require": "error", "no-sync": "error", // Stylistic Issues "array-bracket-spacing": ["error", "always", { "singleValue": false, "objectsInArrays": false, "arraysInArrays": false }], "block-spacing": "error", "brace-style": "error", "camelcase": "error", "comma-dangle": ["error", "never"], "comma-spacing": "error", "comma-style": "error", "computed-property-spacing": "error", "consistent-this": ["error", "that"], "eol-last": "error", "func-call-spacing": "error", "func-names": ["error", "never"], "func-style": "error", "id-blacklist": ["error", "data", "event", "err", "callback"], "id-length": ["error", { "min": 2, "max": 15, "properties": "never" }], "indent": ["error", 2], "key-spacing": "error", "keyword-spacing": "error", "linebreak-style": "error", "lines-around-comment": "error", "lines-around-directive": "error", "max-depth": "error", "max-len": ["error", { "code": 80, "tabWidth": 2, "ignoreComments": false }], "max-lines": ["error", { "max": 300, "skipBlankLines": false, "skipComments": false }], "max-params": ["error", 3], "max-statements-per-line": ["error", { "max": 3 }], "new-cap": "error", "new-parens": "error", "newline-after-var": "error", "newline-before-return": "error", "no-array-constructor": "error", "no-bitwise": "error", "no-inline-comments": "error", "no-lonely-if": "error", "no-mixed-operators": ["error", { "groups": [ ["+", "-", "*", "/", "%", "**"], ["&", "|", "^", "~", "<<", ">>", ">>>"], ["==", "!=", "===", "!==", ">", ">=", "<", "<="], ["&&", "||"], ["in", "instanceof"] ], "allowSamePrecedence": true }], "no-multiple-empty-lines": "error", "no-negated-condition": "error", "no-nested-ternary": "error", "no-new-object": "error", "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], "no-tabs": "error", "no-trailing-spaces": "error", "no-underscore-dangle": "error", "no-unneeded-ternary": "error", "no-whitespace-before-property": "error", "object-curly-spacing": "error", "object-property-newline": "error", "one-var": ["error", "never"], "operator-assignment": "error", "padded-blocks": "error", "quotes": ["error", "single"], "semi-spacing": ["error", { "before": false, "after": true }], "semi": ["error", "never"], "space-before-blocks": "error", "space-before-function-paren": ["error", "never"], "space-in-parens": ["error", "never"], "space-infix-ops": "error", "space-unary-ops": "error", "spaced-comment": ["error", "always"], "wrap-regex": "error", // ECMAScript 6 "arrow-body-style": ["error", "as-needed"], "arrow-parens": "error", "arrow-spacing": ["error", { "before": true, "after": true }], "generator-star-spacing": ["error", { "before": true, "after": true }], "no-confusing-arrow": "error", "no-duplicate-imports": "error", "no-useless-computed-key": "error", "no-useless-constructor": "error", "no-useless-rename": "error", "no-var": "error", "object-shorthand": "error", "prefer-arrow-callback": "error", "prefer-const": "error", "prefer-numeric-literals": "error", "prefer-reflect": "error", "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", "rest-spread-spacing": ["error", "never"], "symbol-description": "error", "template-curly-spacing": "error", "yield-star-spacing": ["error", "both"], // Plugin: jsDoc "jsdoc/check-param-names": "warn", "jsdoc/check-tag-names": "warn", "jsdoc/check-types": "warn", "jsdoc/newline-after-description": "warn", "jsdoc/require-description-complete-sentence": "warn", "jsdoc/require-hyphen-before-param-description": "warn", "jsdoc/require-param": "warn", "jsdoc/require-param-description": "warn", "jsdoc/require-param-type": "warn", "jsdoc/require-returns-description": "warn", "jsdoc/require-returns-type": "warn", // Plugin: Node "node/no-deprecated-api": "error", "node/no-missing-require": "error", "node/process-exit-as-throw": "error", "node/shebang": "error" } }