@taiga-ui/eslint-plugin-experience-next
v0.537.0
Published
An ESLint plugin to enforce a consistent code styles across taiga-ui projects
Keywords
Readme
@taiga-ui/eslint-plugin-experience-next
npm i -D eslint @taiga-ui/eslint-plugin-experience-nexteslint.config.ts
Attention: package does not support commonjs, use eslint.config.{ts,mjs,js} instead of eslint.config.cjs
import taiga from '@taiga-ui/eslint-plugin-experience-next';
export default [
...taiga.configs.recommended,
// custom rules
{
files: ['**/legacy/**/*.ts'],
rules: {
'@angular-eslint/prefer-standalone': 'off',
},
},
{
files: ['**/*'],
rules: {
'@angular-eslint/template/button-has-type': 'off',
'@angular-eslint/template/elements-content': 'off',
'@typescript-eslint/max-params': 'off',
'jest/prefer-importing-jest-globals': 'off',
'sonarjs/prefer-nullish-coalescing': 'off',
},
},
];Recommended config contents
taiga.configs.recommended combines the Taiga UI rules listed below with external ESLint presets and individual rules
from third-party plugins. The exact severities and file globs live in
configs/recommended.ts.
| Package | What is included in recommended |
| -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| ESLint core | eslint.configs.recommended and individual core rules for JS/TS files |
| typescript-eslint | configs.all, configs.disableTypeChecked, and individual @typescript-eslint/* rules |
| angular-eslint TS rules | angular.configs.tsRecommended and individual @angular-eslint/* rules for **/*.{ts,tsx} |
| angular-eslint template rules | templateRecommended, templateAccessibility, and individual @angular-eslint/template/* rules for **/*.html |
| @eslint/markdown | markdown.configs.recommended for **/*.md |
| @smarttools/eslint-plugin-rxjs | Individual rxjs/* rules for Angular/TypeScript files |
| @stylistic/eslint-plugin | Individual @stylistic/* formatting rules |
| eslint-plugin-compat | compat.configs['flat/recommended'] for JS/TS files |
| eslint-plugin-cypress | Registered for Cypress overrides; no cypress/* rules are enabled by default |
| eslint-plugin-de-morgan | deMorganConfigs.recommended for JS/TS files |
| eslint-plugin-decorator-position | Individual decorator-position/* rules for JS/TS files |
| eslint-plugin-file-progress | progress.configs['recommended-ci'] |
| eslint-plugin-import | flatConfigs.recommended, flatConfigs.typescript, and individual import/* rules for JS/TS files |
| eslint-plugin-jest | jest.configs['flat/recommended'] and individual jest/* rules for **/*.spec.ts |
| eslint-plugin-package-json | packageJsonConfigs.recommended and individual package-json/* rules for **/package.json |
| eslint-plugin-perfectionist | Individual perfectionist/* sorting rules for JS/TS files |
| eslint-plugin-playwright | playwright.configs['flat/recommended'] and individual playwright/* rules for **/*.pw.spec.ts |
| eslint-plugin-prettier | Individual prettier/* rules for JS/TS files |
| eslint-plugin-promise | promise.configs['flat/recommended'] and individual promise/* rules for JS/TS files |
| eslint-plugin-regexp | regexpConfigs['flat/recommended'] and individual regexp/* rules for JS/TS files |
| eslint-plugin-simple-import-sort | Individual simple-import-sort/* rules for JS/TS files |
| eslint-plugin-sonarjs | Individual sonarjs/* rules for JS/TS files |
| eslint-plugin-unicorn | Individual unicorn/* rules for JS/TS files |
| eslint-plugin-unused-imports | Individual unused-imports/* rules for JS/TS files |
- ✅ = recommended
- 🔧 = fixable
- 💡 = has suggestions
| Rule | Description | ✅ | 🔧 | 💡 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --- | --- | --- |
| array-as-const | Exported array of class references should be marked with as const | | 🔧 | |
| at-compat | Keep built-in .at() and indexed access aligned with the TypeScript target | ✅ | 🔧 | |
| attrs-newline | Enforce one attribute per line when a start tag spans multiple lines | ✅ | 🔧 | |
| class-accessibility-spacing | Separate adjacent class members with a blank line when their accessibility group changes | ✅ | 🔧 | |
| class-property-naming | Enforce custom naming for class properties based on their type | | 🔧 | |
| decorator-key-sort | Sorts the keys of the object passed to the @Component/@Injectable/@NgModule/@Pipe decorator | ✅ | 🔧 | |
| element-newline | Require line breaks around block-level child nodes in HTML templates | ✅ | 🔧 | |
| flat-exports | Spread nested arrays when exporting Angular entity collections | | 🔧 | |
| host-attributes-sort | Sort Angular host metadata attributes using configurable attribute groups | ✅ | 🔧 | |
| html-logical-properties | Enforce logical CSS properties over directional ones in Angular template style bindings | ✅ | 🔧 | |
| import-integrity | Fast import default, namespace, cycle, duplicate, named-as-default, self-import, and path checks | ✅ | 🔧 | |
| injection-token-description | Require InjectionToken descriptions to include the token name | ✅ | 🔧 | |
| no-commonjs-import-patterns | Disallow legacy CommonJS interop import patterns | ✅ | | |
| no-deep-imports | Disables deep imports of Taiga UI packages | ✅ | 🔧 | |
| no-deep-imports-to-indexed-packages | Disallow deep imports from packages that expose an index.ts next to ng-package.json or package.json | ✅ | 🔧 | |
| no-duplicate-attrs | Disallow duplicate attributes on the same HTML element | ✅ | | |
| no-duplicate-id | Disallow duplicate static id values in HTML templates | ✅ | | |
| no-duplicate-in-head | Disallow duplicate title, base, and key metadata tags inside <head> | ✅ | | |
| no-empty-style-metadata | Remove empty Angular component style metadata | ✅ | 🔧 | |
| no-fully-untracked-effect | Disallow reactive callbacks where all signal reads are hidden inside untracked() | ✅ | | |
| no-href-with-router-link | Do not use href and routerLink attributes together on the same element | ✅ | 🔧 | |
| no-import-assertions | Replace legacy assert { ... } import assertions with with { ... } | ✅ | 🔧 | |
| no-implicit-public | Require explicit public modifier for class members and parameter properties | ✅ | 🔧 | |
| no-infinite-loop | Disallow while (true) and for loops without an explicit condition | ✅ | | |
| no-legacy-peer-deps | Disallow legacy-peer-deps=true in .npmrc | ✅ | | |
| no-nested-interactive | Disallow interactive HTML elements nested inside other interactive elements | ✅ | | |
| no-nested-ternary-in-template | Disallow nested ternary expressions in Angular 19+ templates | ✅ | 🔧 | |
| no-obsolete-attrs | Disallow obsolete HTML attributes | ✅ | | |
| no-obsolete-tags | Disallow obsolete HTML tags | ✅ | | |
| no-playwright-empty-fill | Enforce clear() over fill('') in Playwright tests | ✅ | 🔧 | |
| no-project-as-in-ng-template | ngProjectAs has no effect inside <ng-template> or dynamic outlets | ✅ | | |
| no-restricted-attr-values | Disallow configured attribute values in Angular templates | | | |
| no-redundant-type-annotation | Disallow redundant type annotations when the type is already inferred from the initializer | ✅ | 🔧 | |
| no-repeated-signal-in-conditional | Disallow reading the same nullable Angular signal more than once in a conditional expression | ✅ | 🔧 | |
| no-side-effects-in-computed | Disallow side effects and effectful helper calls inside Angular computed() callbacks | ✅ | | |
| no-signal-outside-class | Disallow class properties that reference a module-scope Angular signal | ✅ | | |
| no-signal-reads-after-await-in-reactive-context | Disallow bare signal reads after await inside reactive callbacks | ✅ | | |
| no-string-literal-concat | Disallow string literal concatenation; merge adjacent literals into one | ✅ | 🔧 | |
| no-untracked-outside-reactive-context | Disallow untracked() outside reactive callbacks, except explicit post-await snapshots | ✅ | 🔧 | |
| no-useless-untracked | Disallow provably useless untracked() wrappers in reactive callbacks | ✅ | 🔧 | |
| object-single-line | Enforce single-line formatting for single-property objects when it fits printWidth | ✅ | 🔧 | |
| prefer-combined-if-control-flow | Combine consecutive if statements that use the same return, break, continue, or throw | ✅ | 🔧 | |
| prefer-conditional-return | Prefer a conditional return over an adjacent if branch and fallback return | ✅ | 🔧 | |
| prefer-deep-imports | Allow deep imports of Taiga UI packages | | 🔧 | |
| prefer-loose-null-check | Prefer loose null checks over paired strict comparisons against null and undefined | ✅ | 🔧 | |
| prefer-multi-arg-push | Combine consecutive .push() calls on the same array into a single multi-argument call | ✅ | 🔧 | |
| prefer-namespace-keyword | Replace module Foo {} with namespace Foo {} for TypeScript namespace declarations | ✅ | 🔧 | |
| prefer-untracked-incidental-signal-reads | Wrap likely-incidental signal reads with untracked() in reactive callbacks | ✅ | 🔧 | |
| prefer-untracked-signal-getter | Prefer untracked(signalGetter) over untracked(() => signalGetter()) for a single signal getter | ✅ | 🔧 | |
| quotes | Enforce double quotes around HTML attribute values | ✅ | 🔧 | |
| require-doctype | Require <!DOCTYPE html> at the top of HTML documents | ✅ | 🔧 | |
| require-img-alt | Require alt on <img> elements, including Angular attribute bindings | ✅ | | |
| require-lang | Require a non-empty lang attribute on <html> | ✅ | | |
| require-li-container | Require <li> to be nested inside <ul>, <ol>, or <menu> | ✅ | | |
| require-title | Require a non-empty <title> inside <head> | ✅ | | |
| short-tui-imports | Shorten TuiXxxComponent / TuiYyyDirective in Angular metadata | ✅ | 🔧 | |
| single-line-class-property-spacing | Group single-line class properties by accessibility and separate multiline ones with a blank line | ✅ | 🔧 | |
| single-line-let-spacing | Group consecutive single-line @let declarations and separate multiline ones and interpolations with blank lines | ✅ | 🔧 | |
| single-line-variable-spacing | Group consecutive single-line variables and separate multiline ones with a blank line | ✅ | 🔧 | |
| standalone-imports-sort | Auto sort names inside Angular decorators | ✅ | 🔧 | |
| strict-tui-doc-example | If you use the addon-doc, there will be a hint that you are importing something incorrectly | | 🔧 | |
