From 984bd8696ca22453a06986ceda64f387b7321536 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 27 Feb 2025 21:50:10 +1100 Subject: [PATCH] [Dev] Reverse unicorn lint config - on by default (#633) Sets unicorn linter recommended rules on by default, with individual rules disabled. - Issue to track removal of these rules: #629 --- eslint.config.js | 57 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 7bfe88724..5bb59cc98 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,10 +19,6 @@ const antfuLint = { const unicornRecommended = eslintPluginUnicorn.configs.recommended -for (const id of Object.keys(unicornRecommended.rules)) { - unicornRecommended.rules[id] = "off" -} - export default tseslint.config( { ignores: [".*/**", "dist/**", "scripts/**"] }, { files: ["**/*.{js,mjs,ts,mts}"] }, @@ -61,18 +57,53 @@ export default tseslint.config( unicornRecommended, { rules: { - "unicorn/better-regex": "error", - "unicorn/prefer-dom-node-append": "error", - "unicorn/prefer-dom-node-remove": "error", - "unicorn/no-array-for-each": "error", - "unicorn/empty-brace-spaces": "error", - "unicorn/no-nested-ternary": "error", - "unicorn/prefer-string-replace-all": "error", - "unicorn/prefer-dom-node-text-content": "error", + // Temporarily disabled + // See https://github.com/Comfy-Org/litegraph.js/issues/629 + "unicorn/prefer-export-from": "off", + "unicorn/catch-error-name": "off", + "unicorn/consistent-existence-index-check": "off", + "unicorn/no-array-callback-reference": "off", + "unicorn/no-array-push-push": "off", + "unicorn/no-console-spaces": "off", + "unicorn/no-lonely-if": "off", + "unicorn/no-this-assignment": "off", + "unicorn/no-typeof-undefined": "off", + "unicorn/no-useless-switch-case": "off", + "unicorn/no-zero-fractions": "off", + "unicorn/numeric-separators-style": "off", + "unicorn/prefer-add-event-listener": "off", + "unicorn/prefer-blob-reading-methods": "off", + "unicorn/prefer-date-now": "off", + "unicorn/prefer-default-parameters": "off", + "unicorn/prefer-keyboard-event-key": "off", + "unicorn/prefer-logical-operator-over-ternary": "off", + "unicorn/prefer-math-min-max": "off", + "unicorn/prefer-native-coercion-functions": "off", + "unicorn/prefer-query-selector": "off", + "unicorn/prefer-spread": "off", + "unicorn/prefer-structured-clone": "off", + "unicorn/prefer-switch": "off", + "unicorn/prefer-ternary": "off", + "unicorn/prefer-includes": "off", + + // Disable rules + "unicorn/consistent-function-scoping": "off", + "unicorn/explicit-length-check": "off", + "unicorn/filename-case": "off", + "unicorn/no-negated-condition": "off", + "unicorn/no-new-array": "off", + "unicorn/no-null": "off", + "unicorn/prefer-global-this": "off", + "unicorn/prefer-number-properties": "off", + "unicorn/prefer-string-raw": "off", + "unicorn/prefer-string-slice": "off", + "unicorn/prevent-abbreviations": "off", + "unicorn/require-number-to-fixed-digits-argument": "off", + "unicorn/switch-case-braces": "off", // Node rules: dev dependency config, etc. - "unicorn/prefer-node-protocol": "error", "unicorn/prefer-module": "error", + "unicorn/prefer-node-protocol": "error", }, },