List of rules
These lint rules are provided by the deno lint command. You can enable sets of rules in deno.json(c) by adding their tags (e.g. recommended, react) to the lint.rules.tags array.
If no tag is provided, then the recommended set of rules will be enabled by default.
- Recommended 
- Fresh 
- JSX 
- React 
- JSR 
- Workspace 
- Requires overload signatures to be adjacent to each other. Details about undefined 
- Disallows the use of Typescript directives without a comment. Details about undefined 
- Bans the use of primitive wrapper objects (e.g. - Stringthe object is a wrapper of- stringthe primitive) in addition to the non-explicit- Functiontype and the misunderstood- Objecttype. Details about undefined
- Warns the usage of unknown rule codes in ignore directives. Details about undefined 
- Requires - deno-lint-ignoreto be annotated with one or more rule names. Details about undefined
- Requires TODOs to be annotated with either a user tag ( - @user) or an issue reference (- #issue). Details about undefined
- Warns unused ignore directives. Details about undefined 
- Enforces the use of camelCase in variable names. Details about undefined 
- Verifies the correct usage of constructors and calls to - super(). Details about undefined
- Enforces default parameter(s) to be last in the function signature. Details about undefined 
- Enforces the use of type-safe equality operators - ===and- !==instead of the more error prone- ==and- !=operators. Details about undefined
- Requires all functions to have explicit return types. Details about undefined 
- Requires all module exports to have fully typed declarations. Details about undefined 
- Requires - forloop control variables to increment in the correct direction. Details about undefined
- Checks correct naming for named fresh middleware export. Details about undefined 
- Disallows event handlers in fresh server components. Details about undefined 
- Requires all property getter functions to return a value. Details about undefined 
- Require - for-inloops to include an- ifstatement. Details about undefined
- Enforce a consistent JSX boolean value style. Passing - trueas the boolean value can be omitted with the shorthand syntax. Details about undefined
- Enforce - <button>elements to have a- typeattribute. If a- <button>is placed inside a- <form>element it will act as a submit button by default which can be unexpected. Details about undefined
- Ensure consistent use of curly braces around JSX expressions. Details about undefined 
- Ensure the - keyattribute is present when passing iterables into JSX. It allows frameworks to optimize checking the order of elements. Details about undefined
- Pass children as JSX children instead of as an attribute. Details about undefined 
- JavaScript comments inside text nodes are rendered as plain text in JSX. This is often unexpected. Details about undefined 
- Disallow duplicated JSX props. Later props will always overwrite earlier props often leading to unexpected results. Details about undefined 
- Leaving the - >or- }character in JSX is often undesired and difficult to spot. Enforce that these characters must be passed as strings. Details about undefined
- Fragments are only necessary at the top of a JSX "block" and only when there are multiple children. Fragments are not needed in other scenarios. Details about undefined 
- Spreading the same expression twice is typically a mistake and causes unnecessary computations. Details about undefined 
- Ensure that void elements in HTML don't have any children as that is not valid HTML. See - Void elementarticle on MDN for more information. Details about undefined
- Enforce conventional usage of array construction. Details about undefined 
- Requires that async promise executor functions are not used. Details about undefined 
- Requires - awaitis not used in a for loop body. Details about undefined
- Disallow - awaitkeyword inside a non-async function. Details about undefined
- Requires all functions called with any amount of - booleanliterals as parameters to use a self-documenting constant instead. Details about undefined
- Requires lexical declarations ( - let,- const,- functionand- class) in switch- caseor- defaultclauses to be scoped with brackets. Details about undefined
- Disallows modifying variables of class declarations. Details about undefined 
- Disallows comparing against negative zero ( - -0). Details about undefined
- Disallows the use of the assignment operator, - =, in conditional statements. Details about undefined
- Disallows the use of the - consoleglobal. Details about undefined
- Disallows modifying a variable declared as - const. Details about undefined
- Disallows the use of a constant expression in conditional test. Details about undefined 
- Disallows the use ASCII control characters in regular expressions. Details about undefined 
- Disallows the use of the - debuggerstatement. Details about undefined
- Disallows the deletion of variables. Details about undefined 
- Warns the usage of the deprecated - Deno APIs. Details about undefined 
- Disallows using an argument name more than once in a function signature. Details about undefined 
- Disallows using a class member function name more than once. Details about undefined 
- Disallows using the same condition twice in an - if/- else ifstatement. Details about undefined
- Disallows duplicate keys in object literals. Details about undefined 
- Disallows using the same case clause in a switch statement more than once. Details about undefined 
- Disallows the use of empty block statements. Details about undefined 
- Disallows using the empty character class in a regular expression. Details about undefined 
- Disallows the declaration of an empty enum. Details about undefined 
- Disallows the declaration of an empty interface. Details about undefined 
- Disallows the use of empty patterns in destructuring. Details about undefined 
- Disallows the use of - eval. Details about undefined
- Disallows the reassignment of exception parameters. Details about undefined 
- Disallows use of the - anytype. Details about undefined
- Disallows the use of external imports. Details about undefined 
- Disallows unnecessary boolean casts. Details about undefined 
- Disallows unnecessary non-null assertions. Details about undefined 
- Disallows the implicit fallthrough of case statements. Details about undefined 
- Disallows the overwriting/reassignment of an existing function. Details about undefined 
- Disallows assignment to native Javascript objects. Details about undefined 
- Disallows the use of implicit exports in ["ambient" namespaces]. Details about undefined 
- Disallows the - assertkeyword for import attributes. Details about undefined
- Disallows reassignment of imported module bindings. Details about undefined 
- Ensure that all dependencies are declared in either - deno.jsonor- package.json. Details about undefined
- Disallows easily inferrable types. Details about undefined 
- Disallows variable or function definitions in nested blocks. Details about undefined 
- Disallows specifying invalid regular expressions in RegExp constructors. Details about undefined 
- Warns the wrong usage of triple-slash reference directives. Details about undefined 
- Disallows the use of non-space or non-tab whitespace characters. Details about undefined 
- Disallows defining - constructors for interfaces or- newfor classes Details about undefined
- Disallows the use of - namespaceand- modulekeywords in TypeScript code. Details about undefined
- Disallows the use of - newoperators with built-in- Symbols. Details about undefined
- Disallows the use of NodeJS global objects. Details about undefined 
- Disallow non-null assertions after an optional chain expression. Details about undefined 
- Disallow non-null assertions using the - !postfix operator. Details about undefined
- Disallows calling built-in global objects like functions. Details about undefined 
- Disallows expressing octal numbers via numeric literals beginning with - 0. Details about undefined
- Disallows the use of NodeJS - processglobal. Details about undefined
- Disallows the use of - Object.prototypebuiltins directly. Details about undefined
- Disallows redeclaration of variables, functions, parameters with the same name. Details about undefined 
- Disallows multiple spaces in regular expression literals. Details about undefined 
- Disallows self assignments. Details about undefined 
- Disallows comparisons where both sides are exactly the same. Details about undefined 
- Disallows returning values from setters. Details about undefined 
- Disallows shadowing of restricted names. Details about undefined 
- Enforces specifying explicit references to paths in module specifiers. Details about undefined 
- Enforces using types that are explicit or can be simply inferred. Details about undefined 
- Disallows sparse arrays. Details about undefined 
- Disallow sync function inside async function. Details about undefined 
- Disallows assigning variables to - this. Details about undefined
- Disallows use of - thisor- superbefore calling- super()in constructors. Details about undefined
- Disallow throwing literals as exceptions. Details about undefined 
- Disallows the use of top level await expressions. Details about undefined 
- Disallow the use of undeclared variables. Details about undefined 
- Disallows the unreachable code after the control flow statements. Details about undefined 
- Disallows the use of control flow statements within - finallyblocks. Details about undefined
- Disallows the usage of negation operator - !as the left operand of relational operators. Details about undefined
- Disallows unused labels. Details about undefined 
- Enforces all variables are used at least once. Details about undefined 
- Ensure that inline dependency imports have a version specifier. Details about undefined 
- Disallow useless rename operations where both the original and new name are exactly the same. This is often a leftover from a refactoring procedure and can be safely removed. Details about undefined 
- Enforces the use of block scoped variables over more error prone function scoped variables. Block scoped variables are defined using - constand- letkeywords. Details about undefined
- Disallows the use of the - windowobject. Details about undefined
- Disallows the use of Web APIs via the - windowobject. Details about undefined
- Disallows the usage of - withstatements. Details about undefined
- Recommends using const assertion ( - as const) over explicitly specifying literal types or using type assertion. Details about undefined
- Ensures that the code is fully written in ASCII characters. Details about undefined 
- Recommends declaring variables with [ - const] over [- let]. Details about undefined
- Recommends the use of - namespacekeyword over- modulekeyword when declaring TypeScript module. Details about undefined
- Suggests using frozen intrinsics from - primordialsrather than the default globals. Details about undefined
- Prevent the use of - dangerouslySetInnerHTMLwhich can lead to XSS vulnerabilities if used incorrectly. Details about undefined
- Using JSX children together with - dangerouslySetInnerHTMLis invalid as they will be ignored. Details about undefined
- Ensure that hooks are called correctly in React/Preact components. They must be called at the top level of a component and not inside a conditional statement or a loop. Details about undefined 
- Disallows async functions that have no await expression or await using declaration. Details about undefined 
- Disallows generator functions that have no - yield. Details about undefined
- Disallows multiple variable definitions in the same declaration statement. Details about undefined 
- Disallow certain triple slash directives in favor of ES6-style import declarations. Details about undefined 
- Disallows comparisons to - NaN. Details about undefined
- Restricts the use of the - typeofoperator to a specific set of string literals. Details about undefined
- Enforces type imports to be declared as type imports. Details about undefined