UNPKG

@domenic/eslint-config

Version:

Domenic Denicola's base ESLint config

222 lines (219 loc) 7.37 kB
export default [{ rules: { // Possible Problems "array-callback-return": "error", "constructor-super": "error", "for-direction": "error", "getter-return": "error", "no-async-promise-executor": "error", "no-await-in-loop": "error", "no-class-assign": "error", "no-compare-neg-zero": "error", "no-cond-assign": ["error", "except-parens"], "no-const-assign": "error", "no-constant-binary-expression": "error", "no-constant-condition": ["error", { checkLoops: false }], "no-constructor-return": "error", "no-control-regex": "off", "no-debugger": "error", "no-dupe-args": "error", "no-dupe-class-members": "error", "no-dupe-else-if": "error", "no-dupe-keys": "error", "no-duplicate-case": "error", "no-duplicate-imports": "error", "no-empty-character-class": "error", "no-empty-pattern": "error", "no-ex-assign": "error", "no-fallthrough": "error", "no-func-assign": "error", "no-import-assign": "error", "no-inner-declarations": "error", "no-invalid-regexp": "error", "no-irregular-whitespace": "error", "no-loss-of-precision": "error", "no-misleading-character-class": "error", "no-new-native-nonconstructor": "error", "no-obj-calls": "error", "no-promise-executor-return": "error", "no-prototype-builtins": "error", "no-self-assign": "error", "no-self-compare": "error", "no-setter-return": "error", "no-sparse-arrays": "error", "no-template-curly-in-string": "error", "no-this-before-super": "error", "no-unassigned-vars": "error", "no-undef": "error", "no-unexpected-multiline": "error", "no-unmodified-loop-condition": "error", "no-unreachable": "error", "no-unreachable-loop": "error", "no-unsafe-finally": "off", "no-unsafe-negation": "error", "no-unsafe-optional-chaining": [ "error", { disallowArithmeticOperators: true }, ], "no-unused-private-class-members": "error", "no-unused-vars": "error", "no-use-before-define": ["error", { functions: false }], "no-useless-assignment": "error", "no-useless-backreference": "error", "require-atomic-updates": "off", // over-trigger-happy "use-isnan": ["error", { enforceForIndexOf: true }], "valid-typeof": "error", // Suggestions "accessor-pairs": "error", "arrow-body-style": "off", "block-scoped-var": "error", "camelcase": ["error", { properties: "always" }], "capitalized-comments": "off", "class-methods-use-this": "off", "complexity": "off", "consistent-return": "error", "consistent-this": "off", "curly": ["error", "all"], "default-case": "off", "default-case-last": "error", "default-param-last": "error", "dot-notation": "error", "eqeqeq": "error", "func-name-matching": ["error"], "func-names": "off", "func-style": ["error", "declaration"], "grouped-accessor-pairs": ["error", "getBeforeSet"], "guard-for-in": "off", "id-denylist": "off", "id-length": "off", "id-match": "off", "init-declarations": "off", "logical-assignment-operators": "error", "max-classes-per-file": "off", "max-depth": "off", "max-lines": "off", "max-lines-per-function": "off", "max-nested-callbacks": "error", "max-params": "off", "max-statements": "off", "new-cap": "error", "no-alert": "error", "no-array-constructor": "error", "no-bitwise": "off", "no-caller": "error", "no-case-declarations": "error", "no-console": "error", "no-continue": "off", "no-delete-var": "error", "no-div-regex": "error", "no-else-return": "error", "no-empty": "error", "no-empty-function": "off", "no-empty-static-block": "error", "no-eq-null": "error", "no-eval": "error", "no-extend-native": "error", "no-extra-bind": "error", "no-extra-boolean-cast": "error", "no-extra-label": "error", "no-global-assign": "error", "no-implicit-coercion": "error", "no-implicit-globals": "error", "no-implied-eval": "error", "no-inline-comments": "off", "no-invalid-this": "error", "no-iterator": "error", "no-label-var": "error", "no-labels": ["error", { allowLoop: true }], "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", "no-magic-numbers": "off", "no-multi-assign": "off", "no-multi-str": "error", "no-negated-condition": "off", "no-nested-ternary": "error", "no-new": "error", "no-new-func": "error", "no-new-wrappers": "error", "no-nonoctal-decimal-escape": "error", "no-object-constructor": "error", "no-octal": "error", "no-octal-escape": "error", "no-param-reassign": "off", "no-plusplus": "off", "no-proto": "error", "no-redeclare": "error", "no-regex-spaces": "error", "no-restricted-exports": "off", "no-restricted-globals": "off", "no-restricted-imports": "off", "no-restricted-properties": "off", "no-restricted-syntax": "off", "no-return-assign": ["error", "except-parens"], "no-script-url": "off", "no-sequences": "error", "no-shadow": "error", "no-shadow-restricted-names": "error", "no-ternary": "off", "no-throw-literal": "error", "no-undef-init": "error", "no-undefined": "off", "no-underscore-dangle": "off", "no-unneeded-ternary": "error", "no-unused-expressions": "error", "no-unused-labels": "error", "no-useless-call": "error", "no-useless-catch": "error", "no-useless-computed-key": "error", "no-useless-concat": "error", "no-useless-constructor": "error", "no-useless-escape": "error", "no-useless-rename": "error", "no-useless-return": "error", "no-var": "error", "no-void": "error", "no-warning-comments": "off", "no-with": "error", "object-shorthand": "error", "one-var": ["error", { initialized: "never", uninitialized: "always" }], "operator-assignment": ["error", "always"], "prefer-arrow-callback": "error", "prefer-const": [ "error", { ignoreReadBeforeAssign: true, destructuring: "all" }, ], "prefer-destructuring": [ "error", { VariableDeclarator: { array: false, object: true }, AssignmentExpression: { array: false, object: false }, }, { enforceForRenamedProperties: false }, ], "prefer-exponentiation-operator": "error", "prefer-named-capture-group": "off", "prefer-numeric-literals": "error", "prefer-object-has-own": "error", "prefer-object-spread": "error", "prefer-promise-reject-errors": "error", "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }], "prefer-rest-params": "error", "prefer-spread": "error", "prefer-template": "error", "preserve-caught-error": "error", "radix": "error", "require-await": "off", // throwing being converted to rejections is too useful "require-unicode-regexp": "error", "require-yield": "error", "sort-imports": "error", "sort-keys": "off", "sort-vars": "off", "strict": ["error", "global"], "symbol-description": "error", "vars-on-top": "error", "yoda": ["error", "never", { exceptRange: true }], // Layout & Formatting "unicode-bom": "error" } }];