12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- {
- "extends": "eslint:recommended",
- "env": {
- "es6": true,
- "node": true,
- "browser": true,
- "mocha": true
- },
- "parserOptions": {
- "ecmaVersion": 2016
- },
- "globals": {
- "window": false,
- "document": false,
- "$": false,
- "System": false,
- "expect": false
- },
- "rules": {
- "accessor-pairs": "error",
- "arrow-spacing": "error",
- "brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
- "camelcase": [ "error", { "properties": "never" } ],
- "comma-spacing": ["error", { "before": false, "after": true }],
- // "curly": [ "error", "all" ],
- // "dot-notation": "error",
- "eol-last": ["error", "always"],
- // "eqeqeq": ["error", "always"],
- // "indent": ["error", "tab", { "MemberExpression": "off", "SwitchCase": 1, "ObjectExpression": "first" } ],
- "key-spacing": [ "error", { "beforeColon": false, "afterColon": true, "mode": "minimum" } ],
- "keyword-spacing": [ "error", {} ],
- "no-cond-assign": "error",
- "no-console": ["off", { "allow": ["warn", "error"] }],
- "no-constant-condition": ["error", { "checkLoops": false }],
- "no-eval": "error",
- "no-fallthrough": "off",
- "no-mixed-spaces-and-tabs": "error",
- // "no-multiple-empty-lines": "error",
- "no-restricted-globals": ["error", "event"],
- "no-restricted-syntax": [
- "error",
- {
- "selector": "*:not(ExpressionStatement) > CallExpression[callee.property.name='sort']:not([callee.object.type='CallExpression']):not([callee.object.type='ArrayExpression']):not([callee.object.name='mongoUtil'])",
- "message": "Restricted Array Mutation: Use `array.slice().sort(...)` if mutation was not intended, otherwise place on own line."
- },
- {
- "selector": "*:not(ExpressionStatement) > CallExpression[callee.property.name='reverse']:not([callee.object.type='CallExpression']):not([callee.object.type='ArrayExpression'])",
- "message": "Restricted Array Mutation: Use `array.slice().reverse(...)` if mutation was not intended, otherwise place on own line."
- },
- {
- "selector": "*:not(ExpressionStatement) > CallExpression[callee.property.name='push']",
- "message": "Restricted Array Mutation: `array.push(...)` returns push count, not array reference, place statement on own line."
- }
- ],
- // "no-return-assign": "error",
- // "no-trailing-spaces": "error",
- "no-undef": "error",
- "no-unused-expressions": "error",
- "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
- // "no-use-before-define": [ "error", { "functions": false } ],
- "no-useless-escape": "off",
- "no-with": "error",
- "padding-line-between-statements": [
- "error",
- { "blankLine": "always", "prev": "*", "next": "function" }
- ],
- // "quotes": [ "error", "double", { "allowTemplateLiterals": true, "avoidEscape": true } ],
- "semi": [ "error", "always" ],
- "space-before-blocks": [ "error", "always" ],
- // "space-before-function-paren": [ "error", { "anonymous": "always", "named": "always", "asyncArrow": "always" } ],
- // "space-in-parens": [ "error", "never" ],
- // "space-infix-ops": "error",
- // "space-unary-ops": [ "error", { "nonwords": true, "overrides": {} } ],
- // "spaced-comment": [ "error", "always", {"block": {"exceptions": ["*", "!"], "balanced": true}} ]
- }
- }
|