@angular-eslint/directive-selector
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.
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 directive selector isn't a hyphenated, lowercase value or doesn't have a descriptive prefix to represent the feature area or the application itself.
Prevent any Output values with prefix 'on' as this prefix should be used only for event handler methods to follow web conventions
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 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
Detect all non-null assertions as they cancel the benefits of strict null-checking mode
Disallow aliasing this
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.
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
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.
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.
Disallows lexical declarations (let, const, function and class) in case/default clauses.
Disallow empty destructuring patterns
Detects self assignments as they have no effect, so probably those are an error due to incomplete refactoring.
Reports catch clauses that only throw the caught error.
Disallow unnecessary escape usage
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
Disallow the usage of string literals inside JSX components
Disallow JSX props spreading
Prevent passing of children as props
Prevent multiple component definition per file. Declaring only one component per file improves readability and reusability of components.
Prevent definitions of unused propTypes
Prevent missing props validation in a React component definition
Disallow the use of the null literal.
Unnecessary semicolon.
Disallow use of optional chaining in contexts where the undefined value is not allowed
Disallow using deprecated object declaration on data
Display parameter is missing
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.
Do not assign to the exception parameter.
Prevent usage of next/server outside of middleware.js.
`next/script`'s `beforeInteractive` strategy should not be used outside of `pages/_document.js`
`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.
We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.