@trackunit/eslint-plugin-trackunit 0.6.98-alpha-7bd3cf90b54.0 → 0.6.98
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/CHANGELOG.md +38 -0
- package/README.md +7 -0
- package/package.json +2 -1
- package/src/lib/config/index.d.ts +144 -0
- package/src/lib/config/plugins.d.ts +6 -0
- package/src/lib/config/presets/base.d.ts +138 -0
- package/src/lib/config/presets/base.js +13 -0
- package/src/lib/config/presets/react.d.ts +6 -0
- package/src/lib/rules/cva-merge-base-classes-as-array/cva-merge-base-classes-as-array.js +5 -5
- package/src/lib/rules/no-dynamic-translation-key/no-dynamic-translation-key.d.ts +23 -0
- package/src/lib/rules/no-dynamic-translation-key/no-dynamic-translation-key.js +73 -0
- package/src/lib/rules/no-template-strings-in-classname-prop/no-template-strings-in-classname-prop.js +3 -3
- package/src/lib/rules/no-unused-translation-key/no-unused-translation-key.d.ts +24 -0
- package/src/lib/rules/no-unused-translation-key/no-unused-translation-key.js +96 -0
- package/src/lib/rules/no-unused-translation-key/used-strings.d.ts +43 -0
- package/src/lib/rules/no-unused-translation-key/used-strings.js +114 -0
- package/src/lib/rules/require-classname-alternatives/require-classname-alternatives.js +9 -26
- package/src/lib/rules-map.d.ts +6 -0
- package/src/lib/rules-map.js +4 -0
- package/src/lib/utils/classname-utils.d.ts +0 -181
- package/src/lib/utils/classname-utils.js +0 -501
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
## 0.6.98 (2026-08-10)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated css-classname-utils to 0.0.4
|
|
6
|
+
- Updated shared-utils to 1.16.1
|
|
7
|
+
|
|
8
|
+
## 0.6.97 (2026-08-07)
|
|
9
|
+
|
|
10
|
+
### 🚀 Features
|
|
11
|
+
|
|
12
|
+
- updated script and rule to include new edge cases. ([477a049eb4e](https://github.com/Trackunit/manager/commit/477a049eb4e))
|
|
13
|
+
- new lint rules - `no-dynamic-translation-key` and `no-unused-translation-key`. ([4faee07d13f](https://github.com/Trackunit/manager/commit/4faee07d13f))
|
|
14
|
+
|
|
15
|
+
### 🩹 Fixes
|
|
16
|
+
|
|
17
|
+
- spell out language translation keys in full + README updated. ([5d9806135f7](https://github.com/Trackunit/manager/commit/5d9806135f7))
|
|
18
|
+
- match translation keys against source text instead of extracted literals. ([c3a62aa9a9a](https://github.com/Trackunit/manager/commit/c3a62aa9a9a))
|
|
19
|
+
- updated README.md file. ([397a2a25a52](https://github.com/Trackunit/manager/commit/397a2a25a52))
|
|
20
|
+
- re-added translations removed in regression and updated rule/script to handle edge case. ([e6cc45da1e7](https://github.com/Trackunit/manager/commit/e6cc45da1e7))
|
|
21
|
+
- underline the full translation key. ([822eaa68467](https://github.com/Trackunit/manager/commit/822eaa68467))
|
|
22
|
+
|
|
23
|
+
### 🧱 Updated Dependencies
|
|
24
|
+
|
|
25
|
+
- Updated css-classname-utils to 0.0.3
|
|
26
|
+
- Updated shared-utils to 1.16.0
|
|
27
|
+
|
|
28
|
+
### ❤️ Thank You
|
|
29
|
+
|
|
30
|
+
- Maria Almeida @mal-trackunit
|
|
31
|
+
|
|
32
|
+
## 0.6.96 (2026-08-07)
|
|
33
|
+
|
|
34
|
+
### 🧱 Updated Dependencies
|
|
35
|
+
|
|
36
|
+
- Updated css-classname-utils to 0.0.2
|
|
37
|
+
- Updated shared-utils to 1.15.96
|
|
38
|
+
|
|
1
39
|
## 0.6.95 (2026-08-06)
|
|
2
40
|
|
|
3
41
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -90,6 +90,13 @@ All custom rules are enabled automatically through the presets under the `@track
|
|
|
90
90
|
| ----------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
91
91
|
| `@trackunit/require-storybook-folder-landing-page` | error | no | Requires a `*.docs.mdx` landing page (`<Meta title>`) for every ancestor folder implied by a story's title. Enabled for `*.stories.{ts,tsx}` files in the `react` preset. |
|
|
92
92
|
|
|
93
|
+
### Localization
|
|
94
|
+
|
|
95
|
+
| Rule | Severity | Auto-fix | Description |
|
|
96
|
+
| --------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
97
|
+
| `@trackunit/no-dynamic-translation-key` | warn | — | Discourages building i18next keys from template strings (`t(`a.${x}`)`). Map values to explicit keys with a `switch`/`Record`. |
|
|
98
|
+
| `@trackunit/no-unused-translation-key` | warn | — | Reports keys in a library's `locales/en/translation.json` that are never referenced in that library's source. |
|
|
99
|
+
|
|
93
100
|
## Utilities
|
|
94
101
|
|
|
95
102
|
### `createSkipWhen`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/eslint-plugin-trackunit",
|
|
3
|
-
"version": "0.6.98
|
|
3
|
+
"version": "0.6.98",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"engines": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@nx/eslint-plugin": "23.1.0",
|
|
11
|
+
"@trackunit/css-classname-utils": "0.0.4",
|
|
11
12
|
"@typescript-eslint/eslint-plugin": "8.58.1",
|
|
12
13
|
"@typescript-eslint/utils": "8.58.1",
|
|
13
14
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -29,6 +29,9 @@ export declare const configs: {
|
|
|
29
29
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
30
30
|
name: string;
|
|
31
31
|
};
|
|
32
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
32
35
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
33
36
|
name: string;
|
|
34
37
|
};
|
|
@@ -38,6 +41,9 @@ export declare const configs: {
|
|
|
38
41
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
39
42
|
name: string;
|
|
40
43
|
};
|
|
44
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
41
47
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
42
48
|
alternatives: Record<string, Array<string>>;
|
|
43
49
|
prefixes?: Array<string>;
|
|
@@ -140,6 +146,7 @@ export declare const configs: {
|
|
|
140
146
|
[x: string]: import("eslint").Linter.RuleEntry<any[]>;
|
|
141
147
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
142
148
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
149
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
143
150
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
144
151
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
145
152
|
};
|
|
@@ -159,6 +166,7 @@ export declare const configs: {
|
|
|
159
166
|
"no-restricted-globals": import("eslint").Linter.RuleEntry<any[]>;
|
|
160
167
|
"@trackunit/no-internal-barrel-files": string;
|
|
161
168
|
"@trackunit/no-typescript-assertion": string;
|
|
169
|
+
"@trackunit/no-dynamic-translation-key": string;
|
|
162
170
|
"constructor-super": string;
|
|
163
171
|
curly: string;
|
|
164
172
|
"default-case": string;
|
|
@@ -183,6 +191,7 @@ export declare const configs: {
|
|
|
183
191
|
"no-shadow": string;
|
|
184
192
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
185
193
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
194
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
186
195
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
187
196
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
188
197
|
};
|
|
@@ -223,6 +232,9 @@ export declare const configs: {
|
|
|
223
232
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
224
233
|
name: string;
|
|
225
234
|
};
|
|
235
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
236
|
+
name: string;
|
|
237
|
+
};
|
|
226
238
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
227
239
|
name: string;
|
|
228
240
|
};
|
|
@@ -232,6 +244,9 @@ export declare const configs: {
|
|
|
232
244
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
233
245
|
name: string;
|
|
234
246
|
};
|
|
247
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
248
|
+
name: string;
|
|
249
|
+
};
|
|
235
250
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
236
251
|
alternatives: Record<string, Array<string>>;
|
|
237
252
|
prefixes?: Array<string>;
|
|
@@ -297,6 +312,127 @@ export declare const configs: {
|
|
|
297
312
|
rules: {
|
|
298
313
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public": string;
|
|
299
314
|
"@trackunit/no-deprecated-graphql-fields": string;
|
|
315
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
316
|
+
"@typescript-eslint/no-require-imports"?: undefined;
|
|
317
|
+
"@nx/enforce-module-boundaries"?: undefined;
|
|
318
|
+
};
|
|
319
|
+
} | {
|
|
320
|
+
files: string[];
|
|
321
|
+
languageOptions: {
|
|
322
|
+
parser: import("eslint").Linter.Parser;
|
|
323
|
+
ecmaVersion?: undefined;
|
|
324
|
+
sourceType?: undefined;
|
|
325
|
+
parserOptions?: undefined;
|
|
326
|
+
};
|
|
327
|
+
plugins: {
|
|
328
|
+
"@trackunit": {
|
|
329
|
+
rules: {
|
|
330
|
+
"component-name-matches-filename": import("@typescript-eslint/utils/ts-eslint").RuleModule<"componentNameMismatch", [{
|
|
331
|
+
allowedMismatches?: ReadonlyArray<{
|
|
332
|
+
file: string;
|
|
333
|
+
component: string;
|
|
334
|
+
}>;
|
|
335
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
336
|
+
name: string;
|
|
337
|
+
};
|
|
338
|
+
"one-component-per-file": import("@typescript-eslint/utils/ts-eslint").RuleModule<"tooManyExported" | "tooManyComponents", [{
|
|
339
|
+
exportedOnly?: boolean;
|
|
340
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
341
|
+
name: string;
|
|
342
|
+
};
|
|
343
|
+
"cva-merge-base-classes-as-array": import("@typescript-eslint/utils/ts-eslint").RuleModule<"stringNeedsArray" | "arrayNeedsSplit", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
344
|
+
name: string;
|
|
345
|
+
};
|
|
346
|
+
"no-internal-barrel-files": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
347
|
+
name: string;
|
|
348
|
+
};
|
|
349
|
+
"no-typescript-assertion": import("@typescript-eslint/utils/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
350
|
+
name: string;
|
|
351
|
+
};
|
|
352
|
+
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
353
|
+
name: string;
|
|
354
|
+
};
|
|
355
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
356
|
+
name: string;
|
|
357
|
+
};
|
|
358
|
+
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
359
|
+
name: string;
|
|
360
|
+
};
|
|
361
|
+
"design-guideline-button-icon-size-match": import("@typescript-eslint/utils/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
362
|
+
name: string;
|
|
363
|
+
};
|
|
364
|
+
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
365
|
+
name: string;
|
|
366
|
+
};
|
|
367
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
368
|
+
name: string;
|
|
369
|
+
};
|
|
370
|
+
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
371
|
+
alternatives: Record<string, Array<string>>;
|
|
372
|
+
prefixes?: Array<string>;
|
|
373
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
374
|
+
name: string;
|
|
375
|
+
};
|
|
376
|
+
"no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
377
|
+
name: string;
|
|
378
|
+
};
|
|
379
|
+
"prefer-destructured-imports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
|
|
380
|
+
packages: Record<string, string>;
|
|
381
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
382
|
+
name: string;
|
|
383
|
+
};
|
|
384
|
+
"prefer-mouse-event-handler-in-react-props": import("@typescript-eslint/utils/ts-eslint").RuleModule<"suggestMouseEventHandler" | "preferMouseEventHandler", [{
|
|
385
|
+
allowedNames?: ReadonlyArray<string>;
|
|
386
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
387
|
+
name: string;
|
|
388
|
+
};
|
|
389
|
+
"prefer-event-specific-callback-naming": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("../rules/prefer-event-specific-callback-naming/strategies/string-based").NameBasedMessageIds | import("../rules/prefer-event-specific-callback-naming/strategies/type-based").TypeBasedMessageIds, [{
|
|
390
|
+
allowedNames?: ReadonlyArray<string>;
|
|
391
|
+
events?: ReadonlyArray<string>;
|
|
392
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
393
|
+
name: string;
|
|
394
|
+
};
|
|
395
|
+
"require-optional-prop-initialization": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("../rules/require-optional-prop-initialization/suggestion-utils").MessageIds, [{
|
|
396
|
+
allowNullableObject?: boolean;
|
|
397
|
+
allowNullableBoolean?: boolean;
|
|
398
|
+
allowNullableString?: boolean;
|
|
399
|
+
allowNullableNumber?: boolean;
|
|
400
|
+
allowNullableEnum?: boolean;
|
|
401
|
+
allowNullableStringLiteralUnion?: boolean;
|
|
402
|
+
onlyRequireUsedProps?: boolean;
|
|
403
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
404
|
+
name: string;
|
|
405
|
+
};
|
|
406
|
+
"require-component-prop-contracts": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPropContracts", [{
|
|
407
|
+
requiredProps?: ReadonlyArray<string>;
|
|
408
|
+
requiredInterfaces?: ReadonlyArray<string>;
|
|
409
|
+
restrictToComponentsWithJsxReturn?: boolean;
|
|
410
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
411
|
+
name: string;
|
|
412
|
+
};
|
|
413
|
+
"prefer-field-components": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferFieldComponent", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
414
|
+
name: string;
|
|
415
|
+
};
|
|
416
|
+
"require-list-item-virtualization-props": import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireVirtualizationProps" | "spreadListItemProps" | "useSemanticListItem", [{
|
|
417
|
+
allowCustomComponents?: boolean;
|
|
418
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
419
|
+
name: string;
|
|
420
|
+
};
|
|
421
|
+
"require-storybook-folder-landing-page": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingLandingPage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
422
|
+
name: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
"@nx"?: undefined;
|
|
427
|
+
"@typescript-eslint"?: undefined;
|
|
428
|
+
"no-null"?: undefined;
|
|
429
|
+
"import-x"?: undefined;
|
|
430
|
+
jsdoc?: undefined;
|
|
431
|
+
};
|
|
432
|
+
rules: {
|
|
433
|
+
"@trackunit/no-unused-translation-key": string;
|
|
434
|
+
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
435
|
+
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
300
436
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
301
437
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
302
438
|
};
|
|
@@ -306,6 +442,7 @@ export declare const configs: {
|
|
|
306
442
|
"@typescript-eslint/no-require-imports": string;
|
|
307
443
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
308
444
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
445
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
309
446
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
310
447
|
};
|
|
311
448
|
plugins?: undefined;
|
|
@@ -316,6 +453,7 @@ export declare const configs: {
|
|
|
316
453
|
"@nx/enforce-module-boundaries": string;
|
|
317
454
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
318
455
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
456
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
319
457
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
320
458
|
};
|
|
321
459
|
plugins?: undefined;
|
|
@@ -350,6 +488,9 @@ export declare const configs: {
|
|
|
350
488
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
351
489
|
name: string;
|
|
352
490
|
};
|
|
491
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
492
|
+
name: string;
|
|
493
|
+
};
|
|
353
494
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
354
495
|
name: string;
|
|
355
496
|
};
|
|
@@ -359,6 +500,9 @@ export declare const configs: {
|
|
|
359
500
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
360
501
|
name: string;
|
|
361
502
|
};
|
|
503
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
504
|
+
name: string;
|
|
505
|
+
};
|
|
362
506
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
363
507
|
alternatives: Record<string, Array<string>>;
|
|
364
508
|
prefixes?: Array<string>;
|
|
@@ -47,6 +47,9 @@ export declare const localRulesPlugin: {
|
|
|
47
47
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
48
48
|
name: string;
|
|
49
49
|
};
|
|
50
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
51
|
+
name: string;
|
|
52
|
+
};
|
|
50
53
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
51
54
|
name: string;
|
|
52
55
|
};
|
|
@@ -56,6 +59,9 @@ export declare const localRulesPlugin: {
|
|
|
56
59
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
57
60
|
name: string;
|
|
58
61
|
};
|
|
62
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
63
|
+
name: string;
|
|
64
|
+
};
|
|
59
65
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
60
66
|
alternatives: Record<string, Array<string>>;
|
|
61
67
|
prefixes?: Array<string>;
|
|
@@ -29,6 +29,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
29
29
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
30
30
|
name: string;
|
|
31
31
|
};
|
|
32
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
32
35
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
33
36
|
name: string;
|
|
34
37
|
};
|
|
@@ -38,6 +41,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
38
41
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
39
42
|
name: string;
|
|
40
43
|
};
|
|
44
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
45
|
+
name: string;
|
|
46
|
+
};
|
|
41
47
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
42
48
|
alternatives: Record<string, Array<string>>;
|
|
43
49
|
prefixes?: Array<string>;
|
|
@@ -140,6 +146,7 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
140
146
|
[x: string]: import("eslint").Linter.RuleEntry<any[]>;
|
|
141
147
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
142
148
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
149
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
143
150
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
144
151
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
145
152
|
};
|
|
@@ -159,6 +166,7 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
159
166
|
"no-restricted-globals": import("eslint").Linter.RuleEntry<any[]>;
|
|
160
167
|
"@trackunit/no-internal-barrel-files": string;
|
|
161
168
|
"@trackunit/no-typescript-assertion": string;
|
|
169
|
+
"@trackunit/no-dynamic-translation-key": string;
|
|
162
170
|
"constructor-super": string;
|
|
163
171
|
curly: string;
|
|
164
172
|
"default-case": string;
|
|
@@ -183,6 +191,7 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
183
191
|
"no-shadow": string;
|
|
184
192
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
185
193
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
194
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
186
195
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
187
196
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
188
197
|
};
|
|
@@ -223,6 +232,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
223
232
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
224
233
|
name: string;
|
|
225
234
|
};
|
|
235
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
236
|
+
name: string;
|
|
237
|
+
};
|
|
226
238
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
227
239
|
name: string;
|
|
228
240
|
};
|
|
@@ -232,6 +244,9 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
232
244
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
233
245
|
name: string;
|
|
234
246
|
};
|
|
247
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
248
|
+
name: string;
|
|
249
|
+
};
|
|
235
250
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
236
251
|
alternatives: Record<string, Array<string>>;
|
|
237
252
|
prefixes?: Array<string>;
|
|
@@ -297,6 +312,127 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
297
312
|
rules: {
|
|
298
313
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public": string;
|
|
299
314
|
"@trackunit/no-deprecated-graphql-fields": string;
|
|
315
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
316
|
+
"@typescript-eslint/no-require-imports"?: undefined;
|
|
317
|
+
"@nx/enforce-module-boundaries"?: undefined;
|
|
318
|
+
};
|
|
319
|
+
} | {
|
|
320
|
+
files: string[];
|
|
321
|
+
languageOptions: {
|
|
322
|
+
parser: import("eslint").Linter.Parser;
|
|
323
|
+
ecmaVersion?: undefined;
|
|
324
|
+
sourceType?: undefined;
|
|
325
|
+
parserOptions?: undefined;
|
|
326
|
+
};
|
|
327
|
+
plugins: {
|
|
328
|
+
"@trackunit": {
|
|
329
|
+
rules: {
|
|
330
|
+
"component-name-matches-filename": import("@typescript-eslint/utils/ts-eslint").RuleModule<"componentNameMismatch", [{
|
|
331
|
+
allowedMismatches?: ReadonlyArray<{
|
|
332
|
+
file: string;
|
|
333
|
+
component: string;
|
|
334
|
+
}>;
|
|
335
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
336
|
+
name: string;
|
|
337
|
+
};
|
|
338
|
+
"one-component-per-file": import("@typescript-eslint/utils/ts-eslint").RuleModule<"tooManyExported" | "tooManyComponents", [{
|
|
339
|
+
exportedOnly?: boolean;
|
|
340
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
341
|
+
name: string;
|
|
342
|
+
};
|
|
343
|
+
"cva-merge-base-classes-as-array": import("@typescript-eslint/utils/ts-eslint").RuleModule<"stringNeedsArray" | "arrayNeedsSplit", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
344
|
+
name: string;
|
|
345
|
+
};
|
|
346
|
+
"no-internal-barrel-files": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInternalBarrel", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
347
|
+
name: string;
|
|
348
|
+
};
|
|
349
|
+
"no-typescript-assertion": import("@typescript-eslint/utils/ts-eslint").RuleModule<"angleBracketAssertion" | "asAssertion" | "nonNullAssertion", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
350
|
+
name: string;
|
|
351
|
+
};
|
|
352
|
+
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
353
|
+
name: string;
|
|
354
|
+
};
|
|
355
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
356
|
+
name: string;
|
|
357
|
+
};
|
|
358
|
+
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
359
|
+
name: string;
|
|
360
|
+
};
|
|
361
|
+
"design-guideline-button-icon-size-match": import("@typescript-eslint/utils/ts-eslint").RuleModule<"incorrectIconSize", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
362
|
+
name: string;
|
|
363
|
+
};
|
|
364
|
+
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
365
|
+
name: string;
|
|
366
|
+
};
|
|
367
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
368
|
+
name: string;
|
|
369
|
+
};
|
|
370
|
+
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
371
|
+
alternatives: Record<string, Array<string>>;
|
|
372
|
+
prefixes?: Array<string>;
|
|
373
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
374
|
+
name: string;
|
|
375
|
+
};
|
|
376
|
+
"no-jest-mock-trackunit-react-core-hooks": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDirectMock", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
377
|
+
name: string;
|
|
378
|
+
};
|
|
379
|
+
"prefer-destructured-imports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferDestructured" | "preferDestructuredGlobal", [({
|
|
380
|
+
packages: Record<string, string>;
|
|
381
|
+
} | undefined)?], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
382
|
+
name: string;
|
|
383
|
+
};
|
|
384
|
+
"prefer-mouse-event-handler-in-react-props": import("@typescript-eslint/utils/ts-eslint").RuleModule<"suggestMouseEventHandler" | "preferMouseEventHandler", [{
|
|
385
|
+
allowedNames?: ReadonlyArray<string>;
|
|
386
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
387
|
+
name: string;
|
|
388
|
+
};
|
|
389
|
+
"prefer-event-specific-callback-naming": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("../../rules/prefer-event-specific-callback-naming/strategies/string-based").NameBasedMessageIds | import("../../rules/prefer-event-specific-callback-naming/strategies/type-based").TypeBasedMessageIds, [{
|
|
390
|
+
allowedNames?: ReadonlyArray<string>;
|
|
391
|
+
events?: ReadonlyArray<string>;
|
|
392
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
393
|
+
name: string;
|
|
394
|
+
};
|
|
395
|
+
"require-optional-prop-initialization": import("@typescript-eslint/utils/ts-eslint").RuleModule<import("../../rules/require-optional-prop-initialization/suggestion-utils").MessageIds, [{
|
|
396
|
+
allowNullableObject?: boolean;
|
|
397
|
+
allowNullableBoolean?: boolean;
|
|
398
|
+
allowNullableString?: boolean;
|
|
399
|
+
allowNullableNumber?: boolean;
|
|
400
|
+
allowNullableEnum?: boolean;
|
|
401
|
+
allowNullableStringLiteralUnion?: boolean;
|
|
402
|
+
onlyRequireUsedProps?: boolean;
|
|
403
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
404
|
+
name: string;
|
|
405
|
+
};
|
|
406
|
+
"require-component-prop-contracts": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPropContracts", [{
|
|
407
|
+
requiredProps?: ReadonlyArray<string>;
|
|
408
|
+
requiredInterfaces?: ReadonlyArray<string>;
|
|
409
|
+
restrictToComponentsWithJsxReturn?: boolean;
|
|
410
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
411
|
+
name: string;
|
|
412
|
+
};
|
|
413
|
+
"prefer-field-components": import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferFieldComponent", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
414
|
+
name: string;
|
|
415
|
+
};
|
|
416
|
+
"require-list-item-virtualization-props": import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireVirtualizationProps" | "spreadListItemProps" | "useSemanticListItem", [{
|
|
417
|
+
allowCustomComponents?: boolean;
|
|
418
|
+
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
419
|
+
name: string;
|
|
420
|
+
};
|
|
421
|
+
"require-storybook-folder-landing-page": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingLandingPage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
422
|
+
name: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
"@nx"?: undefined;
|
|
427
|
+
"@typescript-eslint"?: undefined;
|
|
428
|
+
"no-null"?: undefined;
|
|
429
|
+
"import-x"?: undefined;
|
|
430
|
+
jsdoc?: undefined;
|
|
431
|
+
};
|
|
432
|
+
rules: {
|
|
433
|
+
"@trackunit/no-unused-translation-key": string;
|
|
434
|
+
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
435
|
+
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
300
436
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
301
437
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
302
438
|
};
|
|
@@ -306,6 +442,7 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
306
442
|
"@typescript-eslint/no-require-imports": string;
|
|
307
443
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
308
444
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
445
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
309
446
|
"@nx/enforce-module-boundaries"?: undefined;
|
|
310
447
|
};
|
|
311
448
|
plugins?: undefined;
|
|
@@ -316,6 +453,7 @@ export declare const base: (import("eslint").Linter.FlatConfig<import("eslint").
|
|
|
316
453
|
"@nx/enforce-module-boundaries": string;
|
|
317
454
|
"@trackunit/no-internal-graphql-when-tagged-with-gql-public"?: undefined;
|
|
318
455
|
"@trackunit/no-deprecated-graphql-fields"?: undefined;
|
|
456
|
+
"@trackunit/no-unused-translation-key"?: undefined;
|
|
319
457
|
"@typescript-eslint/no-require-imports"?: undefined;
|
|
320
458
|
};
|
|
321
459
|
plugins?: undefined;
|
|
@@ -107,6 +107,7 @@ exports.base = [
|
|
|
107
107
|
"no-restricted-globals": no_direct_storage_access_1.noDirectStorageGlobalsRule,
|
|
108
108
|
"@trackunit/no-internal-barrel-files": "error",
|
|
109
109
|
"@trackunit/no-typescript-assertion": "warn",
|
|
110
|
+
"@trackunit/no-dynamic-translation-key": "warn",
|
|
110
111
|
...import_rules_1.importRules,
|
|
111
112
|
...typescript_rules_1.typescriptRules,
|
|
112
113
|
},
|
|
@@ -124,6 +125,18 @@ exports.base = [
|
|
|
124
125
|
"@trackunit/no-deprecated-graphql-fields": "warn",
|
|
125
126
|
},
|
|
126
127
|
},
|
|
128
|
+
{
|
|
129
|
+
files: ["**/locales/en/translation.json"],
|
|
130
|
+
languageOptions: {
|
|
131
|
+
parser: plugins_1.jsoncParser,
|
|
132
|
+
},
|
|
133
|
+
plugins: {
|
|
134
|
+
"@trackunit": plugins_1.localRulesPlugin,
|
|
135
|
+
},
|
|
136
|
+
rules: {
|
|
137
|
+
"@trackunit/no-unused-translation-key": "warn",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
127
140
|
jest_overrides_1.baseJestOverrides,
|
|
128
141
|
{
|
|
129
142
|
files: [
|
|
@@ -28,6 +28,9 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
|
|
|
28
28
|
"no-deprecated-graphql-fields": import("@typescript-eslint/utils/ts-eslint").RuleModule<"deprecatedFieldUsed", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
29
29
|
name: string;
|
|
30
30
|
};
|
|
31
|
+
"no-dynamic-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"dynamicKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
31
34
|
"no-internal-graphql-when-tagged-with-gql-public": import("@typescript-eslint/utils/ts-eslint").RuleModule<"internalGraphqlFileFound", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
32
35
|
name: string;
|
|
33
36
|
};
|
|
@@ -37,6 +40,9 @@ export declare const reactPreset: (import("eslint").Linter.Config<import("eslint
|
|
|
37
40
|
"no-template-strings-in-classname-prop": import("@typescript-eslint/utils/ts-eslint").RuleModule<"templateStringInClassName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
38
41
|
name: string;
|
|
39
42
|
};
|
|
43
|
+
"no-unused-translation-key": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedKey", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
40
46
|
"require-classname-alternatives": import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedClassAutoFix" | "bannedClassSuggest" | "suggestReplacement", [({
|
|
41
47
|
alternatives: Record<string, Array<string>>;
|
|
42
48
|
prefixes?: Array<string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cvaMergeBaseClassesAsArray = void 0;
|
|
4
|
+
const css_classname_utils_1 = require("@trackunit/css-classname-utils");
|
|
4
5
|
const utils_1 = require("@typescript-eslint/utils");
|
|
5
|
-
const classname_utils_1 = require("../../utils/classname-utils");
|
|
6
6
|
const createRule = utils_1.ESLintUtils.RuleCreator(name => `https://github.com/trackunit/manager/blob/main/libs/eslint/plugin-trackunit/src/lib/rules/${name}.ts`);
|
|
7
7
|
const isCvaMergeBaseContext = (context) => {
|
|
8
8
|
if (context.type === "function-call") {
|
|
@@ -48,7 +48,7 @@ exports.cvaMergeBaseClassesAsArray = createRule({
|
|
|
48
48
|
if (!firstArg) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const baseClassLocations = (0,
|
|
51
|
+
const baseClassLocations = (0, css_classname_utils_1.findClassnameStringsInCall)(node)
|
|
52
52
|
.filter(location => isCvaMergeBaseContext(location.context))
|
|
53
53
|
.filter(isLiteralLocation);
|
|
54
54
|
// Handle string literal: cvaMerge("class1 class2")
|
|
@@ -63,7 +63,7 @@ exports.cvaMergeBaseClassesAsArray = createRule({
|
|
|
63
63
|
node,
|
|
64
64
|
messageId: "stringNeedsArray",
|
|
65
65
|
fix(fixer) {
|
|
66
|
-
return fixer.replaceText(baseClassLocation.fixNode, (0,
|
|
66
|
+
return fixer.replaceText(baseClassLocation.fixNode, (0, css_classname_utils_1.formatAsArray)((0, css_classname_utils_1.splitClasses)(value)));
|
|
67
67
|
},
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -77,8 +77,8 @@ exports.cvaMergeBaseClassesAsArray = createRule({
|
|
|
77
77
|
node,
|
|
78
78
|
messageId: "arrayNeedsSplit",
|
|
79
79
|
fix(fixer) {
|
|
80
|
-
const allClasses = baseClassLocations.flatMap(location => (0,
|
|
81
|
-
return fixer.replaceText(firstArg, (0,
|
|
80
|
+
const allClasses = baseClassLocations.flatMap(location => (0, css_classname_utils_1.splitClasses)(location.value));
|
|
81
|
+
return fixer.replaceText(firstArg, (0, css_classname_utils_1.formatAsArray)(allClasses));
|
|
82
82
|
},
|
|
83
83
|
});
|
|
84
84
|
}
|