@itcase/lint 1.1.118 → 1.1.119
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 +2 -0
- package/README.md +12 -0
- package/dist/eslint/restrictWords/config.d.ts +3 -0
- package/dist/eslint/restrictWords/index.d.ts +14 -1
- package/dist/eslint/restrictWords/index.test.d.ts +1 -0
- package/dist/eslint/restrictWords.js +16 -4
- package/dist/eslint/storybook/index.d.ts +244 -80
- package/dist/eslint/storybook.js +2 -1
- package/dist/eslint.js +1 -1
- package/dist/{index_CLRVzI9l.js → index_BcADaVRv.js} +5 -1
- package/package.json +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
## [1.1.119](https://github.com/ITCase/itcase-lint/compare/v1.1.118...v1.1.119) (2026-07-28)
|
|
2
|
+
|
|
1
3
|
## [1.1.118](https://github.com/ITCase/itcase-lint/compare/v1.1.117...v1.1.118) (2026-07-15)
|
|
2
4
|
|
|
3
5
|
## [1.1.117](https://github.com/ITCase/itcase-lint/compare/v1.1.116...v1.1.117) (2026-06-11)
|
package/README.md
CHANGED
|
@@ -175,6 +175,18 @@ export default [...eslint, ...eslintStorybook]
|
|
|
175
175
|
|
|
176
176
|
The rule `itcase-lint/storybook-meta-parameters-design` is enabled by default with level `warn` for files `**/*.stories.{ts,tsx,js,jsx,mjs,cjs}`.
|
|
177
177
|
|
|
178
|
+
For the same story files, the identifier `fn` is allowed in `no-restricted-syntax` so you can use Storybook’s recommended API:
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import { fn } from 'storybook/test'
|
|
182
|
+
|
|
183
|
+
args: {
|
|
184
|
+
onClick: fn(),
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Other restricted abbreviations (`btn`, `idx`, …) still apply in stories.
|
|
189
|
+
|
|
178
190
|
**Meta requirements**
|
|
179
191
|
|
|
180
192
|
If the story’s default export has `parameters`, it must include a `parameters.design` object with `type: 'figma'` and a non-empty `url` containing `figma.com`. Example:
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Проверяется только точное совпадение имени идентификатора (например "btn", но не "primaryBtn").
|
|
4
4
|
* - forbidden: сокращение для сообщения об ошибке.
|
|
5
5
|
* - use: что писать вместо (строка или массив вариантов).
|
|
6
|
+
*
|
|
7
|
+
* Исключения по файлам (например `fn` в Storybook stories) — в
|
|
8
|
+
* `buildNoRestrictedSyntaxOptions({ exclude })` / `src/eslint/storybook`.
|
|
6
9
|
*/
|
|
7
10
|
export declare const RESTRICTED_WORDS: ReadonlyArray<{
|
|
8
11
|
forbidden: string;
|
|
@@ -2,5 +2,18 @@ type NoRestrictedSyntaxEntry = 'off' | ['error', ...Array<{
|
|
|
2
2
|
message: string;
|
|
3
3
|
selector: string;
|
|
4
4
|
}>];
|
|
5
|
-
|
|
5
|
+
type BuildNoRestrictedSyntaxOptions = {
|
|
6
|
+
/** Идентификаторы из RESTRICTED_WORDS, которые не запрещать (например `fn` в Storybook). */
|
|
7
|
+
exclude?: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
declare function buildNoRestrictedSyntaxOptions(options?: BuildNoRestrictedSyntaxOptions): NoRestrictedSyntaxEntry;
|
|
10
|
+
/** Базовое правило: все сокращения из RESTRICTED_WORDS. */
|
|
11
|
+
declare const noRestrictedSyntaxRestrictWords: NoRestrictedSyntaxEntry;
|
|
12
|
+
/**
|
|
13
|
+
* Для `*.stories.*`: `fn` разрешён — это API Storybook (`import { fn } from 'storybook/test'`).
|
|
14
|
+
* Остальные сокращения по-прежнему запрещены.
|
|
15
|
+
*/
|
|
16
|
+
declare const noRestrictedSyntaxRestrictWordsForStorybook: NoRestrictedSyntaxEntry;
|
|
17
|
+
export { buildNoRestrictedSyntaxOptions, noRestrictedSyntaxRestrictWords, noRestrictedSyntaxRestrictWordsForStorybook, };
|
|
6
18
|
export { RESTRICTED_WORDS } from './config';
|
|
19
|
+
export type { BuildNoRestrictedSyntaxOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* Проверяется только точное совпадение имени идентификатора (например "btn", но не "primaryBtn").
|
|
4
4
|
* - forbidden: сокращение для сообщения об ошибке.
|
|
5
5
|
* - use: что писать вместо (строка или массив вариантов).
|
|
6
|
+
*
|
|
7
|
+
* Исключения по файлам (например `fn` в Storybook stories) — в
|
|
8
|
+
* `buildNoRestrictedSyntaxOptions({ exclude })` / `src/eslint/storybook`.
|
|
6
9
|
*/
|
|
7
10
|
const RESTRICTED_WORDS = [
|
|
8
11
|
{ forbidden: 'e', use: ['event', 'element'] },
|
|
@@ -24,6 +27,7 @@ const RESTRICTED_WORDS = [
|
|
|
24
27
|
{ forbidden: 'def', use: 'default' },
|
|
25
28
|
{ forbidden: 'doc', use: 'document' },
|
|
26
29
|
{ forbidden: 'elem', use: 'element' },
|
|
30
|
+
// В Storybook stories разрешён через storybook config: `fn` из `storybook/test`.
|
|
27
31
|
{ forbidden: 'fn', use: ['function', 'callback'] },
|
|
28
32
|
{ forbidden: 'idx', use: 'index' },
|
|
29
33
|
{ forbidden: 'len', use: 'length' },
|
|
@@ -36,11 +40,13 @@ const RESTRICTED_WORDS = [
|
|
|
36
40
|
{ forbidden: 'tst', use: 'test' },
|
|
37
41
|
];
|
|
38
42
|
|
|
39
|
-
function buildNoRestrictedSyntaxOptions() {
|
|
40
|
-
|
|
43
|
+
function buildNoRestrictedSyntaxOptions(options = {}) {
|
|
44
|
+
const excludeSet = new Set(options.exclude ?? []);
|
|
45
|
+
const words = RESTRICTED_WORDS.filter(({ forbidden }) => !excludeSet.has(forbidden));
|
|
46
|
+
if (words.length === 0) {
|
|
41
47
|
return 'off';
|
|
42
48
|
}
|
|
43
|
-
const selectors =
|
|
49
|
+
const selectors = words.map(({ forbidden, use }) => {
|
|
44
50
|
const useList = Array.isArray(use) ? use : [use];
|
|
45
51
|
const useText = useList.length === 1
|
|
46
52
|
? `Use "${useList[0]}" instead.`
|
|
@@ -52,6 +58,12 @@ function buildNoRestrictedSyntaxOptions() {
|
|
|
52
58
|
});
|
|
53
59
|
return ['error', ...selectors];
|
|
54
60
|
}
|
|
61
|
+
/** Базовое правило: все сокращения из RESTRICTED_WORDS. */
|
|
55
62
|
const noRestrictedSyntaxRestrictWords = buildNoRestrictedSyntaxOptions();
|
|
63
|
+
/**
|
|
64
|
+
* Для `*.stories.*`: `fn` разрешён — это API Storybook (`import { fn } from 'storybook/test'`).
|
|
65
|
+
* Остальные сокращения по-прежнему запрещены.
|
|
66
|
+
*/
|
|
67
|
+
const noRestrictedSyntaxRestrictWordsForStorybook = buildNoRestrictedSyntaxOptions({ exclude: ['fn'] });
|
|
56
68
|
|
|
57
|
-
export { RESTRICTED_WORDS, noRestrictedSyntaxRestrictWords };
|
|
69
|
+
export { RESTRICTED_WORDS, buildNoRestrictedSyntaxOptions, noRestrictedSyntaxRestrictWords, noRestrictedSyntaxRestrictWordsForStorybook };
|
|
@@ -131,29 +131,61 @@ declare const _default: {
|
|
|
131
131
|
readonly storybook: {
|
|
132
132
|
configs: any;
|
|
133
133
|
rules: {
|
|
134
|
-
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
"
|
|
138
|
-
|
|
134
|
+
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
135
|
+
name: string;
|
|
136
|
+
};
|
|
137
|
+
"context-in-play-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"passContextToPlayFunction", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
138
|
+
name: string;
|
|
139
|
+
};
|
|
140
|
+
"csf-component": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingComponentProperty", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
141
|
+
name: string;
|
|
142
|
+
};
|
|
143
|
+
"default-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"fixSuggestion" | "shouldHaveDefaultExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
144
|
+
name: string;
|
|
145
|
+
};
|
|
146
|
+
"hierarchy-separator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCorrectSeparators" | "deprecatedHierarchySeparator", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
147
|
+
name: string;
|
|
148
|
+
};
|
|
139
149
|
"meta-inline-properties": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldHaveInlineProperties", {
|
|
140
150
|
csfVersion: number;
|
|
141
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"
|
|
145
|
-
|
|
146
|
-
|
|
151
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
152
|
+
name: string;
|
|
153
|
+
};
|
|
154
|
+
"meta-satisfies-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldSatisfyType", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
155
|
+
name: string;
|
|
156
|
+
};
|
|
157
|
+
"no-redundant-story-name": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeRedundantName" | "storyNameIsRedundant", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
158
|
+
name: string;
|
|
159
|
+
};
|
|
160
|
+
"no-renderer-packages": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRendererPackages", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
161
|
+
name: string;
|
|
162
|
+
};
|
|
163
|
+
"no-stories-of": import("@typescript-eslint/utils/ts-eslint").RuleModule<"doNotUseStoriesOf", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
164
|
+
name: string;
|
|
165
|
+
};
|
|
166
|
+
"no-title-property-in-meta": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeTitleInMeta" | "noTitleInMeta", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
167
|
+
name: string;
|
|
168
|
+
};
|
|
147
169
|
"no-uninstalled-addons": import("@typescript-eslint/utils/ts-eslint").RuleModule<"addonIsNotInstalled", {
|
|
148
170
|
packageJsonLocation: string;
|
|
149
171
|
ignore: string[];
|
|
150
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
151
|
-
|
|
152
|
-
|
|
172
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
173
|
+
name: string;
|
|
174
|
+
};
|
|
175
|
+
"prefer-pascal-case": import("@typescript-eslint/utils/ts-eslint").RuleModule<"convertToPascalCase" | "usePascalCase", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
176
|
+
name: string;
|
|
177
|
+
};
|
|
178
|
+
"story-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldHaveStoryExport" | "shouldHaveStoryExportWithFilters" | "addStoryExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
179
|
+
name: string;
|
|
180
|
+
};
|
|
153
181
|
"use-storybook-expect": import("@typescript-eslint/utils/ts-eslint").RuleModule<string, {
|
|
154
182
|
storybookJestPath?: string;
|
|
155
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
156
|
-
|
|
183
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
184
|
+
name: string;
|
|
185
|
+
};
|
|
186
|
+
"use-storybook-testing-library": import("@typescript-eslint/utils/ts-eslint").RuleModule<"updateImports" | "dontUseTestingLibraryDirectly", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
187
|
+
name: string;
|
|
188
|
+
};
|
|
157
189
|
};
|
|
158
190
|
};
|
|
159
191
|
};
|
|
@@ -194,29 +226,61 @@ declare const _default: {
|
|
|
194
226
|
readonly storybook: {
|
|
195
227
|
configs: any;
|
|
196
228
|
rules: {
|
|
197
|
-
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"
|
|
201
|
-
|
|
229
|
+
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
230
|
+
name: string;
|
|
231
|
+
};
|
|
232
|
+
"context-in-play-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"passContextToPlayFunction", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
233
|
+
name: string;
|
|
234
|
+
};
|
|
235
|
+
"csf-component": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingComponentProperty", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
236
|
+
name: string;
|
|
237
|
+
};
|
|
238
|
+
"default-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"fixSuggestion" | "shouldHaveDefaultExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
239
|
+
name: string;
|
|
240
|
+
};
|
|
241
|
+
"hierarchy-separator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCorrectSeparators" | "deprecatedHierarchySeparator", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
242
|
+
name: string;
|
|
243
|
+
};
|
|
202
244
|
"meta-inline-properties": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldHaveInlineProperties", {
|
|
203
245
|
csfVersion: number;
|
|
204
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
|
|
246
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
247
|
+
name: string;
|
|
248
|
+
};
|
|
249
|
+
"meta-satisfies-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldSatisfyType", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
250
|
+
name: string;
|
|
251
|
+
};
|
|
252
|
+
"no-redundant-story-name": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeRedundantName" | "storyNameIsRedundant", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
253
|
+
name: string;
|
|
254
|
+
};
|
|
255
|
+
"no-renderer-packages": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRendererPackages", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
256
|
+
name: string;
|
|
257
|
+
};
|
|
258
|
+
"no-stories-of": import("@typescript-eslint/utils/ts-eslint").RuleModule<"doNotUseStoriesOf", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
259
|
+
name: string;
|
|
260
|
+
};
|
|
261
|
+
"no-title-property-in-meta": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeTitleInMeta" | "noTitleInMeta", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
262
|
+
name: string;
|
|
263
|
+
};
|
|
210
264
|
"no-uninstalled-addons": import("@typescript-eslint/utils/ts-eslint").RuleModule<"addonIsNotInstalled", {
|
|
211
265
|
packageJsonLocation: string;
|
|
212
266
|
ignore: string[];
|
|
213
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
214
|
-
|
|
215
|
-
|
|
267
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
268
|
+
name: string;
|
|
269
|
+
};
|
|
270
|
+
"prefer-pascal-case": import("@typescript-eslint/utils/ts-eslint").RuleModule<"convertToPascalCase" | "usePascalCase", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
271
|
+
name: string;
|
|
272
|
+
};
|
|
273
|
+
"story-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldHaveStoryExport" | "shouldHaveStoryExportWithFilters" | "addStoryExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
274
|
+
name: string;
|
|
275
|
+
};
|
|
216
276
|
"use-storybook-expect": import("@typescript-eslint/utils/ts-eslint").RuleModule<string, {
|
|
217
277
|
storybookJestPath?: string;
|
|
218
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
219
|
-
|
|
278
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
279
|
+
name: string;
|
|
280
|
+
};
|
|
281
|
+
"use-storybook-testing-library": import("@typescript-eslint/utils/ts-eslint").RuleModule<"updateImports" | "dontUseTestingLibraryDirectly", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
282
|
+
name: string;
|
|
283
|
+
};
|
|
220
284
|
};
|
|
221
285
|
};
|
|
222
286
|
};
|
|
@@ -266,29 +330,61 @@ declare const _default: {
|
|
|
266
330
|
readonly storybook: {
|
|
267
331
|
configs: any;
|
|
268
332
|
rules: {
|
|
269
|
-
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"
|
|
273
|
-
|
|
333
|
+
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
334
|
+
name: string;
|
|
335
|
+
};
|
|
336
|
+
"context-in-play-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"passContextToPlayFunction", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
337
|
+
name: string;
|
|
338
|
+
};
|
|
339
|
+
"csf-component": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingComponentProperty", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
340
|
+
name: string;
|
|
341
|
+
};
|
|
342
|
+
"default-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"fixSuggestion" | "shouldHaveDefaultExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
343
|
+
name: string;
|
|
344
|
+
};
|
|
345
|
+
"hierarchy-separator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCorrectSeparators" | "deprecatedHierarchySeparator", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
346
|
+
name: string;
|
|
347
|
+
};
|
|
274
348
|
"meta-inline-properties": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldHaveInlineProperties", {
|
|
275
349
|
csfVersion: number;
|
|
276
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
"
|
|
280
|
-
|
|
281
|
-
|
|
350
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
351
|
+
name: string;
|
|
352
|
+
};
|
|
353
|
+
"meta-satisfies-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldSatisfyType", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
354
|
+
name: string;
|
|
355
|
+
};
|
|
356
|
+
"no-redundant-story-name": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeRedundantName" | "storyNameIsRedundant", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
357
|
+
name: string;
|
|
358
|
+
};
|
|
359
|
+
"no-renderer-packages": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRendererPackages", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
360
|
+
name: string;
|
|
361
|
+
};
|
|
362
|
+
"no-stories-of": import("@typescript-eslint/utils/ts-eslint").RuleModule<"doNotUseStoriesOf", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
363
|
+
name: string;
|
|
364
|
+
};
|
|
365
|
+
"no-title-property-in-meta": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeTitleInMeta" | "noTitleInMeta", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
366
|
+
name: string;
|
|
367
|
+
};
|
|
282
368
|
"no-uninstalled-addons": import("@typescript-eslint/utils/ts-eslint").RuleModule<"addonIsNotInstalled", {
|
|
283
369
|
packageJsonLocation: string;
|
|
284
370
|
ignore: string[];
|
|
285
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
286
|
-
|
|
287
|
-
|
|
371
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
372
|
+
name: string;
|
|
373
|
+
};
|
|
374
|
+
"prefer-pascal-case": import("@typescript-eslint/utils/ts-eslint").RuleModule<"convertToPascalCase" | "usePascalCase", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
375
|
+
name: string;
|
|
376
|
+
};
|
|
377
|
+
"story-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldHaveStoryExport" | "shouldHaveStoryExportWithFilters" | "addStoryExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
378
|
+
name: string;
|
|
379
|
+
};
|
|
288
380
|
"use-storybook-expect": import("@typescript-eslint/utils/ts-eslint").RuleModule<string, {
|
|
289
381
|
storybookJestPath?: string;
|
|
290
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
291
|
-
|
|
382
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
383
|
+
name: string;
|
|
384
|
+
};
|
|
385
|
+
"use-storybook-testing-library": import("@typescript-eslint/utils/ts-eslint").RuleModule<"updateImports" | "dontUseTestingLibraryDirectly", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
386
|
+
name: string;
|
|
387
|
+
};
|
|
292
388
|
};
|
|
293
389
|
};
|
|
294
390
|
};
|
|
@@ -327,29 +423,61 @@ declare const _default: {
|
|
|
327
423
|
readonly storybook: {
|
|
328
424
|
configs: any;
|
|
329
425
|
rules: {
|
|
330
|
-
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"
|
|
334
|
-
|
|
426
|
+
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
427
|
+
name: string;
|
|
428
|
+
};
|
|
429
|
+
"context-in-play-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"passContextToPlayFunction", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
430
|
+
name: string;
|
|
431
|
+
};
|
|
432
|
+
"csf-component": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingComponentProperty", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
433
|
+
name: string;
|
|
434
|
+
};
|
|
435
|
+
"default-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"fixSuggestion" | "shouldHaveDefaultExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
436
|
+
name: string;
|
|
437
|
+
};
|
|
438
|
+
"hierarchy-separator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCorrectSeparators" | "deprecatedHierarchySeparator", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
439
|
+
name: string;
|
|
440
|
+
};
|
|
335
441
|
"meta-inline-properties": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldHaveInlineProperties", {
|
|
336
442
|
csfVersion: number;
|
|
337
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
"
|
|
341
|
-
|
|
342
|
-
|
|
443
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
444
|
+
name: string;
|
|
445
|
+
};
|
|
446
|
+
"meta-satisfies-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldSatisfyType", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
447
|
+
name: string;
|
|
448
|
+
};
|
|
449
|
+
"no-redundant-story-name": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeRedundantName" | "storyNameIsRedundant", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
450
|
+
name: string;
|
|
451
|
+
};
|
|
452
|
+
"no-renderer-packages": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRendererPackages", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
453
|
+
name: string;
|
|
454
|
+
};
|
|
455
|
+
"no-stories-of": import("@typescript-eslint/utils/ts-eslint").RuleModule<"doNotUseStoriesOf", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
456
|
+
name: string;
|
|
457
|
+
};
|
|
458
|
+
"no-title-property-in-meta": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeTitleInMeta" | "noTitleInMeta", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
459
|
+
name: string;
|
|
460
|
+
};
|
|
343
461
|
"no-uninstalled-addons": import("@typescript-eslint/utils/ts-eslint").RuleModule<"addonIsNotInstalled", {
|
|
344
462
|
packageJsonLocation: string;
|
|
345
463
|
ignore: string[];
|
|
346
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
347
|
-
|
|
348
|
-
|
|
464
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
465
|
+
name: string;
|
|
466
|
+
};
|
|
467
|
+
"prefer-pascal-case": import("@typescript-eslint/utils/ts-eslint").RuleModule<"convertToPascalCase" | "usePascalCase", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
468
|
+
name: string;
|
|
469
|
+
};
|
|
470
|
+
"story-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldHaveStoryExport" | "shouldHaveStoryExportWithFilters" | "addStoryExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
471
|
+
name: string;
|
|
472
|
+
};
|
|
349
473
|
"use-storybook-expect": import("@typescript-eslint/utils/ts-eslint").RuleModule<string, {
|
|
350
474
|
storybookJestPath?: string;
|
|
351
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
352
|
-
|
|
475
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
476
|
+
name: string;
|
|
477
|
+
};
|
|
478
|
+
"use-storybook-testing-library": import("@typescript-eslint/utils/ts-eslint").RuleModule<"updateImports" | "dontUseTestingLibraryDirectly", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
479
|
+
name: string;
|
|
480
|
+
};
|
|
353
481
|
};
|
|
354
482
|
};
|
|
355
483
|
};
|
|
@@ -396,34 +524,70 @@ declare const _default: {
|
|
|
396
524
|
})[];
|
|
397
525
|
};
|
|
398
526
|
rules: {
|
|
399
|
-
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
"
|
|
403
|
-
|
|
527
|
+
"await-interactions": import("@typescript-eslint/utils/ts-eslint").RuleModule<"interactionShouldBeAwaited" | "fixSuggestion", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
528
|
+
name: string;
|
|
529
|
+
};
|
|
530
|
+
"context-in-play-function": import("@typescript-eslint/utils/ts-eslint").RuleModule<"passContextToPlayFunction", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
531
|
+
name: string;
|
|
532
|
+
};
|
|
533
|
+
"csf-component": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingComponentProperty", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
534
|
+
name: string;
|
|
535
|
+
};
|
|
536
|
+
"default-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"fixSuggestion" | "shouldHaveDefaultExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
537
|
+
name: string;
|
|
538
|
+
};
|
|
539
|
+
"hierarchy-separator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"useCorrectSeparators" | "deprecatedHierarchySeparator", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
540
|
+
name: string;
|
|
541
|
+
};
|
|
404
542
|
"meta-inline-properties": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldHaveInlineProperties", {
|
|
405
543
|
csfVersion: number;
|
|
406
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"
|
|
410
|
-
|
|
411
|
-
|
|
544
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
545
|
+
name: string;
|
|
546
|
+
};
|
|
547
|
+
"meta-satisfies-type": import("@typescript-eslint/utils/ts-eslint").RuleModule<"metaShouldSatisfyType", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
548
|
+
name: string;
|
|
549
|
+
};
|
|
550
|
+
"no-redundant-story-name": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeRedundantName" | "storyNameIsRedundant", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
551
|
+
name: string;
|
|
552
|
+
};
|
|
553
|
+
"no-renderer-packages": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRendererPackages", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
554
|
+
name: string;
|
|
555
|
+
};
|
|
556
|
+
"no-stories-of": import("@typescript-eslint/utils/ts-eslint").RuleModule<"doNotUseStoriesOf", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
557
|
+
name: string;
|
|
558
|
+
};
|
|
559
|
+
"no-title-property-in-meta": import("@typescript-eslint/utils/ts-eslint").RuleModule<"removeTitleInMeta" | "noTitleInMeta", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
560
|
+
name: string;
|
|
561
|
+
};
|
|
412
562
|
"no-uninstalled-addons": import("@typescript-eslint/utils/ts-eslint").RuleModule<"addonIsNotInstalled", {
|
|
413
563
|
packageJsonLocation: string;
|
|
414
564
|
ignore: string[];
|
|
415
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
416
|
-
|
|
417
|
-
|
|
565
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
566
|
+
name: string;
|
|
567
|
+
};
|
|
568
|
+
"prefer-pascal-case": import("@typescript-eslint/utils/ts-eslint").RuleModule<"convertToPascalCase" | "usePascalCase", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
569
|
+
name: string;
|
|
570
|
+
};
|
|
571
|
+
"story-exports": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldHaveStoryExport" | "shouldHaveStoryExportWithFilters" | "addStoryExport", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
572
|
+
name: string;
|
|
573
|
+
};
|
|
418
574
|
"use-storybook-expect": import("@typescript-eslint/utils/ts-eslint").RuleModule<string, {
|
|
419
575
|
storybookJestPath?: string;
|
|
420
|
-
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener
|
|
421
|
-
|
|
576
|
+
}[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
577
|
+
name: string;
|
|
578
|
+
};
|
|
579
|
+
"use-storybook-testing-library": import("@typescript-eslint/utils/ts-eslint").RuleModule<"updateImports" | "dontUseTestingLibraryDirectly", never[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
|
|
580
|
+
name: string;
|
|
581
|
+
};
|
|
422
582
|
};
|
|
423
583
|
};
|
|
424
584
|
};
|
|
425
585
|
rules: {
|
|
426
586
|
"itcase-lint/storybook-meta-parameters-design": string;
|
|
587
|
+
'no-restricted-syntax': "off" | ["error", ...{
|
|
588
|
+
message: string;
|
|
589
|
+
selector: string;
|
|
590
|
+
}[]];
|
|
427
591
|
};
|
|
428
592
|
}[];
|
|
429
593
|
export default _default;
|
package/dist/eslint/storybook.js
CHANGED
package/dist/eslint.js
CHANGED
|
@@ -13,7 +13,7 @@ import globals from 'globals';
|
|
|
13
13
|
import eslintTypeScript from 'typescript-eslint';
|
|
14
14
|
import { s as sortUnionTypes, a as sortObjectTypes, b as sortObjects, c as sortExports, d as sortNamedExports, e as sortMaps, f as sortJSXProps, g as sortIntersectionTypes, h as sortInterfaces, i as sortEnums } from './sortUnionTypes_C5VVNaF3.js';
|
|
15
15
|
import parser from '@typescript-eslint/parser';
|
|
16
|
-
import { i as itcaseLintPlugin, p as pluginName, r as ruleName, a as pluginName$1, b as ruleName$1, s as storybookConfig } from './
|
|
16
|
+
import { i as itcaseLintPlugin, p as pluginName, r as ruleName, a as pluginName$1, b as ruleName$1, s as storybookConfig } from './index_BcADaVRv.js';
|
|
17
17
|
import { noRestrictedSyntaxRestrictWords } from './eslint/restrictWords.js';
|
|
18
18
|
export { default as eslintFigma } from './eslint/figma.js';
|
|
19
19
|
import 'eslint-plugin-storybook';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import eslintStorybook from 'eslint-plugin-storybook';
|
|
2
2
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
3
|
+
import { noRestrictedSyntaxRestrictWordsForStorybook } from './eslint/restrictWords.js';
|
|
3
4
|
|
|
4
5
|
const DOC_BASE = 'https://github.com/ITCase/itcase-lint/tree/main/src/eslint';
|
|
5
6
|
function createRuleCreator(pluginPath) {
|
|
@@ -608,16 +609,19 @@ const itcaseLintPlugin = {
|
|
|
608
609
|
},
|
|
609
610
|
};
|
|
610
611
|
|
|
612
|
+
const STORYBOOK_STORY_FILES = ['**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)'];
|
|
611
613
|
// eslint-disable-next-line import/no-default-export
|
|
612
614
|
var storybookConfig = [
|
|
613
615
|
{
|
|
614
|
-
files:
|
|
616
|
+
files: STORYBOOK_STORY_FILES,
|
|
615
617
|
plugins: {
|
|
616
618
|
[pluginName$1]: itcaseLintPlugin,
|
|
617
619
|
storybook: eslintStorybook,
|
|
618
620
|
},
|
|
619
621
|
rules: {
|
|
620
622
|
[`${pluginName$1}/${ruleName$1}`]: 'warn',
|
|
623
|
+
// `fn` из `storybook/test` — каноничный mock/spy для args и Actions panel
|
|
624
|
+
'no-restricted-syntax': noRestrictedSyntaxRestrictWordsForStorybook,
|
|
621
625
|
},
|
|
622
626
|
},
|
|
623
627
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/lint",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.119",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets ",
|
|
6
6
|
"engines": {
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"@html-eslint/eslint-plugin": "^0.64.0",
|
|
55
55
|
"@html-eslint/parser": "^0.64.0",
|
|
56
56
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
|
|
57
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
58
|
-
"@typescript-eslint/parser": "^8.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
58
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
59
59
|
"eslint": "9.39.2",
|
|
60
60
|
"eslint-config-prettier": "^10.1.8",
|
|
61
61
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
62
62
|
"eslint-plugin-html": "^8.1.4",
|
|
63
63
|
"eslint-plugin-import": "^2.32.0",
|
|
64
|
-
"eslint-plugin-json": "^
|
|
64
|
+
"eslint-plugin-json": "^5.0.0",
|
|
65
65
|
"eslint-plugin-mobx": "^0.0.14",
|
|
66
66
|
"eslint-plugin-n": "^18.2.2",
|
|
67
67
|
"eslint-plugin-node": "^11.1.0",
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
73
73
|
"eslint-plugin-react-native": "^5.0.0",
|
|
74
74
|
"eslint-plugin-react-refresh": "^0.5.3",
|
|
75
|
-
"eslint-plugin-storybook": "^10.5.
|
|
76
|
-
"expo-modules-autolinking": "^57.0.
|
|
77
|
-
"globals": "^17.
|
|
78
|
-
"prettier": "^3.9.
|
|
79
|
-
"stylelint": "^17.14.
|
|
75
|
+
"eslint-plugin-storybook": "^10.5.5",
|
|
76
|
+
"expo-modules-autolinking": "^57.0.9",
|
|
77
|
+
"globals": "^17.8.0",
|
|
78
|
+
"prettier": "^3.9.6",
|
|
79
|
+
"stylelint": "^17.14.1",
|
|
80
80
|
"stylelint-config-standard": "^40.0.0",
|
|
81
81
|
"stylelint-no-unsupported-browser-features": "^8.1.1",
|
|
82
82
|
"stylelint-order": "^8.1.1",
|
|
83
83
|
"stylelint-prettier": "^5.0.3",
|
|
84
|
-
"typescript-eslint": "^8.
|
|
84
|
+
"typescript-eslint": "^8.65.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@commitlint/cli": "^21.2.1",
|
|
@@ -94,21 +94,21 @@
|
|
|
94
94
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
95
95
|
"@rollup/plugin-terser": "^1.0.0",
|
|
96
96
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
97
|
-
"@types/node": "^26.1.
|
|
97
|
+
"@types/node": "^26.1.2",
|
|
98
98
|
"@types/react": "^19.2.14",
|
|
99
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
99
|
+
"@typescript-eslint/rule-tester": "^8.65.0",
|
|
100
100
|
"conventional-changelog-conventionalcommits": "^10.2.1",
|
|
101
101
|
"del-cli": "^7.0.0",
|
|
102
102
|
"husky": "^9.1.7",
|
|
103
|
-
"lint-staged": "^17.0
|
|
104
|
-
"rollup": "4.62.
|
|
103
|
+
"lint-staged": "^17.2.0",
|
|
104
|
+
"rollup": "4.62.3",
|
|
105
105
|
"rollup-plugin-copy": "^3.5.0",
|
|
106
106
|
"rollup-plugin-dts": "^6.4.1",
|
|
107
107
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
108
108
|
"react": "^19.2.4",
|
|
109
109
|
"rollup-preserve-directives": "^1.1.3",
|
|
110
|
-
"semantic-release": "^25.0.
|
|
111
|
-
"storybook": "^10.5.
|
|
110
|
+
"semantic-release": "^25.0.8",
|
|
111
|
+
"storybook": "^10.5.5",
|
|
112
112
|
"tsx": "^4.23.1",
|
|
113
113
|
"typescript": "^6.0.3"
|
|
114
114
|
}
|