123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- {
- "env": {
- "jasmine": true,
- "node": true
- },
- "rules": {
- // Possible errors
- "for-direction": "error",
- "no-await-in-loop": "error",
- "no-compare-neg-zero": "error",
- "no-cond-assign": "error",
- "no-console": "off",
- "no-constant-condition": "off",
- "no-control-regex": "error",
- "no-debugger": "error",
- "no-dupe-args": "error",
- "no-dupe-keys": "error",
- "no-duplicate-case": "error",
- "no-empty": "error",
- "no-empty-character-class": "error",
- "no-ex-assign": "error",
- "no-extra-boolean-cast": "error",
- "no-extra-parens": "off",
- "no-extra-semi": "error",
- "no-func-assign": "error",
- "no-inner-declarations": ["error", "functions"],
- "no-invalid-regexp": "error",
- "no-irregular-whitespace": "error",
- "no-obj-calls": "error",
- "no-prototype-builtins": "error",
- "no-regex-spaces": "error",
- "no-sparse-arrays": "error",
- "no-template-curly-in-string": "error",
- "no-unexpected-multiline": "error",
- "no-unreachable": "error",
- "no-unsafe-finally": "error",
- "no-unsafe-negation": "error",
- "use-isnan": "error",
- "valid-jsdoc": "off",
- "valid-typeof": "error",
- // Best practices
- "accessor-pairs": "error",
- "array-callback-return": "error",
- "block-scoped-var": "off",
- "class-methods-use-this": "off",
- "complexity": "off", // TODO: enable
- "consistent-return": "error",
- "curly": ["error", "all"],
- "default-case": "error",
- "dot-location": ["error", "property"],
- "dot-notation": "error",
- "eqeqeq": ["error", "smart"],
- "guard-for-in": "error",
- "no-alert": "error",
- "no-caller": "error",
- "no-case-declarations": "error",
- "no-div-regex": "error",
- "no-else-return": "off",
- "no-empty-function": "error",
- "no-empty-pattern": "error",
- "no-eq-null": "error",
- "no-eval": "error",
- "no-extend-native": "error",
- "no-extra-bind": "error",
- "no-fallthrough": "off", // disabled due to bug in ESLint
- "no-floating-decimal": "error",
- "no-global-assign": "error",
- "no-implicit-coercion": "error",
- "no-implicit-globals": "error",
- "no-implied-eval": "error",
- "no-invalid-this": "error",
- "no-iterator": "error",
- "no-labels": "error",
- "no-lone-blocks": "error",
- "no-loop-func": "error",
- "no-magic-numbers": "off", // TODO: enable?
- "no-multi-spaces": "error",
- "no-multi-str": "error",
- "no-new": "error",
- "no-new-func": "error",
- "no-new-wrappers": "error",
- "no-octal": "error",
- "no-octal-escape": "error",
- "no-param-reassign": "off",
- "no-proto": "error",
- "no-redeclare": "error",
- "no-restricted-properties": "off",
- "no-return-assign": "error",
- "no-return-await": "error",
- "no-script-url": "error",
- "no-self-assign": "error",
- "no-self-compare": "error",
- "no-sequences": "error",
- "no-throw-literal": "error",
- "no-unmodified-loop-condition": "error",
- "no-unused-expressions": "error",
- "no-unused-labels": "error",
- "no-useless-call": "error",
- "no-useless-concat": "error",
- "no-useless-escape": "error",
- "no-useless-return": "error",
- "no-void": "error",
- "no-warning-comments": "off",
- "no-with": "error",
- "prefer-promise-reject-errors": "error",
- "radix": "error",
- "require-await": "error",
- "vars-on-top": "off", // TODO: enable
- "wrap-iife": ["error", "inside"],
- "yoda": "error",
- // Strict mode
- "strict": ["error", "global"],
- // Variables
- "init-declarations": "off",
- "no-catch-shadow": "off",
- "no-delete-var": "error",
- "no-label-var": "error",
- "no-restricted-globals": ["error", "app", "env"],
- "no-shadow": "error",
- "no-shadow-restricted-names": "error",
- "no-undef": "error",
- "no-undef-init": "error",
- "no-undefined": "off",
- "no-unused-vars": "error",
- "no-use-before-define": "error",
- // Node.js and CommonJS
- "callback-return": "off",
- "global-require": "off", // TODO: enable
- "handle-callback-err": "error",
- "no-buffer-constructor": "off", // TODO: enable when we stop supporting Node.js 4.x
- "no-mixed-requires": "error",
- "no-new-require": "error",
- "no-path-concat": "error",
- "no-process-env": "error",
- "no-process-exit": "error",
- "no-restricted-modules": "off",
- "no-sync": "off",
- // Stylistic issues
- "array-bracket-newline": "off",
- "array-bracket-spacing": ["error", "never"],
- "array-element-newline": "off",
- "block-spacing": ["error", "always"],
- "brace-style": "off", // TODO: enable with "stroustrup" (or "1tbsp" + lots of cleanup)
- "camelcase": "error",
- "capitalized-comments": "off",
- "comma-dangle": "error",
- "comma-spacing": ["error", {
- "before": false,
- "after": true
- }],
- "comma-style": ["error", "last"],
- "computed-property-spacing": ["error", "never"],
- "consistent-this": ["error", "self"],
- "eol-last": "error",
- "func-call-spacing": ["error", "never"],
- "func-name-matching": ["error", "always"],
- "func-names": "off",
- "func-style": "off",
- "id-blacklist": "off",
- "id-length": "off",
- "id-match": "off",
- "indent": ["error", 4, {
- "SwitchCase": 1
- }],
- "jsx-quotes": ["error", "prefer-double"],
- "key-spacing": ["error", {
- "beforeColon": false,
- "afterColon": true
- }],
- "keyword-spacing": ["error", {
- "before": true,
- "after": true
- }],
- "line-comment-position": "off",
- "linebreak-style": "off",
- "lines-around-comment": "off",
- "max-depth": "off", // TODO: enable
- "max-len": "off", // TODO: enable
- "max-lines": "off",
- "max-nested-callbacks": "off",
- "max-params": "off", // TODO: enable
- "max-statements": "off",
- "max-statements-per-line": "off",
- "multiline-ternary": "off",
- "new-cap": "error",
- "new-parens": "error",
- "newline-per-chained-call": "off", // TODO: enable
- "no-array-constructor": "error",
- "no-bitwise": "error",
- "no-continue": "off",
- "no-inline-comments": "off",
- "no-lonely-if": "error",
- "no-mixed-operators": "error",
- "no-mixed-spaces-and-tabs": "error",
- "no-multi-assign": "off",
- "no-multiple-empty-lines": ["error", {
- "max": 2
- }],
- "no-negated-condition": "off",
- "no-nested-ternary": "error",
- "no-new-object": "error",
- "no-plusplus": "off",
- "no-restricted-syntax": "off",
- "no-tabs": "error",
- "no-ternary": "off",
- "no-trailing-spaces": "error",
- "no-underscore-dangle": "off",
- "no-unneeded-ternary": "error",
- "no-whitespace-before-property": "error",
- "nonblock-statement-body-position": "off",
- "object-curly-newline": "off",
- "object-curly-spacing": "off",
- "object-property-newline": "error",
- "one-var": "off",
- "one-var-declaration-per-line": "error",
- "operator-assignment": "off",
- "operator-linebreak": ["error", "after"],
- "padded-blocks": ["error", "never"],
- "padding-line-between-statements": ["error", {
- "blankLine": "always",
- "prev": "*",
- "next": "return"
- }, {
- "blankLine": "always",
- "prev": ["const", "let", "var"],
- "next": "*"
- }, {
- "blankLine": "any",
- "prev": ["const", "let", "var"],
- "next": ["const", "let", "var"]
- }],
- "quote-props": "off",
- "quotes": ["error", "single", "avoid-escape"],
- "require-jsdoc": "off",
- "semi": ["error", "always"],
- "semi-spacing": "error",
- "semi-style": ["error", "last"],
- "sort-keys": "off",
- "sort-vars": "off", // TODO: enable?
- "space-before-blocks": ["error", "always"],
- "space-before-function-paren": ["error", "never"],
- "space-in-parens": "off", // TODO: enable?
- "space-infix-ops": "error",
- "space-unary-ops": "error",
- "spaced-comment": ["error", "always"],
- "switch-colon-spacing": ["error", {
- "after": true,
- "before": false
- }],
- "template-tag-spacing": ["error", "never"],
- "unicode-bom": ["error", "never"],
- "wrap-regex": "off",
- // ECMAScript 2015
- "arrow-body-style": ["error", "as-needed"],
- "arrow-parens": ["error", "always"],
- "arrow-spacing": ["error", {
- "before": true,
- "after": true
- }],
- "constructor-super": "error",
- "generator-star-spacing": ["error", {
- "before": true,
- "after": false
- }],
- "no-class-assign": "error",
- "no-confusing-arrow": "error",
- "no-const-assign": "error",
- "no-dupe-class-members": "error",
- "no-duplicate-imports": ["error", {
- "includeExports": true
- }],
- "no-new-symbol": "error",
- "no-restricted-imports": "off",
- "no-this-before-super": "error",
- "no-useless-computed-key": "error",
- "no-useless-constructor": "off",
- "no-useless-rename": "error",
- "no-var": "off",
- "object-shorthand": "off",
- "prefer-arrow-callback": "off",
- "prefer-const": "off",
- "prefer-destructuring": "off",
- "prefer-numeric-literals": "off",
- "prefer-rest-params": "off",
- "prefer-spread": "off",
- "prefer-template": "off",
- "require-yield": "error",
- "rest-spread-spacing": ["error", "never"],
- "sort-imports": "error",
- "symbol-description": "error",
- "template-curly-spacing": ["error", "never"],
- "yield-star-spacing": ["error", "before"]
- }
- }
|