Skip to content

mchevestrier/eslint-plugin-wyrm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

240 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐲 eslint-plugin-wyrm

npm version GitHub release GitHub License Mutation testing badge

Installation

npm install --save-dev eslint eslint-plugin-wyrm

Usage

import { defineConfig } from 'eslint/config';
import wyrm from 'eslint-plugin-wyrm';

export default defineConfig([
  // ...

  wyrm.configs.recommended,
]);

Configs

Name
🟩 recommended
βœ… recommendedTypeChecked
πŸŸͺ strict
β˜‘οΈ strictTypeChecked

Rules

πŸ’Ό Configurations enabled in.
🟩 Set in the recommended configuration.
βœ… Set in the recommendedTypeChecked configuration.
πŸŸͺ Set in the strict configuration.
β˜‘οΈ Set in the strictTypeChecked configuration.
πŸ”§ Automatically fixable by the --fix CLI option.
πŸ’‘ Manually fixable by editor suggestions.
πŸ’­ Requires type information.

NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  Description πŸ’Ό πŸ”§ πŸ’‘ πŸ’­
array-from-array Forbid calling Array.from on arrays β˜‘οΈ πŸ”§ πŸ’­
as-unknown-as Forbid as unknown as πŸŸͺ β˜‘οΈ
await-promise-resolve Forbid await Promise.resolve() 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
boolean-coalescing Prefer distributing boolean casts over nullish coalescing expressions β˜‘οΈ πŸ”§ πŸ’­
comment-duplicate-leading-space Forbid duplicate leading space in comments 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
conditional-boolean Forbid if/else branches where the only difference is a boolean literal 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
constant-boolean-cast Forbid boolean casts on values with constant truthiness βœ… β˜‘οΈ πŸ’‘ πŸ’­
de-morgan Enforce using De Morgan's law to simplify negated logical expressions 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
discarded-expression-statement Forbid discarding the result of expression statements πŸ’­
distribute-boolean-casts Enforce that boolean casts are distributed over logical expressions πŸŸͺ β˜‘οΈ πŸ”§
duplicate-destructuring Forbid duplicate keys in object destructuring patterns 🟩 βœ… πŸŸͺ β˜‘οΈ
duplicate-object-spread Forbid duplicate spread elements in object literals 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
e Forbid using e as a parameter name πŸŸͺ β˜‘οΈ πŸ’‘
empty-for Forbid using for (;;) 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
enum-member Prefer enum members to literals asserted as enum βœ… β˜‘οΈ πŸ”§ πŸ’­
eqeq-null Forbid using x == null when equivalent to x === null β˜‘οΈ πŸ”§ πŸ’­
exact-string-regex Forbid using a RegEx when string equality would suffice 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ’‘
export-using Forbid exporting variables declared with using or await using 🟩 βœ… πŸŸͺ β˜‘οΈ
generic-constructor-with-hook Forbid specifying the type arguments on the hook instead of on the generic class πŸŸͺ β˜‘οΈ πŸ”§
idiomatic-cast Enforce idiomatic ways to cast values β˜‘οΈ πŸ”§ πŸ’­
inferable-type-predicate Forbid inferable type predicates β˜‘οΈ πŸ”§ πŸ’­
inner-as-const Enforce setting as const on the outermost object/array literal only πŸŸͺ β˜‘οΈ πŸ”§
jsx-tostring Forbid calling .toString() inside JSX expressions containers β˜‘οΈ πŸ”§ πŸ’­
literal-destructuring Forbid variable declaration by destructuring object or array literals πŸŸͺ β˜‘οΈ πŸ”§
named-export-with-side-effects Forbid named exports in files with side effects 🟩 βœ… πŸŸͺ β˜‘οΈ
nested-reduce Forbid nested reduce calls πŸŸͺ β˜‘οΈ
nested-try-catch Forbid nested try/catch statements πŸŸͺ β˜‘οΈ
no-commented-out-comment Forbid commented out comments 🟩 βœ… πŸŸͺ β˜‘οΈ
no-constant-template-expression Disallow constant string expressions in template literals β˜‘οΈ πŸ’‘ πŸ’­
no-constructed-error-cause Forbid using Error.cause with constructed objects πŸŸͺ β˜‘οΈ
no-convoluted-boolean-expressions Forbid simplifiable logical expressions with boolean types βœ… β˜‘οΈ πŸ”§ πŸ’­
no-convoluted-logical-expressions Forbid simplifiable logical expressions 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-custom-url-parsing Forbid parsing or building URLs by hand πŸŸͺ β˜‘οΈ
no-disallowed-warning-comments Forbid disallowed comments like FIXME, XXX, HACK πŸŸͺ β˜‘οΈ
no-duplicated-return Forbid duplicated branches with early returns 🟩 βœ… πŸŸͺ β˜‘οΈ
no-else-break Forbid unnecessary else block after a break statement 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-else-continue Forbid unnecessary else block after a continue statement 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-else-never Forbid unnecessary else block after an expression that never returns β˜‘οΈ πŸ”§ πŸ’­
no-else-return Forbid unnecessary else block after a return statement 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-else-throw Forbid unnecessary else block after a throw statement 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-empty-attribute Forbid some empty JSX attributes πŸŸͺ β˜‘οΈ
no-empty-comment Forbid empty comments πŸŸͺ β˜‘οΈ
no-empty-jsx-expression Forbid empty JSX expression containers 🟩 βœ… πŸŸͺ β˜‘οΈ
no-empty-literal-iteration Forbid iterating over empty literals 🟩 βœ… πŸŸͺ β˜‘οΈ
no-extra-false-fallback Forbid extra ?? false in conditions and predicates πŸŸͺ β˜‘οΈ πŸ’‘
no-extra-nested-boolean-cast Forbid extra boolean casts in conditions and predicates πŸŸͺ β˜‘οΈ
no-first-last Forbid confusing naming for "first" or "last" 🟩 βœ… πŸŸͺ β˜‘οΈ
no-float-length-check Forbid comparing a length to a floating point number 🟩 βœ… πŸŸͺ β˜‘οΈ
no-huge-try-block Forbid huge try/catch blocks πŸŸͺ β˜‘οΈ
no-huge-useeffect Forbid huge useEffect functions πŸŸͺ β˜‘οΈ
no-if-length-for Forbid redundant condition for positive length before a loop 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-inline-jsdoc-tag Forbid JSDoc tags in code comments πŸŸͺ β˜‘οΈ
no-invalid-date-literal Disallow invalid date literals 🟩 βœ… πŸŸͺ β˜‘οΈ
no-jsx-statement Forbid JSX expression statements 🟩 βœ… πŸŸͺ β˜‘οΈ
no-lax-array-type Forbid declaring array types that are wider than the types of the actual elements β˜‘οΈ πŸ’‘ πŸ’­
no-lax-return-type Forbid declaring function return types that are wider than the types of the actual return values β˜‘οΈ πŸ’‘ πŸ’­
no-mutable-literal-fill Forbid using mutable literals to fill arrays 🟩 βœ… πŸŸͺ β˜‘οΈ
no-nullish-ternary Forbid ternary conditions that can be replaced by optional chains 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-numbered-comments Forbid numbered comments
no-obvious-any Forbid using any when a stricter type can be trivially inferred β˜‘οΈ πŸ”§ πŸ’­
no-optional-type-guard-param Forbid optional parameters in type guards 🟩 βœ… πŸŸͺ β˜‘οΈ
no-out-of-order-comments Forbid out of order numbered comments 🟩 βœ… πŸŸͺ β˜‘οΈ
no-possibly-nullish-equality Forbid checking the equality of possibly nullish values β˜‘οΈ πŸ’­
no-redundant-function-declaration Forbid redundant function declarations 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
no-return-to-void Forbid returning values in void-returning callbacks β˜‘οΈ πŸ’­
no-self-object-assign Forbid using Object.assign() with the same object as both target and source 🟩 βœ… πŸŸͺ β˜‘οΈ
no-sloppy-length-check Forbid sloppy collection size checks 🟩 βœ… πŸŸͺ β˜‘οΈ
no-suspicious-jsx-semicolon Forbid suspicious semicolons in JSX 🟩 βœ… πŸŸͺ β˜‘οΈ
no-ternary-return Disallow ternary conditions in return statements πŸŸͺ β˜‘οΈ πŸ”§
no-type-guard Forbid type guards
no-unassigned-todo Forbid unassigned TODO comments πŸŸͺ β˜‘οΈ
no-unbound-catch-error Forbid catch clauses with unbound errors πŸŸͺ β˜‘οΈ
no-unused-mutually-referential Forbid unused functions, even if mutually referential πŸŸͺ β˜‘οΈ
no-unused-param-read Forbid referencing parameters marked as unused with a leading underscore πŸŸͺ β˜‘οΈ
no-useless-computed-key Forbid useless computed keys πŸŸͺ β˜‘οΈ πŸ”§
no-useless-iife Forbid useless IIFEs 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ’‘
no-useless-logical-fallback Forbid useless fallback values for logical expressions βœ… β˜‘οΈ πŸ’‘ πŸ’­
no-useless-return-undefined Forbid returning undefined in void-returning callbacks β˜‘οΈ πŸ’­
no-useless-ts-check Forbid useless @ts-check comments in TypeScript files 🟩 βœ… πŸŸͺ β˜‘οΈ
no-useless-use-strict Forbid useless "use strict" directives. πŸŸͺ β˜‘οΈ
no-useless-usememo Forbid useless useMemo() πŸŸͺ β˜‘οΈ
no-whitespace-property Forbid leading or trailing whitespace in object keys πŸŸͺ β˜‘οΈ
nullish-object-spread Forbid useless fallback for nullish values in object spread πŸŸͺ β˜‘οΈ
optional-call-expression Enforce using optional call expression syntax 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
prefer-array-from Enforce using Array.from or Array.fromAsync over iterative accumulation 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
prefer-catch-method Enforce usage of Promise.prototype.catch() when it improves readability 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ’‘
prefer-early-return Require early returns when possible πŸŸͺ β˜‘οΈ πŸ”§
prefer-eqeq-null Enforce using x == null instead of x === null || x === undefined πŸŸͺ β˜‘οΈ πŸ”§
prefer-finally Enforce using finally rather than duplicating code in try and catch blocks πŸŸͺ β˜‘οΈ πŸ’‘
prefer-getorinsert Enforce using Map#getOrInsert πŸŸͺ β˜‘οΈ πŸ’‘
prefer-has Enforce using Map#has and Set#has πŸŸͺ β˜‘οΈ πŸ”§
prefer-in Prefer in to Object.hasOwn() and Object.prototype.hasOwnProperty.call() πŸŸͺ β˜‘οΈ πŸ’‘
prefer-object-keys-values Enforce using Object.keys() and Object.values() rather than Object.entries() πŸŸͺ β˜‘οΈ πŸ’‘
prefer-repeat Enforce usage of String.prototype.repeat 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ’‘
prefer-satisfies Prefer satisfies to type assertions β˜‘οΈ πŸ’‘ πŸ’­
prefer-string-join Enforce usage of String.prototype.join 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
primitive-valueof Forbid calling .valueOf() on a primitive βœ… β˜‘οΈ πŸ”§ πŸ’­
slim-try Enforce moving safe statements out of try blocks πŸŸͺ β˜‘οΈ πŸ”§
styled-button-has-type Disallow usage of styled.button without an explicit type attribute. 🟩 βœ… πŸŸͺ β˜‘οΈ
styled-transient-props Enforce using transient props in styled components to avoid polluting DOM elements with unknown props 🟩 βœ… πŸŸͺ β˜‘οΈ
suspicious-map-length Disallow suspicious use of .map().length 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ’‘
template-tostring Forbid calling .toString() inside template expressions πŸŸͺ β˜‘οΈ πŸ”§
unsafe-asserted-chain Disallow unsafe type assertions on optional chained expressions β˜‘οΈ πŸ’­
unused-object-assign Disallow unused Object.assign() expressions 🟩 βœ… πŸŸͺ β˜‘οΈ
unused-object-freeze Disallow unused Object.freeze() expressions 🟩 βœ… πŸŸͺ β˜‘οΈ
useless-as-const Forbid useless as const assertions πŸŸͺ β˜‘οΈ πŸ’‘
useless-assign Enforce directly returning a value instead of assigning it first to a variable πŸŸͺ β˜‘οΈ πŸ”§
useless-conditional-assign Enforce directly returning a value instead of conditionally assigning it first to a variable 🟩 βœ… πŸŸͺ β˜‘οΈ πŸ”§
useless-intermediary-variable Disallow unnecessary intermediary variables πŸŸͺ β˜‘οΈ πŸ’‘
useless-mock Forbid useless mocks in tests πŸŸͺ β˜‘οΈ
useless-required Forbid unnecessary use of Required<T> and Partial<T> β˜‘οΈ πŸ’‘ πŸ’­

About

100+ ESLint rules for modern TS projects

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Contributors