@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.
- package/README.md +106 -0
- package/index.d.ts +12 -0
- package/index.esm.js +698 -538
- package/package.json +1 -1
- package/rules/no-commonjs-import-patterns.d.ts +6 -0
- package/rules/no-fully-untracked-effect.d.ts +1 -2
- package/rules/no-import-assertions.d.ts +5 -0
- package/rules/no-infinite-loop.d.ts +6 -0
- package/rules/no-signal-reads-after-await-in-reactive-context.d.ts +1 -2
- package/rules/no-untracked-outside-reactive-context.d.ts +1 -2
- package/rules/no-useless-untracked.d.ts +1 -2
- package/rules/prefer-namespace-keyword.d.ts +5 -0
- package/rules/prefer-untracked-incidental-signal-reads.d.ts +1 -27
- package/rules/prefer-untracked-signal-getter.d.ts +1 -2
- package/rules/utils/{angular-signals.d.ts → angular/angular-signals.d.ts} +9 -5
- package/rules/utils/angular/pipes.d.ts +2 -0
- package/rules/utils/angular/providers.d.ts +3 -0
- package/rules/utils/ast/ancestors.d.ts +12 -0
- package/rules/utils/{ast-walk.d.ts → ast/ast-walk.d.ts} +1 -0
- package/rules/utils/ast/call-expressions.d.ts +2 -0
- package/rules/utils/ast/mutation-targets.d.ts +4 -0
- package/rules/utils/ast/parenthesized.d.ts +3 -0
- package/rules/utils/ast/property-names.d.ts +5 -0
- package/rules/utils/ast/returned-expression.d.ts +2 -0
- package/rules/utils/ast/string-literals.d.ts +10 -0
- package/rules/utils/text/dedent.d.ts +5 -0
- package/rules/utils/typescript/decorators.d.ts +2 -0
- package/rules/utils/typescript/function-usage.d.ts +5 -0
- package/rules/utils/typescript/node-map.d.ts +6 -0
- package/rules/utils/typescript/symbols.d.ts +4 -0
- package/rules/utils/typescript/type-aware-context.d.ts +14 -0
- /package/rules/utils/{angular-imports.d.ts → angular/angular-imports.d.ts} +0 -0
- /package/rules/utils/{get-decorator-metadata.d.ts → angular/get-decorator-metadata.d.ts} +0 -0
- /package/rules/utils/{get-imports-array.d.ts → angular/get-imports-array.d.ts} +0 -0
- /package/rules/utils/{import-fix-helpers.d.ts → angular/import-fix-helpers.d.ts} +0 -0
- /package/rules/utils/{is-imports-array-property.d.ts → angular/is-imports-array-property.d.ts} +0 -0
- /package/rules/utils/{untracked-docs.d.ts → angular/untracked-docs.d.ts} +0 -0
- /package/rules/utils/{ast-expressions.d.ts → ast/ast-expressions.d.ts} +0 -0
- /package/rules/utils/{get-const-array.d.ts → ast/get-const-array.d.ts} +0 -0
- /package/rules/utils/{is-array.d.ts → ast/is-array.d.ts} +0 -0
- /package/rules/utils/{is-object.d.ts → ast/is-object.d.ts} +0 -0
- /package/rules/utils/{is-spread.d.ts → ast/is-spread.d.ts} +0 -0
- /package/rules/utils/{name-of.d.ts → ast/name-of.d.ts} +0 -0
- /package/rules/utils/{intersect.d.ts → collections/intersect.d.ts} +0 -0
- /package/rules/utils/{same-order.d.ts → collections/same-order.d.ts} +0 -0
- /package/rules/utils/{get-imported-name.d.ts → imports/get-imported-name.d.ts} +0 -0
- /package/rules/utils/{npmrc-parser.d.ts → parsers/npmrc-parser.d.ts} +0 -0
- /package/rules/utils/{get-sorted-names.d.ts → sorting/get-sorted-names.d.ts} +0 -0
- /package/rules/utils/{get-field-types.d.ts → typescript/get-field-types.d.ts} +0 -0
- /package/rules/utils/{get-type-name.d.ts → typescript/get-type-name.d.ts} +0 -0
- /package/rules/utils/{is-class-type.d.ts → typescript/is-class-type.d.ts} +0 -0
- /package/rules/utils/{is-external-tuple.d.ts → typescript/is-external-tuple.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -45,11 +45,14 @@ export default [
|
|
|
45
45
|
| flat-exports | Spread nested arrays when exporting Angular entity collections | | 🔧 | |
|
|
46
46
|
| host-attributes-sort | Sort Angular host metadata attributes using configurable attribute groups | ✅ | 🔧 | |
|
|
47
47
|
| injection-token-description | Require `InjectionToken` descriptions to include the token name | ✅ | 🔧 | |
|
|
48
|
+
| no-commonjs-import-patterns | Disallow legacy CommonJS interop import patterns | ✅ | | |
|
|
48
49
|
| no-deep-imports | Disables deep imports of Taiga UI packages | ✅ | 🔧 | |
|
|
49
50
|
| no-deep-imports-to-indexed-packages | Disallow deep imports from packages that expose an index.ts next to ng-package.json or package.json | ✅ | 🔧 | |
|
|
50
51
|
| no-fully-untracked-effect | Disallow reactive callbacks where all signal reads are hidden inside `untracked()` | ✅ | | |
|
|
51
52
|
| no-href-with-router-link | Do not use href and routerLink attributes together on the same element | ✅ | 🔧 | |
|
|
53
|
+
| no-import-assertions | Replace legacy `assert { ... }` import assertions with `with { ... }` | ✅ | 🔧 | |
|
|
52
54
|
| no-implicit-public | Require explicit `public` modifier for class members and parameter properties | ✅ | 🔧 | |
|
|
55
|
+
| no-infinite-loop | Disallow `while (true)` and `for` loops without an explicit condition | ✅ | | |
|
|
53
56
|
| no-legacy-peer-deps | Disallow `legacy-peer-deps=true` in `.npmrc` | ✅ | | |
|
|
54
57
|
| no-playwright-empty-fill | Enforce `clear()` over `fill('')` in Playwright tests | ✅ | 🔧 | |
|
|
55
58
|
| no-project-as-in-ng-template | `ngProjectAs` has no effect inside `<ng-template>` or dynamic outlets | ✅ | | |
|
|
@@ -63,6 +66,7 @@ export default [
|
|
|
63
66
|
| prefer-combined-if-control-flow | Combine consecutive `if` statements that use the same `return`, `break`, `continue`, or `throw` | ✅ | 🔧 | |
|
|
64
67
|
| prefer-deep-imports | Allow deep imports of Taiga UI packages | | 🔧 | |
|
|
65
68
|
| prefer-multi-arg-push | Combine consecutive `.push()` calls on the same array into a single multi-argument call | ✅ | 🔧 | |
|
|
69
|
+
| prefer-namespace-keyword | Replace `module Foo {}` with `namespace Foo {}` for TypeScript namespace declarations | ✅ | 🔧 | |
|
|
66
70
|
| prefer-untracked-incidental-signal-reads | Wrap likely-incidental signal reads with `untracked()` in reactive callbacks | ✅ | 🔧 | |
|
|
67
71
|
| prefer-untracked-signal-getter | Prefer `untracked(signalGetter)` over `untracked(() => signalGetter())` for a single signal getter | ✅ | 🔧 | |
|
|
68
72
|
| short-tui-imports | Shorten TuiXxxComponent / TuiYyyDirective in Angular metadata | ✅ | 🔧 | |
|
|
@@ -306,6 +310,29 @@ export const TUI_MY_TOKEN = new InjectionToken<string>(ngDevMode ? '[TUI_MY_TOKE
|
|
|
306
310
|
|
|
307
311
|
---
|
|
308
312
|
|
|
313
|
+
## no-commonjs-import-patterns
|
|
314
|
+
|
|
315
|
+
<sup>`✅ Recommended`</sup>
|
|
316
|
+
|
|
317
|
+
Disallows legacy CommonJS interop import patterns that are brittle under modern ESM-oriented toolchains. It reports
|
|
318
|
+
`import foo = require('foo')` and namespace imports that are used as callable values, constructors, or tag functions.
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
// ❌ error
|
|
322
|
+
import toolkit = require('@taiga-ui/cdk');
|
|
323
|
+
|
|
324
|
+
import * as createClient from 'legacy-client';
|
|
325
|
+
createClient();
|
|
326
|
+
|
|
327
|
+
// ✅ ok
|
|
328
|
+
import toolkit from '@taiga-ui/cdk';
|
|
329
|
+
|
|
330
|
+
import createClient from 'legacy-client';
|
|
331
|
+
createClient();
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
309
336
|
## no-deep-imports
|
|
310
337
|
|
|
311
338
|
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
@@ -418,6 +445,22 @@ attribute.
|
|
|
418
445
|
|
|
419
446
|
---
|
|
420
447
|
|
|
448
|
+
## no-import-assertions
|
|
449
|
+
|
|
450
|
+
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
451
|
+
|
|
452
|
+
Disallows legacy `assert { ... }` import assertions and rewrites them to `with { ... }` import attributes.
|
|
453
|
+
|
|
454
|
+
```ts
|
|
455
|
+
// ❌ error
|
|
456
|
+
import data from './file.json' assert {type: 'json'};
|
|
457
|
+
|
|
458
|
+
// ✅ after autofix
|
|
459
|
+
import data from './file.json' with {type: 'json'};
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
---
|
|
463
|
+
|
|
421
464
|
## no-implicit-public
|
|
422
465
|
|
|
423
466
|
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
@@ -441,6 +484,48 @@ class MyService {
|
|
|
441
484
|
|
|
442
485
|
---
|
|
443
486
|
|
|
487
|
+
## no-infinite-loop
|
|
488
|
+
|
|
489
|
+
<sup>`✅ Recommended`</sup>
|
|
490
|
+
|
|
491
|
+
Disallows the two loop forms banned by this project: `while (true)` and `for` loops without a condition, including the
|
|
492
|
+
canonical `for (;;)` form. These loops hide the real exit condition inside the body, which makes control flow harder to
|
|
493
|
+
scan and review.
|
|
494
|
+
|
|
495
|
+
```ts
|
|
496
|
+
// ❌ error
|
|
497
|
+
while (true) {
|
|
498
|
+
if (isDone) {
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
process();
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// ✅ ok
|
|
506
|
+
while (!isDone) {
|
|
507
|
+
process();
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
```ts
|
|
512
|
+
// ❌ error
|
|
513
|
+
for (;;) {
|
|
514
|
+
if (queue.length === 0) {
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
flush(queue.shift());
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// ✅ ok
|
|
522
|
+
for (; queue.length > 0; ) {
|
|
523
|
+
flush(queue.shift());
|
|
524
|
+
}
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
---
|
|
528
|
+
|
|
444
529
|
## no-legacy-peer-deps
|
|
445
530
|
|
|
446
531
|
<sup>`✅ Recommended`</sup>
|
|
@@ -1000,6 +1085,27 @@ output.push('# Getting Started', '');
|
|
|
1000
1085
|
|
|
1001
1086
|
---
|
|
1002
1087
|
|
|
1088
|
+
## prefer-namespace-keyword
|
|
1089
|
+
|
|
1090
|
+
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
|
1091
|
+
|
|
1092
|
+
Prefers `namespace Foo {}` over the older `module Foo {}` syntax for TypeScript namespace declarations. External module
|
|
1093
|
+
augmentations such as `declare module 'pkg' {}` are ignored.
|
|
1094
|
+
|
|
1095
|
+
```ts
|
|
1096
|
+
// ❌ error
|
|
1097
|
+
module Foo.Bar {
|
|
1098
|
+
export type Value = string;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// ✅ after autofix
|
|
1102
|
+
namespace Foo.Bar {
|
|
1103
|
+
export type Value = string;
|
|
1104
|
+
}
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
---
|
|
1108
|
+
|
|
1003
1109
|
## prefer-untracked-incidental-signal-reads
|
|
1004
1110
|
|
|
1005
1111
|
<sup>`✅ Recommended`</sup> <sup>`Fixable`</sup>
|
package/index.d.ts
CHANGED
|
@@ -30,6 +30,9 @@ declare const plugin: {
|
|
|
30
30
|
'injection-token-description': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalid-injection-token-description", readonly unknown[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
31
31
|
name: string;
|
|
32
32
|
};
|
|
33
|
+
'no-commonjs-import-patterns': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCallableNamespaceImport" | "avoidImportEquals", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
34
|
+
name: string;
|
|
35
|
+
};
|
|
33
36
|
'no-deep-imports': import("@typescript-eslint/utils/ts-eslint").RuleModule<"no-deep-imports", {
|
|
34
37
|
currentProject: string;
|
|
35
38
|
deepImport: string;
|
|
@@ -49,6 +52,12 @@ declare const plugin: {
|
|
|
49
52
|
'no-implicit-public': import("@typescript-eslint/utils/ts-eslint").RuleModule<"implicitPublic", readonly unknown[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
50
53
|
name: string;
|
|
51
54
|
};
|
|
55
|
+
'no-import-assertions': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useWithImportAttributes", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
56
|
+
name: string;
|
|
57
|
+
};
|
|
58
|
+
'no-infinite-loop': import("@typescript-eslint/utils/ts-eslint").RuleModule<"doWhileLoop" | "forLoop" | "whileLoop", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
52
61
|
'no-legacy-peer-deps': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLegacyPeerDeps", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
53
62
|
name: string;
|
|
54
63
|
};
|
|
@@ -93,6 +102,9 @@ declare const plugin: {
|
|
|
93
102
|
'prefer-multi-arg-push': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferMultiArgPush", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
94
103
|
name: string;
|
|
95
104
|
};
|
|
105
|
+
'prefer-namespace-keyword': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useNamespaceKeyword", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
96
108
|
'prefer-untracked-incidental-signal-reads': import("@typescript-eslint/utils/ts-eslint").RuleModule<"incidentalRead", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
97
109
|
name: string;
|
|
98
110
|
};
|