@taiga-ui/eslint-plugin-experience-next 0.506.0 → 0.508.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 +60 -0
- package/index.d.ts +7 -1
- package/index.esm.js +781 -584
- package/package.json +1 -1
- package/rules/recommended/decorator-key-sort.d.ts +2 -2
- package/rules/recommended/no-empty-style-metadata.d.ts +5 -0
- package/rules/recommended/prefer-conditional-return.d.ts +5 -0
- package/rules/utils/angular/get-decorator-metadata.d.ts +8 -2
- package/rules/utils/angular/is-imports-array-property.d.ts +1 -1
- package/rules/utils/sorting/get-sorted-names.d.ts +2 -2
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ from third-party plugins. The exact severities and file globs live in
|
|
|
88
88
|
| [no-duplicate-attrs](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-duplicate-attrs.md) | Disallow duplicate attributes on the same HTML element | ✅ | | |
|
|
89
89
|
| [no-duplicate-id](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-duplicate-id.md) | Disallow duplicate static `id` values in HTML templates | ✅ | | |
|
|
90
90
|
| [no-duplicate-in-head](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-duplicate-in-head.md) | Disallow duplicate `title`, `base`, and key metadata tags inside `<head>` | ✅ | | |
|
|
91
|
+
| [no-empty-style-metadata](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-empty-style-metadata.md) | Remove empty Angular component style metadata | ✅ | 🔧 | |
|
|
91
92
|
| [no-fully-untracked-effect](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-fully-untracked-effect.md) | Disallow reactive callbacks where all signal reads are hidden inside `untracked()` | ✅ | | |
|
|
92
93
|
| [no-href-with-router-link](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-href-with-router-link.md) | Do not use href and routerLink attributes together on the same element | ✅ | 🔧 | |
|
|
93
94
|
| [no-import-assertions](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-import-assertions.md) | Replace legacy `assert { ... }` import assertions with `with { ... }` | ✅ | 🔧 | |
|
|
@@ -108,6 +109,7 @@ from third-party plugins. The exact severities and file globs live in
|
|
|
108
109
|
| [no-useless-untracked](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/no-useless-untracked.md) | Disallow provably useless `untracked()` wrappers in reactive callbacks | ✅ | 🔧 | |
|
|
109
110
|
| [object-single-line](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/object-single-line.md) | Enforce single-line formatting for single-property objects when it fits `printWidth` | ✅ | 🔧 | |
|
|
110
111
|
| [prefer-combined-if-control-flow](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/prefer-combined-if-control-flow.md) | Combine consecutive `if` statements that use the same `return`, `break`, `continue`, or `throw` | ✅ | 🔧 | |
|
|
112
|
+
| [prefer-conditional-return](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/prefer-conditional-return.md) | Prefer a conditional return over an adjacent `if` branch and fallback `return` | ✅ | 🔧 | |
|
|
111
113
|
| [prefer-deep-imports](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/prefer-deep-imports.md) | Allow deep imports of Taiga UI packages | | 🔧 | |
|
|
112
114
|
| [prefer-loose-null-check](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/prefer-loose-null-check.md) | Prefer loose null checks over paired strict comparisons against `null` and `undefined` | ✅ | 🔧 | |
|
|
113
115
|
| [prefer-multi-arg-push](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/prefer-multi-arg-push.md) | Combine consecutive `.push()` calls on the same array into a single multi-argument call | ✅ | 🔧 | |
|
|
@@ -125,3 +127,61 @@ from third-party plugins. The exact severities and file globs live in
|
|
|
125
127
|
| [single-line-variable-spacing](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/single-line-variable-spacing.md) | Group consecutive single-line variables and separate multiline ones with a blank line | ✅ | 🔧 | |
|
|
126
128
|
| [standalone-imports-sort](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/standalone-imports-sort.md) | Auto sort names inside Angular decorators | ✅ | 🔧 | |
|
|
127
129
|
| [strict-tui-doc-example](https://github.com/taiga-family/toolkit/tree/main/projects/eslint-plugin-experience-next/docs/strict-tui-doc-example.md) | If you use the addon-doc, there will be a hint that you are importing something incorrectly | | 🔧 | |
|
|
130
|
+
|
|
131
|
+
## no-empty-style-metadata
|
|
132
|
+
|
|
133
|
+
Disallows empty Angular component style metadata. The rule reports empty string and empty template literal values for
|
|
134
|
+
`styles` and `styleUrl`, plus `styleUrls: []`, because they do not add component styles and can be safely removed.
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
// ❌ error
|
|
138
|
+
@Component({
|
|
139
|
+
selector: 'app-root',
|
|
140
|
+
templateUrl: './app.component.html',
|
|
141
|
+
styles: ``,
|
|
142
|
+
styleUrl: '',
|
|
143
|
+
styleUrls: [],
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// ✅ after autofix
|
|
147
|
+
@Component({
|
|
148
|
+
selector: 'app-root',
|
|
149
|
+
templateUrl: './app.component.html',
|
|
150
|
+
})
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## prefer-conditional-return
|
|
154
|
+
|
|
155
|
+
Prefer a single conditional return when an `if` statement returns one expression and the immediately following statement
|
|
156
|
+
returns the fallback expression. The rule skips branches with comments, `else`, empty returns, intervening statements,
|
|
157
|
+
or a return expression that is already a conditional expression.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
// ❌ error
|
|
161
|
+
if (index < count) {
|
|
162
|
+
return {value: index++, done: false};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return {value: undefined, done: true};
|
|
166
|
+
|
|
167
|
+
// ✅ after autofix
|
|
168
|
+
return index < count ? {value: index++, done: false} : {value: undefined, done: true};
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
// not changed: if branch return is already conditional
|
|
173
|
+
if (condition) {
|
|
174
|
+
return first ? second : third;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return fallback;
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
// not changed: fallback return is already conditional
|
|
182
|
+
if (condition) {
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return first ? second : third;
|
|
187
|
+
```
|
package/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ declare const plugin: {
|
|
|
18
18
|
'class-property-naming': import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidName", [import("./rules/taiga-specific/class-property-naming").RuleConfig[]], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
19
19
|
name: string;
|
|
20
20
|
};
|
|
21
|
-
'decorator-key-sort': import("eslint").
|
|
21
|
+
'decorator-key-sort': import("@typescript-eslint/utils/ts-eslint").RuleModule<"incorrectOrder", [Record<string, readonly string[]>], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
22
22
|
name: string;
|
|
23
23
|
};
|
|
24
24
|
'element-newline': import("eslint").Rule.RuleModule & {
|
|
@@ -78,6 +78,9 @@ declare const plugin: {
|
|
|
78
78
|
'no-duplicate-in-head': import("eslint").Rule.RuleModule & {
|
|
79
79
|
name: string;
|
|
80
80
|
};
|
|
81
|
+
'no-empty-style-metadata': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEmptyStyleMetadata", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
82
|
+
name: string;
|
|
83
|
+
};
|
|
81
84
|
'no-fully-untracked-effect': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noTrackedReads", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
82
85
|
name: string;
|
|
83
86
|
};
|
|
@@ -142,6 +145,9 @@ declare const plugin: {
|
|
|
142
145
|
'prefer-combined-if-control-flow': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferCombinedIfControlFlow", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
143
146
|
name: string;
|
|
144
147
|
};
|
|
148
|
+
'prefer-conditional-return': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferConditionalReturn", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
149
|
+
name: string;
|
|
150
|
+
};
|
|
145
151
|
'prefer-deep-imports': import("@typescript-eslint/utils/ts-eslint").RuleModule<"prefer-deep-imports", [{
|
|
146
152
|
importFilter: string[] | string;
|
|
147
153
|
strict?: boolean;
|