From f4ba148bd06fd7780e738ddb444ef7eb09f47398 Mon Sep 17 00:00:00 2001 From: Ivan Lytovka <50273967+lytovka@users.noreply.github.com> Date: Mon, 17 Apr 2023 22:23:29 -0400 Subject: [PATCH] feat: add missing ESLint rules (#37) --- index.js | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9382716..480a222 100644 --- a/index.js +++ b/index.js @@ -66,27 +66,72 @@ module.exports = { ], "no-unused-private-class-members": "error", "no-array-constructor": "error", + "no-async-promise-executor": "error", + "no-case-declarations": "error", + "no-class-assign": "error", + "no-compare-neg-zero": "error", + "no-cond-assign": "error", "no-console": "off", // becomes quite problematic in Node environment + "no-const-assign": "error", + "no-constant-condition": "off", // meh + "no-control-regex": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-dupe-class-members": "error", + "no-empty": "off", // empty blocks are sometimes used as placeholders "no-div-regex": "error", "no-extra-bind": "error", + "no-extra-boolean-cast": "error", + "no-empty-character-class": "error", + "no-empty-pattern": "error", "no-eval": "error", + "no-ex-assign": "error", "no-extra-semi": "error", + "no-fallthrough": ["error", { allowEmptyCase: true }], + "no-func-assign": "error", + "no-global-assign": "error", "no-implied-eval": "error", + "no-import-assign": "error", + "no-inner-declarations": "error", + "no-invalid-regexp": "error", + "no-irregular-whitespace": "error", + "no-misleading-character-class": "error", + "no-new-symbol": "error", + "no-nonoctal-decimal-escape": "error", "no-label-var": "error", "no-loop-func": "error", "no-negated-condition": "off", // legibility of a negated condition should be decided on a per-case basis "no-new-native-nonconstructor": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-prototype-builtins": "error", "no-param-reassign": "off", // let's see if this ever becomes a problem... "no-redeclare": "error", + "no-regex-spaces": "error", "no-restricted-exports": "off", "no-restricted-syntax": "off", // nothing immediate comes to mind + "no-self-assign": "error", "no-self-compare": "error", + "no-setter-return": "error", + "no-shadow-restricted-names": "error", + "no-sparse-arrays": "error", "no-ternary": "off", + "no-this-before-super": "error", + "no-undef": "error", "no-underscore-dangle": "off", // can emphasize that an identifier is special - "no-unused-expressions": "off", // an expression might be used later "no-useless-concat": "error", "no-useless-constructor": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": "error", + "no-unused-expressions": "off", // an expression might be used later + "no-unused-labels": "error", + "no-useless-backreference": "error", + "no-useless-catch": "error", + "no-useless-escape": "error", "no-var": "error", + "no-with": "off", "one-var": ["error", { initialized: "never" }], "prefer-const": "error", "prefer-numeric-literals": "error", @@ -178,6 +223,8 @@ module.exports = { "no-new-object": "error", "no-void": "off", radix: "error", + "use-isnan": "error", + "require-yield": "error", "no-octal-escape": "error", "no-warning-comments": "off", // ["error", { "terms": ["todo", "fixme"], "location": "start" }] "require-unicode-regexp": "off", @@ -191,6 +238,7 @@ module.exports = { "prefer-object-spread": "error", "no-unreachable-loop": "error", "prefer-rest-params": "error", + "valid-typeof": "error", }, overrides: [ { diff --git a/package.json b/package.json index 5deba45..3eeed2c 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "engineStrict": true, "scripts": { "lint": "eslint --config index.js .", - "find-new-rules:main": "eslint-find-rules --unused ./index.js" + "find-new-rules": "eslint-find-rules --unused ./index.js" }, "dependencies": { "@typescript-eslint/eslint-plugin": "^5.47.0",