List of rules
- Recommended
- Fresh
- JSX
- React
- JSR
Requires overload signatures to be adjacent to each other. Details about adjacent-overload-signatures
Disallows the use of Typescript directives without a comment. Details about ban-ts-comment
Bans the use of primitive wrapper objects (e.g.
String
the object is a wrapper ofstring
the primitive) in addition to the non-explicitFunction
type and the misunderstoodObject
type. Details about ban-typesWarns the usage of unknown rule codes in ignore directives. Details about ban-unknown-rule-code
Requires
deno-lint-ignore
to be annotated with one or more rule names. Details about ban-untagged-ignoreRequires TODOs to be annotated with either a user tag (
@user
) or an issue reference (#issue
). Details about ban-untagged-todoWarns unused ignore directives. Details about ban-unused-ignore
Checks that a
<button>
JSX element has a validtype
attribute. The default value is"submit"
which is often not the desired behavior. Details about button-has-typeEnforces the use of camelCase in variable names. Details about camelcase
Verifies the correct usage of constructors and calls to
super()
. Details about constructor-superEnforces default parameter(s) to be last in the function signature. Details about default-param-last
Enforces the use of type-safe equality operators
===
and!==
instead of the more error prone==
and!=
operators. Details about eqeqeqRequires all functions to have explicit return types. Details about explicit-function-return-type
Requires all module exports to have fully typed declarations. Details about explicit-module-boundary-types
Requires
for
loop control variables to increment in the correct direction. Details about for-directionChecks correct naming for named fresh middleware export. Details about fresh-handler-export
Disallows event handlers in fresh server components. Details about fresh-server-event-handlers
Requires all property getter functions to return a value. Details about getter-return
Require
for-in
loops to include anif
statement. Details about guard-for-inEnforce a consistent JSX boolean value style. Passing
true
as the boolean value can be omitted with the shorthand syntax. Details about jsx-boolean-valueEnsure consistent use of curly braces around JSX expressions. Details about jsx-curly-braces
Ensure the
key
attribute is present when passing iterables into JSX. It allows frameworks to optimize checking the order of elements. Details about jsx-keyPass children as JSX children instead of as an attribute. Details about jsx-no-children-prop
Using JSX children together with
dangerouslySetInnerHTML
is invalid as they will be ignored. Details about jsx-no-danger-with-childrenDisallow duplicated JSX props. Later props will always overwrite earlier props often leading to unexpected results. Details about jsx-no-duplicate-props
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 jsx-no-useless-fragment
Spreading the same expression twice is typically a mistake and causes unnecessary computations. Details about jsx-props-no-spread-multi
Ensure that void elements in HTML don't have any children as that is not valid HTML. See
Void element
article on MDN for more information. Details about jsx-void-dom-elements-no-childrenEnforce conventional usage of array construction. Details about no-array-constructor
Requires that async promise executor functions are not used. Details about no-async-promise-executor
Requires
await
is not used in a for loop body. Details about no-await-in-loopDisallow
await
keyword inside a non-async function. Details about no-await-in-sync-fnRequires all functions called with any amount of
boolean
literals as parameters to use a self-documenting constant instead. Details about no-boolean-literal-for-argumentsRequires lexical declarations (
let
,const
,function
andclass
) in switchcase
ordefault
clauses to be scoped with brackets. Details about no-case-declarationsDisallows modifying variables of class declarations. Details about no-class-assign
Disallows comparing against negative zero (
-0
). Details about no-compare-neg-zeroDisallows the use of the assignment operator,
=
, in conditional statements. Details about no-cond-assignDisallows the use of the
console
global. Details about no-consoleDisallows modifying a variable declared as
const
. Details about no-const-assignDisallows the use of a constant expression in conditional test. Details about no-constant-condition
Disallows the use ASCII control characters in regular expressions. Details about no-control-regex
Prevent the use of
dangerouslySetInnerHTML
which can lead to XSS vulnerabilities if used incorrectly. Details about no-dangerDisallows the use of the
debugger
statement. Details about no-debuggerDisallows the deletion of variables. Details about no-delete-var
Warns the usage of the deprecated - Deno APIs. Details about no-deprecated-deno-api
Disallows using an argument name more than once in a function signature. Details about no-dupe-args
Disallows using a class member function name more than once. Details about no-dupe-class-members
Disallows using the same condition twice in an
if
/else if
statement. Details about no-dupe-else-ifDisallows duplicate keys in object literals. Details about no-dupe-keys
Disallows using the same case clause in a switch statement more than once. Details about no-duplicate-case
Disallows the use of empty block statements. Details about no-empty
Disallows using the empty character class in a regular expression. Details about no-empty-character-class
Disallows the declaration of an empty enum. Details about no-empty-enum
Disallows the declaration of an empty interface. Details about no-empty-interface
Disallows the use of empty patterns in destructuring. Details about no-empty-pattern
Disallows the use of
eval
. Details about no-evalDisallows the reassignment of exception parameters. Details about no-ex-assign
Disallows use of the
any
type. Details about no-explicit-anyDisallows the use of external imports. Details about no-external-imports
Disallows unnecessary boolean casts. Details about no-extra-boolean-cast
Disallows unnecessary non-null assertions. Details about no-extra-non-null-assertion
Disallows the implicit fallthrough of case statements. Details about no-fallthrough
Disallows the overwriting/reassignment of an existing function. Details about no-func-assign
Disallows assignment to native Javascript objects. Details about no-global-assign
Disallows the use of implicit exports in ["ambient" namespaces]. Details about no-implicit-declare-namespace-export
Disallows the
assert
keyword for import attributes. Details about no-import-assertionsDisallows reassignment of imported module bindings. Details about no-import-assign
Disallows easily inferrable types. Details about no-inferrable-types
Disallows variable or function definitions in nested blocks. Details about no-inner-declarations
Disallows specifying invalid regular expressions in RegExp constructors. Details about no-invalid-regexp
Warns the wrong usage of triple-slash reference directives. Details about no-invalid-triple-slash-reference
Disallows the use of non-space or non-tab whitespace characters. Details about no-irregular-whitespace
Disallows defining
constructor
s for interfaces ornew
for classes Details about no-misused-newDisallows the use of
namespace
andmodule
keywords in TypeScript code. Details about no-namespaceDisallows the use of
new
operators with built-inSymbol
s. Details about no-new-symbolDisallows the use of NodeJS global objects. Details about no-node-globals
Disallow non-null assertions after an optional chain expression. Details about no-non-null-asserted-optional-chain
Disallow non-null assertions using the
!
postfix operator. Details about no-non-null-assertionDisallows calling built-in global objects like functions. Details about no-obj-calls
Disallows expressing octal numbers via numeric literals beginning with
0
. Details about no-octalDisallows the use of NodeJS
process
global. Details about no-process-globalsDisallows the use of
Object.prototype
builtins directly. Details about no-prototype-builtinsDisallows redeclaration of variables, functions, parameters with the same name. Details about no-redeclare
Disallows multiple spaces in regular expression literals. Details about no-regex-spaces
Disallows self assignments. Details about no-self-assign
Disallows comparisons where both sides are exactly the same. Details about no-self-compare
Disallows returning values from setters. Details about no-setter-return
Disallows shadowing of restricted names. Details about no-shadow-restricted-names
Enforces specifying explicit references to paths in module specifiers. Details about no-sloppy-imports
Enforces using types that are explicit or can be simply inferred. Details about no-slow-types
Disallows sparse arrays. Details about no-sparse-arrays
Disallow sync function inside async function. Details about no-sync-fn-in-async-fn
Disallows assigning variables to
this
. Details about no-this-aliasDisallows use of
this
orsuper
before callingsuper()
in constructors. Details about no-this-before-superDisallow throwing literals as exceptions. Details about no-throw-literal
Disallows the use of top level await expressions. Details about no-top-level-await
Disallow the use of undeclared variables. Details about no-undef
Disallows the unreachable code after the control flow statements. Details about no-unreachable
Disallows the use of control flow statements within
finally
blocks. Details about no-unsafe-finallyDisallows the usage of negation operator
!
as the left operand of relational operators. Details about no-unsafe-negationDisallows unused labels. Details about no-unused-labels
Enforces all variables are used at least once. Details about no-unused-vars
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 no-useless-rename
Enforces the use of block scoped variables over more error prone function scoped variables. Block scoped variables are defined using
const
andlet
keywords. Details about no-varDisallows the use of the
window
object. Details about no-windowDisallows the use of Web APIs via the
window
object. Details about no-window-prefixDisallows the usage of
with
statements. Details about no-withRecommends using const assertion (
as const
) over explicitly specifying literal types or using type assertion. Details about prefer-as-constEnsures that the code is fully written in ASCII characters. Details about prefer-ascii
Recommends declaring variables with [
const
] over [let
]. Details about prefer-constRecommends the use of
namespace
keyword overmodule
keyword when declaring TypeScript module. Details about prefer-namespace-keywordSuggests using frozen intrinsics from
primordials
rather than the default globals. Details about prefer-primordialsDisallows async functions that have no await expression or await using declaration. Details about require-await
Disallows generator functions that have no
yield
. Details about require-yieldDisallows multiple variable definitions in the same declaration statement. Details about single-var-declarator
Disallow certain triple slash directives in favor of ES6-style import declarations. Details about triple-slash-reference
Disallows comparisons to
NaN
. Details about use-isnanRestricts the use of the
typeof
operator to a specific set of string literals. Details about valid-typeofEnforces type imports to be declared as type imports. Details about verbatim-module-syntax