Skip to content

☂️ eslint-plugin-unicorn #684

@Boshen

Description

@Boshen

Warning

This comment is maintained by CI. Do not edit this comment directly.
To update comment template, see https://github.com/oxc-project/oxc/tree/main/tasks/lint_rules

This is the tracking issue for eslint-plugin-unicorn.

There are 141(+ 3 deprecated) rules.

  • 11/132 recommended rules are remaining as TODO
    • 30 of which have pending fixes
  • 8/9 not recommended rules are remaining as TODO

To get started, run the following command:

just new-unicorn-rule <RULE_NAME>

Then register the rule in crates/oxc_linter/src/rules.rs and also declare_all_lint_rules at the bottom.

Recommended rules

✅: 119, 🚫: 2, ⏳: 30 / total: 132
Status Name
unicorn/catch-error-name
unicorn/consistent-assert
unicorn/consistent-date-clone
unicorn/consistent-empty-array-spread
unicorn/consistent-existence-index-check
✅⏳ unicorn/consistent-function-scoping
unicorn/empty-brace-spaces
unicorn/error-message
unicorn/escape-case
unicorn/expiring-todo-comments
unicorn/explicit-length-check
unicorn/filename-case
unicorn/import-style
unicorn/new-for-builtins
unicorn/no-abusive-eslint-disable
unicorn/no-accessor-recursion
unicorn/no-anonymous-default-export
✅⏳ unicorn/no-array-callback-reference
✅⏳ unicorn/no-array-for-each
✅⏳ unicorn/no-array-method-this-argument
unicorn/no-array-reduce
unicorn/no-array-reverse
unicorn/no-array-sort
unicorn/no-await-expression-member
unicorn/no-await-in-promise-methods
unicorn/no-console-spaces
unicorn/no-document-cookie
unicorn/no-empty-file
🚫 unicorn/no-for-loop
unicorn/no-hex-escape
✅⏳ unicorn/no-immediate-mutation
✅⏳ unicorn/no-instanceof-builtins
unicorn/no-invalid-fetch-options
unicorn/no-invalid-remove-event-listener
unicorn/no-lonely-if
unicorn/no-magic-array-flat-depth
🚫 unicorn/no-named-default
✅⏳ unicorn/no-negated-condition
unicorn/no-negation-in-equality-check
unicorn/no-nested-ternary
✅⏳ unicorn/no-new-array
✅⏳ unicorn/no-new-buffer
unicorn/no-null
unicorn/no-object-as-default-parameter
✅⏳ unicorn/no-process-exit
unicorn/no-single-promise-in-promise-methods
unicorn/no-static-only-class
unicorn/no-thenable
unicorn/no-this-assignment
✅⏳ unicorn/no-typeof-undefined
unicorn/no-unnecessary-array-flat-depth
unicorn/no-unnecessary-array-splice-count
unicorn/no-unnecessary-await
unicorn/no-unnecessary-polyfills
unicorn/no-unnecessary-slice-end
unicorn/no-unreadable-array-destructuring
unicorn/no-unreadable-iife
✅⏳ unicorn/no-useless-collection-argument
✅⏳ unicorn/no-useless-error-capture-stack-trace
unicorn/no-useless-fallback-in-spread
✅⏳ unicorn/no-useless-length-check
unicorn/no-useless-promise-resolve-reject
unicorn/no-useless-spread
✅⏳ unicorn/no-useless-switch-case
unicorn/no-useless-undefined
unicorn/no-zero-fractions
unicorn/number-literal-case
unicorn/numeric-separators-style
✅⏳ unicorn/prefer-add-event-listener
✅⏳ unicorn/prefer-array-find
unicorn/prefer-array-flat
unicorn/prefer-array-flat-map
✅⏳ unicorn/prefer-array-index-of
unicorn/prefer-array-some
unicorn/prefer-at
unicorn/prefer-bigint-literals
✅⏳ unicorn/prefer-blob-reading-methods
unicorn/prefer-class-fields
unicorn/prefer-classlist-toggle
unicorn/prefer-code-point
unicorn/prefer-date-now
✅⏳ unicorn/prefer-default-parameters
unicorn/prefer-dom-node-append
✅⏳ unicorn/prefer-dom-node-dataset
unicorn/prefer-dom-node-remove
unicorn/prefer-dom-node-text-content
unicorn/prefer-event-target
unicorn/prefer-export-from
✅⏳ unicorn/prefer-global-this
✅⏳ unicorn/prefer-includes
unicorn/prefer-keyboard-event-key
✅⏳ unicorn/prefer-logical-operator-over-ternary
unicorn/prefer-math-min-max
✅⏳ unicorn/prefer-math-trunc
✅⏳ unicorn/prefer-modern-dom-apis
✅⏳ unicorn/prefer-modern-math-apis
unicorn/prefer-module
✅⏳ unicorn/prefer-native-coercion-functions
unicorn/prefer-negative-index
unicorn/prefer-node-protocol
unicorn/prefer-number-properties
✅⏳ unicorn/prefer-object-from-entries
unicorn/prefer-optional-catch-binding
unicorn/prefer-prototype-methods
unicorn/prefer-query-selector
unicorn/prefer-reflect-apply
unicorn/prefer-regexp-test
✅⏳ unicorn/prefer-response-static-json
unicorn/prefer-set-has
unicorn/prefer-set-size
unicorn/prefer-single-call
unicorn/prefer-spread
unicorn/prefer-string-raw
unicorn/prefer-string-replace-all
unicorn/prefer-string-slice
unicorn/prefer-string-starts-ends-with
unicorn/prefer-string-trim-start-end
unicorn/prefer-structured-clone
unicorn/prefer-switch
unicorn/prefer-ternary
unicorn/prefer-top-level-await
unicorn/prefer-type-error
unicorn/prevent-abbreviations
unicorn/relative-url-style
unicorn/require-array-join-separator
unicorn/require-module-attributes
unicorn/require-module-specifiers
unicorn/require-number-to-fixed-digits-argument
unicorn/switch-case-braces
unicorn/template-indent
unicorn/text-encoding-identifier-case
unicorn/throw-new-error

✅ = Implemented, 🚫 = No need to implement, ⏳ = Fix pending

Not recommended rules

✅: 1, 🚫: 0, ⏳: 0 / total: 9
Status Name
unicorn/better-regex
unicorn/consistent-destructuring
unicorn/custom-error-definition
unicorn/no-keyword-prefix
unicorn/no-unused-properties
unicorn/prefer-import-meta-properties
unicorn/prefer-json-parse-buffer
unicorn/require-post-message-target-origin
unicorn/string-content

✅ = Implemented, 🚫 = No need to implement, ⏳ = Fix pending

Deprecated rules

✅: 2, 🚫: 1, ⏳: 0 / total: 3
Status Name
🚫 unicorn/no-array-push-push
unicorn/no-instanceof-array
unicorn/no-length-as-slice-end

✅ = Implemented, 🚫 = No need to implement, ⏳ = Fix pending

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linterArea - LinterE-Help WantedExperience level - For the experienced collaboratorsgood first issueExperience Level - Good for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions