@angular-eslint/component-class-suffix
Detect if component doesn't have a descriptive suffix depending on its use, such as Component, Directive, Module, Pipe, or Service
The Codiga Static Analysis engine checks TypeScript code and supports many popular libraries. If you are using React, NextJS, Vue or Angular: the engine will flag any issue in your codebase. Automate your code reviews with Codiga and merge with confidence.
Detect if component doesn't have a descriptive suffix depending on its use, such as Component, Directive, Module, Pipe, or Service
Detect if component selector isn't a hyphenated, lowercase value or doesn't have a descriptive prefix to represent the feature area or the application itself.
Detect if directive selector isn't a hyphenated, lowercase value or doesn't have a descriptive prefix to represent the feature area or the application itself.
Detect empty lifecycle methods
Prevent any Output values with prefix 'on' as this prefix should be used only for event handler methods to follow web conventions
Prefer ChangeDetectionStrategy.OnPush as the changeDetection strategy for your @Component
Detect any component encapsulation that is ViewEncapsulation.None. It should be either ViewEncapsulation.ShadowDom or ViewEncapsulation.Emulated
Detect if there are missing any implements keyword for every lifecycle hook you use (e.g if using the lifecycle method ngAfterViewInit, the AfterViewInit interface should be implemented)
Detect any <Link> without an <a> child, they should have passHref=true parameter
Detect any native <img> element, it should be replaced by the <Image /> component
Detect the assignation of a require import to a var such as 'var module = require("module")'.
Require that member overloads be consecutive.
Detect any @ts-<directive> comment as it can reduce the effectiveness of TypeScript overall.
Detect any types that are banned (such as String).
Detect all values and method definitions that do not use camelCase, they should.
Detect all classes and interfaces that do not follow the PascalCased name convention
Detect if not all function types for arguments and return values are specified in the function signature
Detect interfaces that are not prefixed with "I" to differenciate them from regular classes. (e.g ISomeInterface as oposed to SomeInterface)
Detect any empty methods, as in methods that do not have any logic
Detect any explicit "any" type, it should be replaced by another specific valid type (e.g string, number, boolean)
Detect extra null assertions, there should be just a single null assertion in a expression
Detect any explicit types that can easily be inferred by the compiler
Detect any interfaces that are being initialized with "new", as only classes should be initialized with "new"
Disallow the use of custom TypeScript modules and namespaces
Disallows using a non-null assertion after an optional chain expression
Detect all non-null assertions as they cancel the benefits of strict null-checking mode
Disallow aliasing this
Detect all defined variables (e.g "var foo = true") that are not being used somewhere else
Disallows the use of require statements except in import statements.
This rule recommends usage of const assertion when type primitive value is equal to type.
Use 'namespace' instead of 'module' to declare custom TypeScript modules.
Detect any triple slash reference definitions in the top of the file, they should be replaced by the import style (e.g replace "/// <reference path="foo" />" by "import * as foo from 'foo';")
Forbid the use of let
Forbid the use of Object.assign() with a variable as first argument
Forbid the use of mutating methods
Forbid the use of mutating operators
Forbid the use of rest parameters
Forbid the use of throw
Detect missing webpackChunkName in any dynamic imports
Detect any error with your imports and exports, like more than one default export or redundant imports.
Detect non-import statements before an import statement
Detect if there are too many dependencies in one module according to settings
Detect dependency cycles from your project as in two modules depending on each other
Prohibit default exports.
Detect any duplicate imports
Forbid the import of external modules that are not declared in the package.json's dependencies, devDependencies, optionalDependencies, peerDependencies, or bundledDependencies.
Reports use of an exported name as the locally imported name of a default export.
Reports use of a default export as a locally named import.
Enforce a convention of not using namespace (a.k.a. "wildcard" *) imports.
Aims to remove modules with side-effects by reporting when a module is imported but not assigned.
When there is only a single export from a module, prefer using default export over named export.
Detects insecure generation of random data (e.g Math.random())
Disallow disabled tests
Avoid using a callback in asynchronous tests and hooks (no-done-callback)
Disallow specific matchers & modifiers.
Suggest using toBeCalledWith() or toHaveBeenCalledWith()
Suggest using jest.spyOn()
Require test cases and hooks to be inside a describe block
ARIA state and property values must be valid.
Enforce that autoFocus prop is not used on elements. Autofocusing elements can cause usability issues for sighted and non-sighted users, alike.
Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
Promise executor functions should not be async.
Disallows lexical declarations (let, const, function and class) in case/default clauses.
Detect the use of operator (e.g <=, <, ===, etc) to compare against -0.
Disallows constant expressions in the test condition of: if, for, while, do...while, or ternary operations (?:)
Disallow control characters in regular expressions.
Detects any debugger statement
Disallow empty block statements.
Disallow empty destructuring patterns
Disallows unnecessary boolean casts.
Detects when there are mixed spaces and tabs in a module definition
Disallows calling some Object.prototype methods directly on object instances.
Detects self assignments as they have no effect, so probably those are an error due to incomplete refactoring.
Disallows sparse array literals which have "holes" where commas are not preceded by elements.
Reports catch clauses that only throw the caught error.
Disallow unnecessary escape usage
Disallows var definition
Suggest using const instead of var or let
Suggest using the rest parameters instead of arguments
Suggest using spread syntax instead of .apply()
Incorrect use of hooks
Detect raw text outside of Text component
Component definition is missing display name
By default this rule prevents passing of props that add lots of complexity (className, style) to Components.
Enforce boolean attributes notation in JSX
Detect missing key prop
Disallows .bind() or Arrow Functions in JSX Props as it can be bad for performance
Prevents comment strings (e.g. beginning with // or /*) from being accidentally injected as a text node in JSX statements.
Disallow the usage of string literals inside JSX components
Disallow undeclared variables in JSX
Disallow unnecessary fragments
Disallow JSX props spreading
Prevent passing of children as props
Prevent usage of setState in componentDidUpdate
Prevent multiple component definition per file. Declaring only one component per file improves readability and reusability of components.
Prevent invalid characters from appearing in markup
Prevent usage of unknown DOM property
Prevent definitions of unused propTypes
Prevent missing props validation in a React component definition
Prevent missing React when using JSX
Require that interface names be prefixed with "I".
Disallow Array#reduce() and Array#reduceRight() as usually result in hard-to-read and less performant code.
Disallow the use of the null literal.
Unnecessary semicolon.
Disallow use of optional chaining in contexts where the undefined value is not allowed
An interface declaring no members is equivalent to its supertype.
Disallows unnecessary constraints on generic types
Incorrect handling of switch
The custom font you're adding was added to a separate component within Document - this disables automatic font optimization.
Disallow using deprecated object declaration on data
Use the `next/script` component for loading third party scripts
Display parameter is missing
Assign object to a variable before exporting as module default
Expected a conditional expression and instead saw an assignment
Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images.
Disallows Array constructors.
Do not use <head>. Use Head from 'next/head' instead.
Disallows literal numbers that lose precision.
Component nam should always be multi-word
Do not assign to the exception parameter.
Prevent usage of next/server outside of middleware.js.
Synchronous scripts should not be used
`next/script`'s `beforeInteractive` strategy should not be used outside of `pages/_document.js`
Enforce specific casing for component definition name
`next/script` components with inline content must specify an `id` attribute.
This rule requires default value to be set for each props that are not marked as required.
This rule enforces that a props statement contains type definition.
This rule reports use of deprecated destroyed and beforeDestroy lifecycle hooks