Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: opt out of unused unicorn ESLint rules
  • Loading branch information
SimenB committed Dec 28, 2023
commit d75a1d6f241cb22cc4b2852737cd570cbbb71fc5
114 changes: 106 additions & 8 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'plugin:import/errors',
'plugin:eslint-comments/recommended',
'plugin:prettier/recommended',
'plugin:unicorn/recommended',
],
globals: {
console: 'readonly',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Comment on lines -628 to -634
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are all active in the recommended config, so we don't have to list them out explicitly

// 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'],
Expand Down