List of rules

These lint rules are provided by the ende lint command. You can enable sets of rules in ende.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.

To turn a rule off, add it to lint.rules.exclude in ende.json, or suppress a single diagnostic in your code with a deno-lint-ignore comment.

Filter by tag:

  • adjacent-overload-signatures (recommended)

    Requires overload signatures to be adjacent to each other.

  • ban-ts-comment (recommended)

    Disallows the use of Typescript directives without a comment.

  • ban-types (recommended)

    Bans the use of primitive wrapper objects (e.g. String the object is a wrapper of string the primitive) in addition to the non-explicit Function type and the misunderstood Object type.

  • ban-unknown-rule-code (recommended)

    Warns the usage of unknown rule codes in ignore directives.

  • ban-untagged-ignore (recommended)

    Requires deno-lint-ignore to be annotated with one or more rule names.

  • ban-untagged-todo

    Requires TODOs to be annotated with either a user tag (@user) or an issue reference (#issue).

  • ban-unused-ignore (recommended)

    Warns unused ignore directives.

  • camelcase

    Enforces the use of camelCase in variable names.

  • constructor-super (recommended)

    Verifies the correct usage of constructors and calls to super().

  • default-param-last

    Enforces default parameter(s) to be last in the function signature.

  • eqeqeq

    Enforces the use of type-safe equality operators === and !== instead of the more error prone == and != operators.

  • explicit-function-return-type

    Requires all functions to have explicit return types.

  • explicit-module-boundary-types

    Requires all module exports to have fully typed declarations.

  • for-direction (recommended)

    Requires for loop control variables to increment in the correct direction.

  • getter-return (recommended)

    Requires all property getter functions to return a value.

  • guard-for-in

    Require for-in loops to include an if statement.

  • jsx-boolean-value (recommended, react, jsx)

    Enforce a consistent JSX boolean value style. Passing true as the boolean value can be omitted with the shorthand syntax.

  • jsx-button-has-type (recommended, react, jsx, fresh)

    Enforce <button> elements to have a type attribute. If a <button> is placed inside a <form> element it will act as a submit button by default which can be unexpected.

  • jsx-curly-braces (recommended, react, jsx)

    Ensure consistent use of curly braces around JSX expressions.

  • jsx-key (recommended, react, jsx)

    Ensure the key attribute is present when passing iterables into JSX. It allows frameworks to optimize checking the order of elements.

  • jsx-no-children-prop (recommended, react, jsx, fresh)

    Pass children as JSX children instead of as an attribute.

  • jsx-no-comment-text-nodes (recommended, react, jsx, fresh)

    JavaScript comments inside text nodes are rendered as plain text in JSX. This is often unexpected.

  • jsx-no-duplicate-props (recommended, react, jsx)

    Disallow duplicated JSX props. Later props will always overwrite earlier props often leading to unexpected results.

  • jsx-no-unescaped-entities (recommended, react, jsx, fresh)

    Leaving the > or } character in JSX is often undesired and difficult to spot. Enforce that these characters must be passed as strings.

  • jsx-no-useless-fragment (recommended, react, jsx, fresh)

    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.

  • jsx-props-no-spread-multi (recommended, react, jsx)

    Spreading the same expression twice is typically a mistake and causes unnecessary computations.

  • jsx-void-dom-elements-no-children (recommended, react, jsx, fresh)

    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.

  • no-array-constructor (recommended)

    Enforce conventional usage of array construction.

  • no-async-promise-executor (recommended)

    Requires that async promise executor functions are not used.

  • no-await-in-loop

    Requires await is not used in a for loop body.

  • no-await-in-sync-fn (recommended)

    Disallow await keyword inside a non-async function.

  • no-boolean-literal-for-arguments

    Requires all functions called with any amount of boolean literals as parameters to use a self-documenting constant instead.

  • no-case-declarations (recommended)

    Requires lexical declarations (let, const, function and class) in switch case or default clauses to be scoped with brackets.

  • no-class-assign (recommended)

    Disallows modifying variables of class declarations.

  • no-compare-neg-zero (recommended)

    Disallows comparing against negative zero (-0).

  • no-cond-assign (recommended)

    Disallows the use of the assignment operator, =, in conditional statements.

  • no-console

    Disallows the use of the console global.

  • no-const-assign (recommended)

    Disallows modifying a variable declared as const.

  • no-constant-condition (recommended)

    Disallows the use of a constant expression in conditional test.

  • no-control-regex (recommended)

    Disallows the use ASCII control characters in regular expressions.

  • no-debugger (recommended)

    Disallows the use of the debugger statement.

  • no-delete-var (recommended)

    Disallows the deletion of variables.

  • no-deprecated-deno-api (recommended)

    Warns the usage of the deprecated - Ende APIs.

  • no-dupe-args (recommended)

    Disallows using an argument name more than once in a function signature.

  • no-dupe-class-members (recommended)

    Disallows using a class member function name more than once.

  • no-dupe-else-if (recommended)

    Disallows using the same condition twice in an if/else if statement.

  • no-dupe-keys (recommended)

    Disallows duplicate keys in object literals.

  • no-duplicate-case (recommended)

    Disallows using the same case clause in a switch statement more than once.

  • no-empty (recommended)

    Disallows the use of empty block statements.

  • no-empty-character-class (recommended)

    Disallows using the empty character class in a regular expression.

  • no-empty-enum (recommended)

    Disallows the declaration of an empty enum.

  • no-empty-interface (recommended)

    Disallows the declaration of an empty interface.

  • no-empty-pattern (recommended)

    Disallows the use of empty patterns in destructuring.

  • no-eval

    Disallows the use of eval.

  • no-ex-assign (recommended)

    Disallows the reassignment of exception parameters.

  • no-explicit-any (recommended)

    Disallows use of the any type.

  • no-external-import

    Disallows the use of external imports.

  • no-extra-boolean-cast (recommended)

    Disallows unnecessary boolean casts.

  • no-extra-non-null-assertion (recommended)

    Disallows unnecessary non-null assertions.

  • no-fallthrough (recommended)

    Disallows the implicit fallthrough of case statements.

  • no-func-assign (recommended)

    Disallows the overwriting/reassignment of an existing function.

  • no-global-assign (recommended)

    Disallows assignment to native Javascript objects.

  • no-implicit-declare-namespace-export

    Disallows the use of implicit exports in ["ambient" namespaces].

  • no-import-assertions (recommended)

    Disallows the assert keyword for import attributes.

  • no-import-assign (recommended)

    Disallows reassignment of imported module bindings.

  • no-import-prefix (workspace)

    Ensure that all dependencies are declared in either ende.json or package.json.

  • no-inferrable-types

    Disallows easily inferrable types.

  • no-inner-declarations (recommended)

    Disallows variable or function definitions in nested blocks.

  • no-invalid-regexp (recommended)

    Disallows specifying invalid regular expressions in RegExp constructors.

  • no-invalid-triple-slash-reference (recommended)

    Warns the wrong usage of triple-slash reference directives.

  • no-irregular-whitespace (recommended)

    Disallows the use of non-space or non-tab whitespace characters.

  • no-misused-new (recommended)

    Disallows defining constructors for interfaces or new for classes

  • no-namespace (recommended)

    Disallows the use of namespace and module keywords in TypeScript code.

  • no-new-symbol (recommended)

    Disallows the use of new operators with built-in Symbols.

  • no-node-globals

    Disallows the use of NodeJS global objects.

  • no-non-null-asserted-optional-chain

    Disallow non-null assertions after an optional chain expression.

  • no-non-null-assertion

    Disallow non-null assertions using the ! postfix operator.

  • no-obj-calls (recommended)

    Disallows calling built-in global objects like functions.

  • no-octal (recommended)

    Disallows expressing octal numbers via numeric literals beginning with 0.

  • no-process-global

    Disallows the use of NodeJS process global.

  • no-prototype-builtins (recommended)

    Disallows the use of Object.prototype builtins directly.

  • no-redeclare (recommended)

    Disallows redeclaration of variables, functions, parameters with the same name.

  • no-regex-spaces (recommended)

    Disallows multiple spaces in regular expression literals.

  • no-self-assign (recommended)

    Disallows self assignments.

  • no-self-compare

    Disallows comparisons where both sides are exactly the same.

  • no-setter-return (recommended)

    Disallows returning values from setters.

  • no-shadow-restricted-names (recommended)

    Disallows shadowing of restricted names.

  • no-sloppy-imports (recommended)

    Enforces specifying explicit references to paths in module specifiers.

  • no-slow-types (jsr)

    Enforces using types that are explicit or can be simply inferred.

  • no-sparse-arrays

    Disallows sparse arrays.

  • no-sync-fn-in-async-fn

    Disallow sync function inside async function.

  • no-this-alias (recommended)

    Disallows assigning variables to this.

  • no-this-before-super (recommended)

    Disallows use of this or super before calling super() in constructors.

  • no-throw-literal

    Disallow throwing literals as exceptions.

  • no-top-level-await

    Disallows the use of top level await expressions.

  • no-undef

    Disallow the use of undeclared variables.

  • no-unreachable (recommended)

    Disallows the unreachable code after the control flow statements.

  • no-unsafe-finally (recommended)

    Disallows the use of control flow statements within finally blocks.

  • no-unsafe-negation (recommended)

    Disallows the usage of negation operator ! as the left operand of relational operators.

  • no-unused-labels (recommended)

    Disallows unused labels.

  • no-unused-vars (recommended)

    Enforces all variables are used at least once.

  • no-unversioned-import (recommended)

    Ensure that inline dependency imports have a version specifier.

  • no-useless-rename

    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.

  • no-var (recommended)

    Enforces the use of block scoped variables over more error prone function scoped variables. Block scoped variables are defined using const and let keywords.

  • no-window (recommended)

    Disallows the use of the window object.

  • no-window-prefix (recommended)

    Disallows the use of Web APIs via the window object.

  • no-with (recommended)

    Disallows the usage of with statements.

  • prefer-as-const (recommended)

    Recommends using const assertion (as const) over explicitly specifying literal types or using type assertion.

  • prefer-ascii

    Ensures that the code is fully written in ASCII characters.

  • prefer-const (recommended)

    Recommends declaring variables with [const] over [let].

  • prefer-namespace-keyword (recommended)

    Recommends the use of namespace keyword over module keyword when declaring TypeScript module.

  • prefer-primordials

    Suggests using frozen intrinsics from primordials rather than the default globals.

  • react-no-danger (react, fresh)

    Prevent the use of dangerouslySetInnerHTML which can lead to XSS vulnerabilities if used incorrectly.

  • react-no-danger-with-children (react, fresh)

    Using JSX children together with dangerouslySetInnerHTML is invalid as they will be ignored.

  • react-rules-of-hooks (react, fresh)

    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.

  • require-await (recommended)

    Disallows async functions that have no await expression or await using declaration.

  • require-yield (recommended)

    Disallows generator functions that have no yield.

  • single-var-declarator

    Disallows multiple variable definitions in the same declaration statement.

  • triple-slash-reference

    Disallow certain triple slash directives in favor of ES6-style import declarations.

  • use-isnan (recommended)

    Disallows comparisons to NaN.

  • valid-typeof (recommended)

    Restricts the use of the typeof operator to a specific set of string literals.

  • verbatim-module-syntax (jsr)

    Enforces type imports to be declared as type imports.