@taiga-ui/eslint-plugin-experience-next 0.474.0 → 0.476.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +106 -0
  2. package/index.d.ts +12 -0
  3. package/index.esm.js +698 -538
  4. package/package.json +1 -1
  5. package/rules/no-commonjs-import-patterns.d.ts +6 -0
  6. package/rules/no-fully-untracked-effect.d.ts +1 -2
  7. package/rules/no-import-assertions.d.ts +5 -0
  8. package/rules/no-infinite-loop.d.ts +6 -0
  9. package/rules/no-signal-reads-after-await-in-reactive-context.d.ts +1 -2
  10. package/rules/no-untracked-outside-reactive-context.d.ts +1 -2
  11. package/rules/no-useless-untracked.d.ts +1 -2
  12. package/rules/prefer-namespace-keyword.d.ts +5 -0
  13. package/rules/prefer-untracked-incidental-signal-reads.d.ts +1 -27
  14. package/rules/prefer-untracked-signal-getter.d.ts +1 -2
  15. package/rules/utils/{angular-signals.d.ts → angular/angular-signals.d.ts} +9 -5
  16. package/rules/utils/angular/pipes.d.ts +2 -0
  17. package/rules/utils/angular/providers.d.ts +3 -0
  18. package/rules/utils/ast/ancestors.d.ts +12 -0
  19. package/rules/utils/{ast-walk.d.ts → ast/ast-walk.d.ts} +1 -0
  20. package/rules/utils/ast/call-expressions.d.ts +2 -0
  21. package/rules/utils/ast/mutation-targets.d.ts +4 -0
  22. package/rules/utils/ast/parenthesized.d.ts +3 -0
  23. package/rules/utils/ast/property-names.d.ts +5 -0
  24. package/rules/utils/ast/returned-expression.d.ts +2 -0
  25. package/rules/utils/ast/string-literals.d.ts +10 -0
  26. package/rules/utils/text/dedent.d.ts +5 -0
  27. package/rules/utils/typescript/decorators.d.ts +2 -0
  28. package/rules/utils/typescript/function-usage.d.ts +5 -0
  29. package/rules/utils/typescript/node-map.d.ts +6 -0
  30. package/rules/utils/typescript/symbols.d.ts +4 -0
  31. package/rules/utils/typescript/type-aware-context.d.ts +14 -0
  32. /package/rules/utils/{angular-imports.d.ts → angular/angular-imports.d.ts} +0 -0
  33. /package/rules/utils/{get-decorator-metadata.d.ts → angular/get-decorator-metadata.d.ts} +0 -0
  34. /package/rules/utils/{get-imports-array.d.ts → angular/get-imports-array.d.ts} +0 -0
  35. /package/rules/utils/{import-fix-helpers.d.ts → angular/import-fix-helpers.d.ts} +0 -0
  36. /package/rules/utils/{is-imports-array-property.d.ts → angular/is-imports-array-property.d.ts} +0 -0
  37. /package/rules/utils/{untracked-docs.d.ts → angular/untracked-docs.d.ts} +0 -0
  38. /package/rules/utils/{ast-expressions.d.ts → ast/ast-expressions.d.ts} +0 -0
  39. /package/rules/utils/{get-const-array.d.ts → ast/get-const-array.d.ts} +0 -0
  40. /package/rules/utils/{is-array.d.ts → ast/is-array.d.ts} +0 -0
  41. /package/rules/utils/{is-object.d.ts → ast/is-object.d.ts} +0 -0
  42. /package/rules/utils/{is-spread.d.ts → ast/is-spread.d.ts} +0 -0
  43. /package/rules/utils/{name-of.d.ts → ast/name-of.d.ts} +0 -0
  44. /package/rules/utils/{intersect.d.ts → collections/intersect.d.ts} +0 -0
  45. /package/rules/utils/{same-order.d.ts → collections/same-order.d.ts} +0 -0
  46. /package/rules/utils/{get-imported-name.d.ts → imports/get-imported-name.d.ts} +0 -0
  47. /package/rules/utils/{npmrc-parser.d.ts → parsers/npmrc-parser.d.ts} +0 -0
  48. /package/rules/utils/{get-sorted-names.d.ts → sorting/get-sorted-names.d.ts} +0 -0
  49. /package/rules/utils/{get-field-types.d.ts → typescript/get-field-types.d.ts} +0 -0
  50. /package/rules/utils/{get-type-name.d.ts → typescript/get-type-name.d.ts} +0 -0
  51. /package/rules/utils/{is-class-type.d.ts → typescript/is-class-type.d.ts} +0 -0
  52. /package/rules/utils/{is-external-tuple.d.ts → typescript/is-external-tuple.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/eslint-plugin-experience-next",
3
- "version": "0.474.0",
3
+ "version": "0.476.0",
4
4
  "description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -0,0 +1,6 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ type MessageId = 'avoidCallableNamespaceImport' | 'avoidImportEquals';
3
+ export declare const rule: ESLintUtils.RuleModule<MessageId, [], unknown, ESLintUtils.RuleListener> & {
4
+ name: string;
5
+ };
6
+ export default rule;
@@ -1,5 +1,4 @@
1
- import { ESLintUtils } from '@typescript-eslint/utils';
2
- export declare const rule: ESLintUtils.RuleModule<"noTrackedReads", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noTrackedReads", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
2
  name: string;
4
3
  };
5
4
  export default rule;
@@ -0,0 +1,5 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ export declare const rule: ESLintUtils.RuleModule<"useWithImportAttributes", [], unknown, ESLintUtils.RuleListener> & {
3
+ name: string;
4
+ };
5
+ export default rule;
@@ -0,0 +1,6 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ type MessageId = 'doWhileLoop' | 'forLoop' | 'whileLoop';
3
+ export declare const rule: ESLintUtils.RuleModule<MessageId, [], unknown, ESLintUtils.RuleListener> & {
4
+ name: string;
5
+ };
6
+ export default rule;
@@ -1,5 +1,4 @@
1
- import { ESLintUtils } from '@typescript-eslint/utils';
2
- export declare const rule: ESLintUtils.RuleModule<"readAfterAwait", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"readAfterAwait", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
2
  name: string;
4
3
  };
5
4
  export default rule;
@@ -1,5 +1,4 @@
1
- import { ESLintUtils } from '@typescript-eslint/utils';
2
- export declare const rule: ESLintUtils.RuleModule<"outsideReactiveContext", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"outsideReactiveContext", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
2
  name: string;
4
3
  };
5
4
  export default rule;
@@ -1,5 +1,4 @@
1
- import { ESLintUtils } from '@typescript-eslint/utils';
2
- export declare const rule: ESLintUtils.RuleModule<"uselessUntracked", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"uselessUntracked", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
2
  name: string;
4
3
  };
5
4
  export default rule;
@@ -0,0 +1,5 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ export declare const rule: ESLintUtils.RuleModule<"useNamespaceKeyword", [], unknown, ESLintUtils.RuleListener> & {
3
+ name: string;
4
+ };
5
+ export default rule;
@@ -1,30 +1,4 @@
1
- /**
2
- * prefer-untracked-incidental-signal-reads
3
- *
4
- * Conservatively flags signal reads inside reactive callbacks that appear to be
5
- * incidental — they provide only a snapshot value passed to a side-effecting
6
- * consumer such as a signal write or DOM imperative call — and therefore
7
- * probably should be wrapped in `untracked(...)`.
8
- *
9
- * Design principle: prefer false-negatives over false-positives.
10
- * This rule only reports patterns it can confidently identify as suspicious.
11
- *
12
- * Limitations
13
- * -----------
14
- * Whether a signal read *should* be tracked is a question of developer intent,
15
- * not syntax. The rule relies on heuristics (type-based signal detection,
16
- * structural pattern matching) and will inevitably produce:
17
- *
18
- * - False negatives: incidental reads that do not match the heuristics.
19
- * - False positives (rare): reads that look incidental but are intentional
20
- * dependencies (e.g. the developer intentionally re-runs the effect when
21
- * `mousePosition` changes to keep `position` in sync).
22
- *
23
- * Always review suggestions before accepting the fix. If the reported read
24
- * IS meant to be a tracked dependency, disable the rule for that line.
25
- */
26
- import { ESLintUtils } from '@typescript-eslint/utils';
27
- export declare const rule: ESLintUtils.RuleModule<"incidentalRead", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"incidentalRead", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
28
2
  name: string;
29
3
  };
30
4
  export default rule;
@@ -1,5 +1,4 @@
1
- import { ESLintUtils } from '@typescript-eslint/utils';
2
- export declare const rule: ESLintUtils.RuleModule<"preferGetterForm", [], unknown, ESLintUtils.RuleListener> & {
1
+ export declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferGetterForm", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
2
  name: string;
4
3
  };
5
4
  export default rule;
@@ -1,11 +1,10 @@
1
1
  import { type TSESTree } from '@typescript-eslint/utils';
2
2
  import ts from 'typescript';
3
+ import { type NodeMap } from '../typescript/node-map';
4
+ export { walkAfterAsyncBoundaryAst, walkAst, walkSynchronousAst } from '../ast/ast-walk';
5
+ export type { NodeMap } from '../typescript/node-map';
3
6
  export { findAngularCoreImport, findAngularCoreImports, findAngularCoreImportSpecifier, findRuntimeAngularCoreImport, getLocalNameForImport, } from './angular-imports';
4
- export { walkAfterAsyncBoundaryAst, walkAst, walkSynchronousAst } from './ast-walk';
5
- export interface NodeMap {
6
- get(node: TSESTree.Node): ts.Node | undefined;
7
- }
8
- type ReactiveCallback = TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
7
+ export type ReactiveCallback = TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression;
9
8
  export interface ReactiveScope {
10
9
  readonly callback: ReactiveCallback;
11
10
  readonly kind: string;
@@ -16,6 +15,8 @@ export interface SignalUsage {
16
15
  readonly reads: TSESTree.CallExpression[];
17
16
  readonly writes: TSESTree.CallExpression[];
18
17
  }
18
+ export declare function isReactiveCallback(node: TSESTree.Node | null | undefined): node is ReactiveCallback;
19
+ export declare function getReactiveCallbackArgument(node: TSESTree.CallExpression): ReactiveCallback | null;
19
20
  export declare function isAngularEffectCall(node: TSESTree.CallExpression, program: TSESTree.Program): boolean;
20
21
  export declare function isAngularInjectCall(node: TSESTree.CallExpression, program: TSESTree.Program): boolean;
21
22
  export declare function isAngularUntrackedCall(node: TSESTree.CallExpression, program: TSESTree.Program): boolean;
@@ -46,3 +47,6 @@ export declare function isGetterMemberAccess(node: TSESTree.MemberExpression, ch
46
47
  * already hidden from tracking).
47
48
  */
48
49
  export declare function collectSignalUsages(scopeNode: TSESTree.Node, checker: ts.TypeChecker, esTreeNodeToTSNodeMap: NodeMap, program: TSESTree.Program): SignalUsage;
50
+ export declare function collectSignalReadsInsideUntracked(root: TSESTree.Node, checker: ts.TypeChecker, esTreeNodeToTSNodeMap: NodeMap, program: TSESTree.Program): TSESTree.CallExpression[];
51
+ export declare function isReactiveOwnerCall(node: TSESTree.Node, program: TSESTree.Program): node is TSESTree.CallExpression;
52
+ export declare function getReturnedReactiveOwnerCall(node: TSESTree.CallExpression, program: TSESTree.Program): TSESTree.CallExpression | null;
@@ -0,0 +1,2 @@
1
+ import { type ClassMember } from '../ast/ancestors';
2
+ export declare function isPipeTransformMember(member: ClassMember): boolean;
@@ -0,0 +1,3 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function isAngularInjectionTokenFactoryFunction(fn: TSESTree.FunctionLike, program: TSESTree.Program): boolean;
3
+ export declare function isAngularUseFactoryFunction(fn: TSESTree.FunctionLike): boolean;
@@ -0,0 +1,12 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export type ClassLike = TSESTree.ClassDeclaration | TSESTree.ClassExpression;
3
+ export type ClassMember = TSESTree.MethodDefinition | TSESTree.PropertyDefinition;
4
+ export declare function findAncestor<T extends TSESTree.Node>(node: TSESTree.Node | null | undefined, predicate: (ancestor: TSESTree.Node) => ancestor is T): T | null;
5
+ export declare function findSelfOrAncestor<T extends TSESTree.Node>(node: TSESTree.Node | null | undefined, predicate: (candidate: TSESTree.Node) => candidate is T): T | null;
6
+ export declare function hasAncestor(node: TSESTree.Node | null | undefined, predicate: (ancestor: TSESTree.Node) => boolean): boolean;
7
+ export declare function isNodeInside(node: TSESTree.Node, ancestor: TSESTree.Node): boolean;
8
+ export declare function isNodeInsideAny(node: TSESTree.Node, ancestors: readonly TSESTree.Node[]): boolean;
9
+ export declare function getEnclosingFunction(node: TSESTree.Node | null | undefined): TSESTree.FunctionLike | null;
10
+ export declare function getEnclosingClass(node: TSESTree.Node | null | undefined): ClassLike | null;
11
+ export declare function getEnclosingClassMember(node: TSESTree.Node | null | undefined): ClassMember | null;
12
+ export declare function getScopeRoot(node: TSESTree.Node): TSESTree.Node;
@@ -1,4 +1,5 @@
1
1
  import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function isFunctionLike(node: TSESTree.Node): node is TSESTree.FunctionLike;
2
3
  /**
3
4
  * Walks the synchronous portion of a reactive scope.
4
5
  *
@@ -0,0 +1,2 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function collectCallExpressions(root: TSESTree.Node): TSESTree.CallExpression[];
@@ -0,0 +1,4 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export type MutationTarget = TSESTree.Identifier | TSESTree.MemberExpression;
3
+ export declare function unwrapMutationTarget(node: TSESTree.Node): TSESTree.Node;
4
+ export declare function collectMutationTargets(node: TSESTree.Node): MutationTarget[];
@@ -0,0 +1,3 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function getParenthesizedInner(node: TSESTree.Node): TSESTree.Node | null;
3
+ export declare function unwrapParenthesized(node: TSESTree.Node): TSESTree.Node;
@@ -0,0 +1,5 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function getStaticPropertyName(key: TSESTree.PropertyName): string | null;
3
+ export declare function getObjectPropertyName(node: TSESTree.Property): string | null;
4
+ export declare function getMemberExpressionPropertyName(node: TSESTree.MemberExpression): string | null;
5
+ export declare function getClassMemberName(member: TSESTree.MethodDefinition | TSESTree.PropertyDefinition): string | null;
@@ -0,0 +1,2 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export declare function getReturnedExpression(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression): TSESTree.Expression | null;
@@ -0,0 +1,10 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ export type StringLiteral = TSESTree.Literal & {
3
+ value: string;
4
+ };
5
+ export type StaticStringNode = StringLiteral | TSESTree.TemplateLiteral;
6
+ export declare function isStringLiteral(node: TSESTree.Node | null | undefined): node is StringLiteral;
7
+ export declare function isStaticTemplateLiteral(node: TSESTree.Node | null | undefined): node is TSESTree.TemplateLiteral;
8
+ export declare function isStaticString(node: TSESTree.Node | null | undefined): node is StaticStringNode;
9
+ export declare function getStaticStringValue(node: TSESTree.Node | null | undefined): string | null;
10
+ export declare function isEmptyStaticString(node: TSESTree.Node | null | undefined): boolean;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Removes `extraSpaces` leading spaces from every line of `text` that starts
3
+ * with at least that many spaces.
4
+ */
5
+ export declare function dedent(text: string, extraSpaces: number): string;
@@ -0,0 +1,2 @@
1
+ import { type ClassLike } from '../ast/ancestors';
2
+ export declare function hasNamedDecorator(node: ClassLike, name: string): boolean;
@@ -0,0 +1,5 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ import type ts from 'typescript';
3
+ import { type NodeMap } from './node-map';
4
+ export declare function isDirectCallOrNewArgument(node: TSESTree.FunctionLike): boolean;
5
+ export declare function isStoredFunctionUsedAsCallOrNewArgument(fn: TSESTree.FunctionLike, checker: ts.TypeChecker, esTreeNodeToTSNodeMap: NodeMap): boolean;
@@ -0,0 +1,6 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ import type ts from 'typescript';
3
+ export interface NodeMap {
4
+ get(node: TSESTree.Node): ts.Node | undefined;
5
+ }
6
+ export type TsNodeToESTreeNodeMap = Map<ts.Node, TSESTree.Node>;
@@ -0,0 +1,4 @@
1
+ import { type TSESTree } from '@typescript-eslint/utils';
2
+ import type ts from 'typescript';
3
+ import { type NodeMap } from './node-map';
4
+ export declare function getSymbolAtNode(node: TSESTree.Node, checker: ts.TypeChecker, esTreeNodeToTSNodeMap: NodeMap): ts.Symbol | null;
@@ -0,0 +1,14 @@
1
+ import { ESLintUtils, type TSESLint, type TSESTree } from '@typescript-eslint/utils';
2
+ import type ts from 'typescript';
3
+ type ParserServices = ReturnType<typeof ESLintUtils.getParserServices>;
4
+ export interface TypeAwareRuleContext {
5
+ readonly checker: ts.TypeChecker;
6
+ readonly esTreeNodeToTSNodeMap: ParserServices['esTreeNodeToTSNodeMap'];
7
+ readonly parserServices: ParserServices;
8
+ readonly program: TSESTree.Program;
9
+ readonly sourceCode: Readonly<TSESLint.SourceCode>;
10
+ readonly tsNodeToESTreeNodeMap: ParserServices['tsNodeToESTreeNodeMap'];
11
+ readonly tsProgram: ts.Program;
12
+ }
13
+ export declare function getTypeAwareRuleContext<MessageId extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageId, Options>>): TypeAwareRuleContext;
14
+ export {};
File without changes