From d75a1d6f241cb22cc4b2852737cd570cbbb71fc5 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 28 Dec 2023 16:42:28 +0100 Subject: [PATCH] chore: opt out of unused unicorn ESLint rules --- .eslintrc.cjs | 114 ++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 106 insertions(+), 8 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 512d5025b592..92431eb6a37f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -34,6 +34,7 @@ module.exports = { 'plugin:import/errors', 'plugin:eslint-comments/recommended', 'plugin:prettier/recommended', + 'plugin:unicorn/recommended', ], globals: { console: 'readonly', @@ -417,7 +418,7 @@ module.exports = { parserOptions: { sourceType: 'module', }, - plugins: ['import', 'jsdoc', 'unicorn'], + plugins: ['import', 'jsdoc'], rules: { 'accessor-pairs': ['warn', {setWithoutGet: true}], 'block-scoped-var': 'off', @@ -625,13 +626,110 @@ module.exports = { 'wrap-regex': 'off', yoda: 'off', - 'unicorn/explicit-length-check': 'error', - 'unicorn/no-array-for-each': 'error', - 'unicorn/no-negated-condition': 'error', - 'unicorn/numeric-separators-style': 'error', - 'unicorn/prefer-default-parameters': 'error', - 'unicorn/prefer-includes': 'error', - 'unicorn/template-indent': 'error', + // TODO: turn most of these rules on at some point + 'unicorn/better-regex': 'off', + 'unicorn/catch-error-name': 'off', + 'unicorn/consistent-destructuring': 'off', + 'unicorn/consistent-function-scoping': 'off', + 'unicorn/custom-error-definition': 'off', + 'unicorn/empty-brace-spaces': 'off', + 'unicorn/error-message': 'off', + 'unicorn/escape-case': 'off', + 'unicorn/expiring-todo-comments': 'off', + 'unicorn/filename-case': 'off', + 'unicorn/import-style': 'off', + 'unicorn/new-for-builtins': 'off', + 'unicorn/no-abusive-eslint-disable': 'off', + 'unicorn/no-array-callback-reference': 'off', + 'unicorn/no-array-method-this-argument': 'off', + 'unicorn/no-array-push-push': 'off', + 'unicorn/no-array-reduce': 'off', + 'unicorn/no-await-expression-member': 'off', + 'unicorn/no-console-spaces': 'off', + 'unicorn/no-document-cookie': 'off', + 'unicorn/no-empty-file': 'off', + 'unicorn/no-for-loop': 'off', + 'unicorn/no-hex-escape': 'off', + 'unicorn/no-instanceof-array': 'off', + 'unicorn/no-invalid-remove-event-listener': 'off', + 'unicorn/no-keyword-prefix': 'off', + 'unicorn/no-lonely-if': 'off', + 'unicorn/no-nested-ternary': 'off', + 'unicorn/no-new-array': 'off', + 'unicorn/no-new-buffer': 'off', + 'unicorn/no-null': 'off', + 'unicorn/no-object-as-default-parameter': 'off', + 'unicorn/no-process-exit': 'off', + 'unicorn/no-static-only-class': 'off', + 'unicorn/no-thenable': 'off', + 'unicorn/no-this-assignment': 'off', + 'unicorn/no-typeof-undefined': 'off', + 'unicorn/no-unnecessary-await': 'off', + 'unicorn/no-unnecessary-polyfills': 'off', + 'unicorn/no-unreadable-array-destructuring': 'off', + 'unicorn/no-unreadable-iife': 'off', + 'unicorn/no-unused-properties': 'off', + 'unicorn/no-useless-fallback-in-spread': 'off', + 'unicorn/no-useless-length-check': 'off', + 'unicorn/no-useless-promise-resolve-reject': 'off', + 'unicorn/no-useless-spread': 'off', + 'unicorn/no-useless-switch-case': 'off', + 'unicorn/no-useless-undefined': 'off', + 'unicorn/no-zero-fractions': 'off', + 'unicorn/number-literal-case': 'off', + 'unicorn/prefer-add-event-listener': 'off', + 'unicorn/prefer-array-find': 'off', + 'unicorn/prefer-array-flat': 'off', + 'unicorn/prefer-array-flat-map': 'off', + 'unicorn/prefer-array-index-of': 'off', + 'unicorn/prefer-array-some': 'off', + 'unicorn/prefer-at': 'off', + 'unicorn/prefer-blob-reading-methods': 'off', + 'unicorn/prefer-code-point': 'off', + 'unicorn/prefer-date-now': 'off', + 'unicorn/prefer-dom-node-append': 'off', + 'unicorn/prefer-dom-node-dataset': 'off', + 'unicorn/prefer-dom-node-remove': 'off', + 'unicorn/prefer-dom-node-text-content': 'off', + 'unicorn/prefer-event-target': 'off', + 'unicorn/prefer-export-from': 'off', + 'unicorn/prefer-json-parse-buffer': 'off', + 'unicorn/prefer-keyboard-event-key': 'off', + 'unicorn/prefer-logical-operator-over-ternary': 'off', + 'unicorn/prefer-math-trunc': 'off', + 'unicorn/prefer-modern-dom-apis': 'off', + 'unicorn/prefer-modern-math-apis': 'off', + 'unicorn/prefer-module': 'off', + 'unicorn/prefer-native-coercion-functions': 'off', + 'unicorn/prefer-negative-index': 'off', + 'unicorn/prefer-node-protocol': 'off', + 'unicorn/prefer-number-properties': 'off', + 'unicorn/prefer-object-from-entries': 'off', + 'unicorn/prefer-optional-catch-binding': 'off', + 'unicorn/prefer-prototype-methods': 'off', + 'unicorn/prefer-query-selector': 'off', + 'unicorn/prefer-reflect-apply': 'off', + 'unicorn/prefer-regexp-test': 'off', + 'unicorn/prefer-set-has': 'off', + 'unicorn/prefer-set-size': 'off', + 'unicorn/prefer-spread': 'off', + 'unicorn/prefer-string-replace-all': 'off', + 'unicorn/prefer-string-slice': 'off', + 'unicorn/prefer-string-starts-ends-with': 'off', + 'unicorn/prefer-string-trim-start-end': 'off', + 'unicorn/prefer-switch': 'off', + 'unicorn/prefer-ternary': 'off', + 'unicorn/prefer-top-level-await': 'off', + 'unicorn/prefer-type-error': 'off', + 'unicorn/prevent-abbreviations': 'off', + 'unicorn/relative-url-style': 'off', + 'unicorn/require-array-join-separator': 'off', + 'unicorn/require-number-to-fixed-digits-argument': 'off', + 'unicorn/require-post-message-target-origin': 'off', + 'unicorn/string-content': 'off', + 'unicorn/switch-case-braces': 'off', + 'unicorn/text-encoding-identifier-case': 'off', + 'unicorn/throw-new-error': 'off', }, settings: { 'import/ignore': ['react-native'],