Disallow calling `new` on a Promise static method.
Disallow return statements in `finally()`.
Disallow creating new promises with paths that resolve multiple times.
Prefer class properties to assignment of literals in constructors.
Prefer early returns over full-body conditional wrapping in function declarations.
Prefer that screaming snake case variables always be defined using `const`, and always appear at module scope.
Restrict the number of returned items from React hooks.
Prevent module imports between components.
Prefer singular TypeScript enums.
Sections of code should not be commented out
"if ... else if" constructs should end with "else" clauses
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression
Mergeable "if" statements should be combined
Boolean literals should not be used in comparisons
Return of boolean expressions should not be wrapped into an "if-then-else" statement
Track uses of "FIXME" tags
Track uses of "TODO" tags
String literals should not be duplicated
Initial values of parameters, caught exceptions, and loop variables should not be ignored
A "while" loop should be used instead of a "for" loop
Public "static" fields should be read-only
"switch" statements should not have too many "case" clauses
Local variables should not be declared and then immediately returned or thrown
Identical expressions should not be used on both sides of a binary operator
"switch" statements should not be nested
Objects should not be created to be dropped immediately without being used
Unused assignments should be removed
"if/else if" chains and "switch" cases should not have the same condition
Two branches in a conditional structure should not have exactly the same implementation
Boolean checks should not be inverted
"for" loop increment clauses should modify the loops' counters
Values should not be uselessly incremented
Return values from functions without side effects should not be ignored
Object literal syntax should be used
Boolean expressions should not be gratuitous
"catch" clauses should do more than rethrow
Non-existent operators '=+', '=-' and '=!' should not be used
Default export names and file names should match
Ternary operators should not be nested
Destructuring syntax should be used for assignments
Jump statements should not be redundant
The return value of void functions should not be used
Cognitive Complexity of functions should not be too high
"super()" should be invoked appropriately
All branches in a conditional structure should not have exactly the same implementation
Errors should not be created without being thrown
Collection contents should be used
Collection elements should not be replaced unconditionally
Functions should not have identical implementations
Empty collections should not be accessed or iterated
Type aliases should be used
Template literals should not be nested
Shorthand promises should be used
Optional property declarations should not use both '?' and 'undefined' syntax
Optional boolean parameters should have default value
Promise rejections should not be caught by "try" blocks
Constructors should not contain asynchronous operations
Require that function overload signatures be consecutive
Require consistently using either `T[]` or `Array<T>` for arrays
Disallow awaiting a value that is not a Thenable
Disallow `@ts-<directive>` comments or require descriptions after directives
Enforce specifying generic type arguments on type annotation or constructor name of a constructor call
Require or disallow the `Record` type
Enforce consistent usage of type assertions
Enforce type definitions to consistently use either `interface` or `type`
Enforce consistent usage of type imports
Enforce default parameters to be last
Enforce dot notation whenever possible
Require explicit return types on functions and class methods
Require explicit accessibility modifiers on class properties and methods
Enforce using a particular method signature syntax
Disallow generic `Array` constructors
Disallow non-null assertion in locations that may be confusing
Require expressions of type void to appear in statement position
Disallow duplicate class members
Disallow duplicate enum member values
Disallow duplicate constituents of union or intersection types
Disallow using the `delete` operator on computed key expressions
Disallow empty functions
Disallow accidentally using the "empty object" type
Disallow the `any` type
Disallow extra non-null assertions
Disallow classes used as namespaces
Require Promise-like statements to be handled appropriately
Disallow iterating over an array with a for-in loop
Disallow the use of `eval()`-like functions
Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers
Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean
Disallow `void` type outside of generic or return types
Disallow the `void` operator except when used to discard a value
Enforce valid definition of `new` and `constructor`
Disallow Promises in places not designed to handle them
Disallow enums from having both number and string members
Disallow TypeScript namespaces
Disallow non-null assertions in the left operand of a nullish coalescing operator
Disallow non-null assertions after an optional chain expression
Disallow non-null assertions using the `!` postfix operator
Disallow variable redeclaration
Disallow members of unions and intersections that do nothing or override type information
Disallow invocation of `require()`
Disallow variable declarations from shadowing variables declared in the outer scope
Disallow aliasing `this`
Disallow unnecessary equality comparisons against boolean literals
Disallow conditionals where the type is always truthy or always falsy
Disallow unnecessary assignment of constructor property parameter
Disallow unnecessary namespace qualifiers
Disallow unnecessary template expressions
Disallow type arguments that are equal to the default
Disallow type assertions that do not change the type of an expression
Disallow unnecessary constraints on generic types
Disallow type parameters that aren't used multiple times
Disallow calling a function with a value with type `any`
Disallow assigning a value with type `any` to variables and properties
Disallow calling a value with type `any`
Disallow unsafe declaration merging
Disallow comparing an enum value with a non-enum value
Disallow using the unsafe built-in Function type
Disallow member access on a value with type `any`
Disallow returning a value with type `any` from a function
Require unary negation to take a number
Disallow unused expressions
Disallow unused variables
Disallow the use of variables before they are defined
Disallow unnecessary constructors
Disallow using confusing built-in primitive class wrappers
Enforce non-null assertions over explicit type assertions
Disallow throwing non-`Error` values as exceptions
Enforce the use of `as const` over literal type
Require destructuring from arrays and/or objects
Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result
Enforce the use of `for-of` loop over the standard `for` loop where possible
Enforce using function types instead of interfaces with call signatures
Enforce `includes` method over `indexOf` method
Require all enum members to be literal values
Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules
Enforce using the nullish coalescing operator instead of logical assignments or chaining
Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects
Require using Error objects as Promise rejection reasons
Require private members to be marked as `readonly` if they're never modified outside of the constructor
Enforce using type parameter when calling `Array#reduce` instead of using a type assertion
Enforce that `this` is used when only `this` type is returned
Require any function or method that returns a Promise to be marked async
Require both operands of addition to be the same type and be `bigint`, `number`, or `string`
Enforce template literal expressions to be of `string` type
Enforce consistent awaiting of returned promises
Disallow certain types in boolean expressions
Require switch-case statements to be exhaustive
Disallow certain triple slash directives in favor of ES6-style import declarations
Enforce unbound methods are called with their expected scope
Disallow two overloads that could be unified into one with a union or an optional/rest parameter
Enforce typing arguments in Promise rejection callbacks as `unknown`
Avoid using TypeScript's enums.
Avoid using TypeScript's import aliases.
Avoid using TypeScript's namespaces.
Avoid using TypeScript's class parameter properties.
Enforce a specific parameter name in catch clauses.
Use destructured variables over properties.
Move function definitions to the highest possible scope.
Enforce no spaces between braces.
Enforce passing a `message` value when creating a built-in error.
Enforce a case style for filenames.
Prefer `for…of` over the `forEach` method.
Disallow member access from await expression.
Disallow empty files.
Do not use a `for` loop that can be replaced with a `for-of` loop.
Disallow immediate mutation after variable assignment.
Disallow identifiers starting with `new` or `class`.
Disallow `if` statements as the only statement in `if` blocks without `else`.
Disallow negated conditions.
Disallow negated expression in equality check.
Disallow nested ternary expressions.
Disallow the use of objects as default parameters.
Disallow passing single-element arrays to `Promise` methods.
Disallow classes that only have static members.
Disallow unreadable array destructuring.
Disallow unused object properties.
Disallow useless values or fallbacks in `Set`, `Map`, `WeakSet`, or `WeakMap`.
Disallow returning/yielding `Promise.resolve/reject()` in async functions or promise callbacks
Disallow unnecessary spread.
Disallow useless `undefined`.
Enforce proper case for numeric literals.
Prefer default parameters over reassignment.
Prefer `export…from` when re-exporting.
Prefer `.includes()` over `.indexOf()`, `.lastIndexOf()`, and `Array#some()` when checking for existence or non-existence.
Prefer using a logical operator over a ternary.
Prefer `Math.min()` and `Math.max()` over ternaries for simple comparisons.
Prefer omitting the `catch` binding parameter.
Prefer `Set#has()` over `Array#includes()` when checking for existence or non-existence.
Enforce combining multiple `Array#push()`, `Element#classList.{add,remove}()`, and `importScripts()` into one call.
Prefer `switch` over multiple `else-if`.
Prefer ternary expressions over simple `if-else` statements.
Prevent abbreviations.
Enforce consistent brace style for `case` clauses.
Fix whitespace-insensitive template indentation.
Require `new` when creating an error.
Checks that `@access` tags have a valid value.
Reports invalid alignment of JSDoc block asterisks.
Checks for dupe `@param` names, that nested param names have roots, and that parameter names in function declarations match JSDoc param names.
Ensures that property names in JSDoc are not duplicated on the same block and that nested properties have defined roots.
Reports types deemed invalid (customizable and with defaults, for preventing and/or recommending replacements).
Converts non-JSDoc comments preceding or following nodes into JSDoc ones
Checks tags that are expected to be empty (e.g., `@abstract` or `@async`), reporting if they have content
Prohibits use of `@implements` on non-constructor functions (to enforce the tag only being used on classes/constructors).
This rule reports doc comments that only restate their attached name.
Controls how and whether JSDoc blocks can be expressed as single or multiple line blocks.
If tags are present, this rule will prevent empty lines in the block description. If no tags are present, this rule will prevent extra empty lines in the block description.
Removes empty blocks with nothing but possibly line breaks
This rule reports defaults being used on the relevant portion of `@param` or `@default`.
Prevents use of multiple asterisks at the beginning of lines.
This rule reports types being used on `@param` or `@returns` (redundant with TypeScript).
Requires that each JSDoc line starts with an `*`.
Requires that all functions (and potentially other contexts) have a description.
Requires that block description, explicit `@description`, and `@param`/`@returns` tag descriptions are written in complete sentences.
Requires a hyphen before the `@param` description (and optionally before `@property` descriptions).
Requires that all function parameters are documented with a `@param` tag.
Requires that each `@param` tag has a `description` value.
Requires that all `@param` tags have names.
Requires that all `@typedef` and `@namespace` tags have `@property` when their type is a plain `object`, `Object`, or `PlainObject`.
Requires that each `@property` tag has a `description` value.
Requires that all `@property` tags have names.
Requires that returns are documented with `@returns`.
Requires a return statement in function body if a `@returns` tag is specified in JSDoc comment(and reports if multiple `@returns` tags are present).
Requires that the `@returns` tag has a `description` value (not including `void`/`undefined` type returns).
Requires `@template` tags be present when type parameters are used.
Ensures that if a `@yields` is present that a `yield` (or `yield` with a value) is present in the function body (or that if a `@next` is present that there is a yield with a return value present).
Sorts tags by a specified sequence according to tag name, optionally adding line breaks between tag groups.
Enforce consistent use of `output` assertions in rule tests
Require fixer functions to return a fix
Enforce the order of meta properties
Disallow usage of deprecated methods on rule context objects
Disallow the version of `context.report()` with multiple arguments
Disallow identical tests
Disallow using the `meta.replacedBy` rule property
Disallow rules `meta.schema` properties to include defaults
Disallow `messageId`s that are missing from `meta.messages`
Disallow missing placeholders in rule report messages
Disallow the test case property `only`
Disallow using `in` to narrow node types instead of looking at properties
Disallow unused `messageId`s in `meta.messages`
Disallow unused placeholders in rule report messages
Disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()`
Require using `messageId` instead of `message` or `desc` to report rule violations
Disallow function-style rules
Disallow invalid RuleTester test cases where the `output` matches the `code`
Require using placeholders for dynamic report messages
Require using `replaceText()` instead of `replaceTextRange()`
Enforce a consistent format for rule report messages
Require only rules with options to implement a `meta.defaultOptions` property
Require rules to implement a `meta.docs.description` property with the correct format
Require rules to implement a `meta.docs.recommended` property
Require rules to implement a `meta.docs.url` property
Require rules to implement a `meta.fixable` property
Require suggestable rules to implement a `meta.hasSuggestions` property
Require rules `meta.schema` properties to include descriptions
Require rules to implement a `meta.schema` property
Require rules to implement a `meta.type` property
Require test cases to have a `name` property under certain conditions
Require the properties of a test case to be placed in a consistent order
Enforce consistent usage of shorthand strings for test cases with no options
Enforce that all test cases with names have unique names
Enforces the use of lua truthiness
Disallow the use of LuaTuple in conditional expressions
Disallow values of type `any`. Use `unknown` instead
Disallow usage of pairs() and ipairs() with Array<T>
Disallow merging enum declarations
Disallow using `export =` on a let variable
Disallow iterating with a for-in loop
Disallow the use of function expression names
Disallow getters and setters
Enforce the use of `.` instead of `:` for method calls
Disallow the use of Luau reserved keywords as identifiers
Disallow merging namespace declarations
Disallow usage of the `null` keyword
Enforce DataType math methods over operators
Disallow .new() on objects without a .new() method
Disallow spread elements not last in a list of arguments
Disallow the use of private identifiers (`#`)
Enforce that only npm scopes listed in typeRoots can be imported
Disallow unsupported syntax in roblox-ts
Disallow usage of LuaTuple type keyword and $tuple() calls
Disallow using `typeof` to check for value types
Enforces the use of Players.GetPlayers() instead of Players.GetChildren()
Enforce use of task library alternatives
Enforce use of .size() instead of .length or .size property
Enforce explicitly comparing the `size` property of a value
Require `math.min()` and `math.max()` over ternaries for simple comparisons
Use stylua to format lua files
Enforce consistent arrow function return style based on length, multiline expressions, JSX usage, and export context
Disallow anonymous arrow functions as export default declarations
Enforce sorted variable declarations.
Enforce sorted intersection types.
Enforce sorted heritage clauses.
Enforce sorted arrays before include method.
Enforce sorted named imports.
Enforce sorted object types.
Enforce sorted union types.
Enforce sorted switch cases.
Enforce sorted decorators.
Enforce sorted interface properties.
Enforce sorted JSX props.
Enforce sorted modules.
Enforce sorted classes.
Enforce sorted imports.
Enforce sorted exports.
Enforce sorted objects.
Enforce sorted TypeScript enums.
Enforce sorted sets.
Enforce sorted Map elements.
Enforce `test` and `it` usage conventions
Enforce assertion to be made in a test body
Enforces a maximum number assertion calls in a test body
Enforces a maximum depth to nested describe calls
Disallow alias methods
Disallow commented out tests
Disallow calling `expect` conditionally
Disallow conditional logic in tests
Disallow disabled tests
Disallow using a callback in asynchronous tests and hooks
Disallow duplicate setup and teardown hooks
Disallow using `exports` in files containing tests
Disallow focused tests
Disallow identical titles
Disallow using `expect` outside of `it` or `test` blocks
Require using `.only` and `.skip` over `f` and `x`
Disallow explicitly returning from tests
Disallow using `jest.mock()` factories without an explicit type parameter
Enforce padding around Jest functions
Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`
Suggest using the built-in comparison matchers
Prefer using `.each` rather than manual loops
Prefer having the last statement in a test be an assertion
Suggest using the built-in equality matchers
Prefer having hooks in a consistent order
Enforce lowercase test names
Prefer mock resolved/rejected shorthands for promises
Suggest using `toStrictEqual()`
Suggest using `toBe()` for primitive literals
Suggest using `toContain()`
Suggest using `toHaveLength()`
Suggest using `test.todo`
Require setup and teardown code to be within a hook
Require a message for `toThrow()`
Require test cases and hooks to be inside a `describe` block
Enforce unbound methods are called with their expected scope
Enforce valid `describe()` callback
Require promises that have expectations in their chain to be valid
Enforce valid `expect()` usage
Enforce valid titles
Prevents dollar signs from being inserted as text nodes before expressions.
Prevents comments from being inserted as text nodes.
Disallow class components except for error boundaries.
Disallow `cloneElement`.
Replace usages of `componentWillMount` with `UNSAFE_componentWillMount`.
Replace usages of `componentWillReceiveProps` with `UNSAFE_componentWillReceiveProps`.
Replace usages of `componentWillUpdate` with `UNSAFE_componentWillUpdate`.
Disallow `createRef` in function components.
Disallow `defaultProps` property in favor of ES6 default parameters.
Disallow direct mutation of `this.state`.
Disallow duplicate `key` on elements in the same array or a list of `children`.
Replaces usages of `forwardRef` with passing `ref` as a prop.
Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).
Prevents problematic leaked values from being rendered.
Enforces that all components have a `displayName` which can be used in devtools.
Enforces that all contexts have a `displayName` which can be used in devtools.
Disallow missing `key` on items in list rendering.
Prevents incorrect usage of `captureOwnerStack`.
Disallow nesting component definitions inside other components.
Disallow nesting lazy component declarations inside other components.
Disallow `propTypes` in favor of TypeScript or another type-checking solution.
Disallow `shouldComponentUpdate` when extending `React.PureComponent`.
Disallow calling `this.setState` in `componentDidMount` outside of functions, such as callbacks.
Disallow calling `this.setState` in `componentDidUpdate` outside of functions, such as callbacks.
Disallow calling `this.setState` in `componentWillUpdate` outside of functions, such as callbacks.
Replaces string refs with callback refs.
Prevents the use of unnecessary `key` props on JSX elements when rendering lists.
Disallow unnecessary usage of `useCallback`.
Disallow unnecessary usage of `useMemo`.
Enforces that a function with the `use` prefix should use at least one Hook inside of it.
Warns the usage of `UNSAFE_componentWillMount` in class components.
Warns the usage of `UNSAFE_componentWillReceiveProps` in class components.
Warns the usage of `UNSAFE_componentWillUpdate` in class components.
Prevents non-stable values (i.e. object literals) from being used as a value for `Context.Provider`.
Prevents using referential-type values as default props in object destructuring.
Warns unused class component methods and properties.
Warns component props that are defined but never used.
Warns unused class component state.
Replaces usages of `useContext` with `use`.
Disallow useless `forwardRef` calls on components that don't use `ref`s.
Disallow useless fragment elements.
Enforces destructuring assignment for component props and context.
Enforces React is imported via a namespace import.
Enforces read-only props in components.
Enforces function calls made inside `useState` to be wrapped in an `initializer function`.
Verifies the list of dependencies for Hooks like useEffect and similar
Enforces the Rules of Hooks
Validates that components are static, not recreated every render. Components that are recreated dynamically can reset state and trigger excessive re-rendering
Validates usage of the useMemo() hook against common mistakes. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
Validates against higher order functions defining nested components or hooks. Components and hooks should be defined at the module level
Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference [matches or exceeds the existing manual memoization](https://react.dev/learn/react-compiler/introduction#what-should-i-do-about-usememo-usecallback-and-reactmemo)
Validates against usage of libraries which are incompatible with memoization (manual or automatic)
Validates against mutating props, state, and other values that [are immutable](https://react.dev/reference/rules/components-and-hooks-must-be-pure#props-and-state-are-immutable)
Validates against assignment/mutation of globals during render, part of ensuring that [side effects must render outside of render](https://react.dev/reference/rules/components-and-hooks-must-be-pure#side-effects-must-run-outside-of-render)
Validates correct usage of refs, not reading/writing during render. See the "pitfalls" section in [`useRef()` usage](https://react.dev/reference/react/useRef#usage)
Validates against calling setState synchronously in an effect, which can lead to re-renders that degrade performance
Validates usage of error boundaries instead of try/catch for errors in child components
Validates that [components/hooks are pure](https://react.dev/reference/rules/components-and-hooks-must-be-pure) by checking that they do not call known-impure functions
Validates against setting state during render, which can trigger additional renders and potential infinite render loops
Validates against syntax that we do not plan to support in React Compiler
Validates the compiler configuration options
Validates configuration of [gating mode](https://react.dev/reference/react-compiler/gating)
Enforces context name to be a valid component name with the suffix `Context`.
Enforces consistent file naming conventions.
Enforces destructuring and symmetric naming of `useState` hook value and setter.
Disallow or enforce spaces inside of brackets
Require or disallow trailing commas
Enforce consistent comma style
Enforce consistent indentation
Enforce consistent spacing between keys and values in object literal properties
Disallow BigInt literals
Disallow binary expression
Disallow binary numeric literals
Disallow duplicate keys in object literals
Disallow escape sequences in identifiers.
Disallow leading or trailing decimal points in numeric literals
Disallow hexadecimal numeric literals
Disallow Infinity
Disallow multiline strings
Disallow NaN
Disallow number property keys
Disallow numeric separators
Disallow octal escape sequences in string literals
Disallow octal numeric literals
Disallow legacy octal literals
Disallow parentheses around the expression
Disallow plus sign
Disallow RegExp literals
Disallow sparse arrays
Disallow template literals
Disallow `undefined`
Disallow Unicode code point escape sequences.
Disallow unnecessary escape usage
Enforce consistent line breaks inside braces
Enforce consistent spacing inside braces
Enforce placing object properties on separate lines
Require quotes around object literal property names
Enforce use of double or single quotes
Require object keys to be sorted
Disallow spaces after unary operators
Disallow invalid number for JSON
Enforce using "catalog:" in `package.json`
Enforce using valid catalog in `package.json`
Prefer having pnpm settings in `pnpm-workspace.yaml` instead of `package.json`. This requires pnpm v10.6+, see https://github.com/orgs/pnpm/discussions/9037.
Disallow unused catalogs in `pnpm-workspace.yaml`
Disallow duplicate catalog items in `pnpm-workspace.yaml`
Enforce consistent line breaks after `:` indicator
Enforce consistent line breaks after `?` indicator
Require or disallow block style mappings.
Enforce consistent line breaks after `-` indicator
Require or disallow block style sequences.
Enforce YAML file extension
Enforce consistent line breaks inside braces
Enforce consistent spacing inside braces
Enforce linebreaks after opening and before closing flow sequence brackets