sindresorhus / eslint-plugin-unicorn
More than 100 powerful ESLint rules
AI Architecture Analysis
This repository is indexed by RepoMind. By analyzing sindresorhus/eslint-plugin-unicorn in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.
Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.
Repository Overview (README excerpt)
Crawler vieweslint-plugin-unicorn > More than 100 powerful ESLint rules You might want to check out XO, which includes this plugin. **Propose or contribute a new rule β‘** Install **Requires ESLint , flat config, and ESM.** Usage Use a preset config or configure each rule in . If you don't use the preset, ensure you use the same config as below. Rules πΌ Configurations enabled in.\ β Set in the configuration.\ βοΈ Set in the configuration.\ π§ Automatically fixable by the CLI option.\ π‘ Manually fixable by editor suggestions. | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | Description | πΌ | π§ | π‘ | | :----------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--- | :- | :- | | better-regex | Improve regexes by making them shorter, consistent, and safer. | | π§ | | | catch-error-name | Enforce a specific parameter name in catch clauses. | β | π§ | | | consistent-assert | Enforce consistent assertion style with . | β | π§ | | | consistent-date-clone | Prefer passing directly to the constructor when cloning. | β βοΈ | π§ | | | consistent-destructuring | Use destructured variables over properties. | | | π‘ | | consistent-empty-array-spread | Prefer consistent types when spreading a ternary in an array literal. | β | π§ | | | consistent-existence-index-check | Enforce consistent style for element existence checks with , , , and . | β βοΈ | π§ | | | consistent-function-scoping | Move function definitions to the highest possible scope. | β | | | | consistent-template-literal-escape | Enforce consistent style for escaping in template literals. | β | π§ | | | custom-error-definition | Enforce correct subclassing. | | π§ | | | empty-brace-spaces | Enforce no spaces between braces. | β | π§ | | | error-message | Enforce passing a value when creating a built-in error. | β βοΈ | | | | escape-case | Require escape sequences to use uppercase or lowercase values. | β βοΈ | π§ | | | expiring-todo-comments | Add expiration conditions to TODO comments. | β βοΈ | | | | explicit-length-check | Enforce explicitly comparing the or property of a value. | β | π§ | π‘ | | filename-case | Enforce a case style for filenames. | β | | | | import-style | Enforce specific import styles per module. | β βοΈ | | | | isolated-functions | Prevent usage of variables from outside the scope of isolated functions. | β | | | | new-for-builtins | Enforce the use of for all builtins, except , , , and . | β βοΈ | π§ | π‘ | | no-abusive-eslint-disable | Enforce specifying rules to disable in comments. | β βοΈ | | | | no-accessor-recursion | Disallow recursive access to within getters and setters. | β βοΈ | | | | no-anonymous-default-export | Disallow anonymous functions and classes as the default export. | β βοΈ | | π‘ | | no-array-callback-reference | Prevent passing a function reference directly to iterator methods. | β | | π‘ | | no-array-for-each | Prefer over the method. | β βοΈ | π§ | π‘ | | no-array-method-this-argument | Disallow using the argument in array methods. | β βοΈ | π§ | π‘ | | no-array-reduce | Disallow and . | β | | | | no-array-reverse | Prefer over . | β βοΈ | | π‘ | | no-array-sort | Prefer over . | β βοΈ | | π‘ | | no-await-expression-member | Disallow member access from await expression. | β | π§ | | | no-await-in-promise-methods | Disallow using in method parameters. | β βοΈ | | π‘ | | no-console-spaces | Do not use leading/trailing space between parameters. | β βοΈ | π§ | | | no-document-cookie | Do not use directly. | β βοΈ | | | | no-empty-file | Disallow empty files. | β βοΈ | | | | no-for-loop | Do not use a loop that can be replaced with a loop. | β | π§ | π‘ | | no-hex-escape | Enforce the use of Unicode escapes instead of hexadecimal escapes. | β βοΈ | π§ | | | no-immediate-mutation | Disallow immediate mutation after variable assignment. | β | π§ | π‘ | | no-instanceof-builtins | Disallow with built-in objects | β βοΈ | π§ | π‘ | | no-invalid-fetch-options | Disallow invalid options in and . | β βοΈ | | | | no-invalid-remove-event-listener | Prevent calling with the result of an expression. | β βοΈ | | | | no-keyword-prefix | Disallow identifiers starting with or . | | | | | no-lonely-if | Disallow statements as the only statement in blocks without . | β βοΈ | π§ | | | no-magic-array-flat-depth | Disallow a magic number as the argument in | β βοΈ | | | | no-named-default | Disallow named usage of default import and export. | β βοΈ | π§ | | | no-negated-condition | Disallow negated conditions. | β βοΈ | π§ | | | no-negation-in-equality-check | Disallow negated expression in equality check. | β βοΈ | | π‘ | | no-nested-ternary | Disallow nested ternary expressions. | β | π§ | | | no-new-array | Disallow . | β βοΈ | π§ | π‘ | | no-new-buffer | Enforce the use of and instead of the deprecated . | β βοΈ | π§ | π‘ | | no-null | Disallow the use of the literal. | β | π§ | π‘ | | no-object-as-default-parameter | Disallow the use of objects as default parameters. | β βοΈ | | | | no-process-exit | Disallow . | β βοΈ | | | | no-single-promise-in-promise-methods | Disallow passing single-element arrays to methods. _...truncated for preview_