diff --git a/.eslintrc b/.eslintrc index e6fee7a0..1a853142 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,14 +1,141 @@ { + "extends": "eslint:recommended", "env": { "node": true }, "rules": { - "comma-style": [2, "first"], - "no-extra-semi": 2, + // Possible errors + "no-extra-parens": 2, + "no-unexpected-multiline": 2, + "valid-jsdoc": 2, + "valid-typeof": 2, + + // Best practices + "accessor-pairs": 2, + "block-scoped-var": 2, + "complexity": 0, + "consistent-return": 2, + "curly": 2, + "dot-location": [2, "property"], // defaults to "object" + "dot-notation": 2, + "eqeqeq": [2, "smart"], // `2` is recommended + "guard-for-in": 2, + "no-alert": 1, // `2` is recommended + "no-caller": 2, + "no-div-regex": 2, + "no-else-return": 2, + "no-empty-label": 2, + "no-empty-pattern": 2, + "no-eq-null": 2, + "no-eval": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-fallthrough": 1, // `2` is recommended + "no-floating-decimal": 1, // `2` is recommended + "no-implicit-coercion": [1, {"boolean": true, "number": true, "string": false}], // `[2, {"boolean": true, "number": true, "string": true}],` is recommended + "no-implied-eval": 2, + "no-invalid-this": 1, // `2` is recommended + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-loop-func": 2, + "no-magic-numbers": 1, + "no-multi-spaces": 2, // `2` is recommended + "no-multi-str": 2, + "no-native-reassign": 2, + "no-new-func": 2, + "no-new-wrappers": 2, + "no-new": 2, + "no-octal-escape": 2, // TODO: check from here + "no-octal": 2, + "no-param-reassign": 1, // `2` is recommended and actually defaults to `[2, {"props": false}]` + "no-process-env": 1, // `2` is recommended + "no-proto": 2, + "no-redeclare": [2, {"builtinGlobals": true}], // `2` is recommended and actually defaults to `[2, {"builtinGlobals": false}]` + "no-return-assign": [2, "except-parens"], + "no-script-url": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-throw-literal": 2, + "no-unused-expressions": 2, // `2` is recommended and actually defaults to `[2, {"allowShortCircuit": false, "allowTernary": false}]` + "no-useless-call": 1, // `2` is recommended + "no-useless-concat": 2, + "no-void": 2, + "no-warning-comments": [1, {"terms": ["todo", "fixme"], "location": "start"}], // `[0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }]` is recommended + "no-with": 2, + "radix": 1, // `2` is recommended + "vars-on-top": 1, // `2` is recommended + "wrap-iife": [2, "inside"], // `[2, "outside"]` is recommended + "yoda": [1, "never"], // `[2, "never"]` is recommended, optionally set `[2, "never", {"exceptRange": true, "onlyEquality": false}] + + // Style + "array-bracket-spacing": [1, "never"], // optionally set `[2, "never", {"singleValue": true, "objectsInArrays": true, "arraysInArrays": true}]` + "block-spacing": [1, "always"], + "brace-style": [1, "1tbs", {"allowSingleLine": false}], + "camelcase": [1, {"properties": "always"}], + "comma-spacing": [1, {"before": false, "after": true}], + "comma-style": [1, "last"], // optionally set `[2, "first", {"exceptions": {"ArrayExpression": true, "ObjectExpression": true}}]` + "computed-property-spacing": [1, "never"], + "consistent-this": [1, "self"], + "eol-last": 1, + "func-names": 0, + "func-style": 0, // optionally set `[2, "expression"]` + "id-length": 0, // optionally set `[2, {"min": 3, "max": 10, "properties": "never", "exceptions": ["x"]}]` + "id-match": 0, // optionally set `[2, "^[a-z]+([A-Z][a-z]+)*$", {"properties": false}]` + "indent": [1, 2, {"SwitchCase": 1, "VariableDeclarator": 2}], // optionally set `[2, 2, {"SwitchCase": 1, "VariableDeclarator": {"var": 2, "let": 2, "const": 3}}]` + "jsx-quotes": [1, "prefer-double"], + "key-spacing": [1, {"beforeColon": false, "afterColon": true, "mode": "minimum"}], // optionally set `[2, {"beforeColon": false, "afterColon": true, "mode": "strict", "align": "colon"}]` + "lines-around-comment": 0, // optionally set `[2, {"beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true}]` + "linebreak-style": 0, // optionally set `[1, "unix"]` + "max-nested-callbacks": [1, 3], + "new-cap": [1, {"newIsCap": true, "capIsNew": true}], // optionally set `[2, {"capIsNewExceptions": ["Person"]}]` + "new-parens": 1, + "newline-after-var": [1, "always"], + "no-array-constructor": 1, + "no-continue": 1, + "no-inline-comments": 0, + "no-lonely-if": 1, + "no-mixed-spaces-and-tabs": 1, // optionally set `[2, "smart-tabs"]` + "no-multiple-empty-lines": [1, {"max": 1}], + "no-nested-ternary": 1, + "no-new-object": 1, + "no-restricted-syntax": 0, // optionally set `[2, "FunctionExpression", "WithStatement"]` + "no-spaced-func": 1, + "no-ternary": 0, + "no-trailing-spaces": [1, {"skipBlankLines": false}], "no-underscore-dangle": 0, - "quotes": [2, "single", "avoid-escape"], - "semi": [2, "never"], - "space-before-blocks": [2, "always"], - "strict": [0, "function"] + "no-unneeded-ternary": [1, {"defaultAssignment": true}], + "object-curly-spacing": [1, "never"], // optionally set `[2, "always", {"objectsInObjects": false, "arraysInObjects": false}]` + "one-var": [1, {"uninitialized": "always", "initialized": "never"}], // optionally set `[2, {"var": "always", "let": "never", "const": "never"}]` + "operator-assignment": 0, // optionally set `[2, "always"]` + "operator-linebreak": [1, "after"], // optionally set `[2, "before", {"overrides": {"?": "after"}}]` + "padded-blocks": [1, "never"], + "quote-props": [1, "as-needed", {"keywords": false, "unnecessary": false, "numbers": true}], + "quotes": [1, "single", "avoid-escape"], + "require-jsdoc": 0, + "semi-spacing": [1, {"before": false, "after": true}], + "semi": [1, "always"], + "sort-vars": 0, // optaionlly set `[2, {"ignoreCase": true}]` + "space-after-keywords": [1, "always"], + "space-before-keywords": [1, "always"], + "space-before-blocks": [1, "always"], // optionally set `[2, {"functions": "never", "keywords": "always"}]` + "space-before-function-paren": [1, "never"], // optionally set `[2, {"anonymous": "always", "named": "never"}]` + "space-in-parens": [1, "never"], // optionally set `[2, "always", {"exceptions": ["empty"]}]` + "space-infix-ops": [1, {"int32Hint": false}], + "space-return-throw-case": 1, + "space-unary-ops": [1, {"words": true, "nonwords": false}], + "spaced-comment": [1, "always", {"exceptions": ["/"]}], // optionally set `[2, "always", {"exceptions": ["-", "+"], "markers": ["/"]}]` + "wrap-regex": 1, + + // Node.js / Common.js + "callback-return": 0, // `2` is default, optionally set `[2, ["callback", "cb", "next"]]` + "global-require": 0, // `2` is default + "handle-callback-err": 0, // `2` is default, optionally set `[2, "^(err|error)$"]` + "no-mixed-requires": 0, // [2, false] is default + "no-new-require": 0, // `2` is default + "no-path-concat": 0, // `2` is default + "no-process-exit": 0, // `2` is default + "no-restricted-modules": 0, // no default, optionally set `[2, "fs", "os"]` + "no-sync": 0 // `2` is default } } diff --git a/res/.eslintrc b/res/.eslintrc new file mode 100644 index 00000000..4a035f65 --- /dev/null +++ b/res/.eslintrc @@ -0,0 +1,9 @@ +{ + "env": { + "commonjs": true, + "mocha": true, + "browser": true + }, + "rules": { + } +}