@itcase/lint 1.1.101 → 1.1.103

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 CHANGED
@@ -1,3 +1,25 @@
1
+ ## [1.1.103](https://github.com/ITCase/itcase-lint/compare/v1.1.102...v1.1.103) (2026-03-19)
2
+
3
+ ### Dependencies
4
+
5
+ * **other:** bump @eslint/compat from 2.0.2 to 2.0.3 ([8066477](https://github.com/ITCase/itcase-lint/commit/80664776b0b9ae5c702a2a780f1d2449bd8dd643))
6
+ * **other:** bump eslint-plugin-mobx from 0.0.13 to 0.0.14 ([360420d](https://github.com/ITCase/itcase-lint/commit/360420d4a6b4c2650aeaf2d3ee5c9f6270740438))
7
+ * **other:** bump eslint-plugin-storybook from 10.2.15 to 10.2.16 ([466bbfb](https://github.com/ITCase/itcase-lint/commit/466bbfb3bc711ee10f30f9347a6884cda6b46583))
8
+ * **other:** bump react and @types/react ([4004772](https://github.com/ITCase/itcase-lint/commit/4004772464c7cc1c519e3f0a40e25a7d409151f0))
9
+ * **other:** bump storybook from 10.2.15 to 10.2.16 ([6631e65](https://github.com/ITCase/itcase-lint/commit/6631e65699b5de1f45ed64b335f6fb0431be9c1c))
10
+ * **other:** Update deps / update perflist ([1d70fc5](https://github.com/ITCase/itcase-lint/commit/1d70fc576ad257d3a2f3fa7f3a64ad82658c18d1))
11
+
12
+ ## [1.1.102](https://github.com/ITCase/itcase-lint/compare/v1.1.101...v1.1.102) (2026-03-11)
13
+
14
+ ### Features
15
+
16
+ * **eslint:** Add res to reposne ([f6b241b](https://github.com/ITCase/itcase-lint/commit/f6b241bced3b6ecebf8a2257f09045849b763629))
17
+
18
+ ### Bug Fixes
19
+
20
+ * **eslint:** E > Event | Element ([a9fc74e](https://github.com/ITCase/itcase-lint/commit/a9fc74e2a9418cd35d516f378137eb7a2e3e9dc3))
21
+ * **other:** Updarw deps bot ([b973f18](https://github.com/ITCase/itcase-lint/commit/b973f18cd531aa18bbabd2187eb3c0960d1bda3f))
22
+
1
23
  ## [1.1.101](https://github.com/ITCase/itcase-lint/compare/v1.1.100...v1.1.101) (2026-03-06)
2
24
 
3
25
  ### Refactoring
package/README.md CHANGED
@@ -14,33 +14,26 @@ The sorting configuration is located in the `perfectionist` folder along the pat
14
14
 
15
15
  > Example: Setting up sortJSXProps
16
16
 
17
- Sorting rules are defined in `eslint/perfectionist/sortJSXProps.js`.
17
+ Sorting rules are defined in `eslint/perfectionist/sortJSXProps.ts` and use shared data from `eslint/perfectionist/sort/`:
18
18
 
19
- Here's how to set up the order and rules:
19
+ 1. **`sort/props.ts`** array of prop names in the desired sort order. The order of names in this array defines the order in which props will be sorted.
20
20
 
21
- 1. `groups`:
21
+ 2. **`sort/customGroup.ts`** — custom group rules when sort order depends on a pattern (regex) rather than the exact name. Each key is a group name, the value is a pattern that property names must match.
22
22
 
23
- - This array defines the order in which the props will be sorted.
24
- - Add the prop names in the order you want them to be.
23
+ Example of the structure:
25
24
 
26
- 2. `customRulesForGroups`:
27
-
28
- - If the prop sort order depends on the template (rather than the exact name), set up the rule here.
29
-
30
- - For example:
31
-
32
- ```js
33
- const groups = [
34
- 'className',
35
- 'key',
36
- 'callback',
37
- ]
25
+ ```ts
26
+ // sort/props.ts — order of props
27
+ const props = ['id', 'className', 'callback', 'children']
38
28
 
39
- const customRulesForGroups = {
29
+ // sort/customGroup.ts patterns for groups
30
+ const customGroups = {
40
31
  callback: '^on.*',
41
32
  }
42
33
  ```
43
34
 
35
+ The same `props` and `customGroups` are used for `sortJSXProps` and `sortObjects` (objects are sorted with the same group order).
36
+
44
37
  ## Usage
45
38
 
46
39
  ### ESLint
@@ -0,0 +1,5 @@
1
+ /** Entry for perfectionist customGroups option (groupName + elementNamePattern) */
2
+ export type CustomGroupEntry = {
3
+ elementNamePattern: string;
4
+ groupName: string;
5
+ };
@@ -0,0 +1,4 @@
1
+ import type { CustomGroupEntry } from './types';
2
+ declare function convertCustomGroupsToArray(groupsObj: Record<string, string>): CustomGroupEntry[];
3
+ declare function buildCustomGroupsArray(groupNames: string[], extraGroups: Record<string, string>): CustomGroupEntry[];
4
+ export { buildCustomGroupsArray, convertCustomGroupsToArray };
@@ -1,15 +1,5 @@
1
1
  declare const sortExports: (string | {
2
2
  type: string;
3
- customGroups: never[];
4
- fallbackSort: {
5
- type: string;
6
- };
7
- groups: never[];
8
- ignoreCase: boolean;
9
- newlinesBetween: string;
10
3
  order: string;
11
- partitionByComment: boolean;
12
- partitionByNewLine: boolean;
13
- specialCharacters: string;
14
4
  })[];
15
5
  export { sortExports };
@@ -1,9 +1,6 @@
1
1
  declare const sortJSXProps: (string | {
2
2
  type: string;
3
- customGroups: {
4
- elementNamePattern: string;
5
- groupName: string;
6
- }[];
3
+ customGroups: import("./sort/types").CustomGroupEntry[];
7
4
  groups: string[];
8
5
  order: string;
9
6
  })[];
@@ -1,16 +1,5 @@
1
1
  declare const sortNamedExports: (string | {
2
2
  type: string;
3
- customGroups: never[];
4
- fallbackSort: {
5
- type: string;
6
- };
7
- groups: never[];
8
- ignoreAlias: boolean;
9
- ignoreCase: boolean;
10
- newlinesBetween: string;
11
3
  order: string;
12
- partitionByComment: boolean;
13
- partitionByNewLine: boolean;
14
- specialCharacters: string;
15
4
  })[];
16
5
  export { sortNamedExports };
@@ -1,9 +1,6 @@
1
1
  declare const sortObjectTypes: (string | {
2
2
  type: string;
3
- customGroups: {
4
- elementNamePattern: string;
5
- groupName: string;
6
- }[];
3
+ customGroups: import("./sort/types").CustomGroupEntry[];
7
4
  groups: string[];
8
5
  order: string;
9
6
  })[];
@@ -1,23 +1,17 @@
1
1
  declare const sortObjects: (string | {
2
2
  type: string;
3
- groups: string[];
4
- customGroups: {
5
- groupName: string;
6
- elementNamePattern: string;
7
- }[];
8
3
  useConfigurationIf: {
9
4
  allNamesMatchPattern: string;
10
5
  callingFunctionNamePattern: string;
11
6
  };
12
7
  order?: undefined;
8
+ groups?: undefined;
9
+ customGroups?: undefined;
13
10
  } | {
14
11
  type: string;
15
12
  order: string;
16
13
  groups: string[];
17
- customGroups: {
18
- groupName: string;
19
- elementNamePattern: string;
20
- }[];
14
+ customGroups: import("./sort/types").CustomGroupEntry[];
21
15
  useConfigurationIf?: undefined;
22
16
  })[];
23
17
  export { sortObjects };
@@ -1,4 +1,4 @@
1
- export { i as sortEnums, c as sortExports, h as sortInterfaces, g as sortIntersectionTypes, f as sortJSXProps, e as sortMaps, d as sortNamedExports, a as sortObjectTypes, b as sortObjects, s as sortUnionTypes } from '../sortUnionTypes_G8w5Oj3O.js';
1
+ export { i as sortEnums, c as sortExports, h as sortInterfaces, g as sortIntersectionTypes, f as sortJSXProps, e as sortMaps, d as sortNamedExports, a as sortObjectTypes, b as sortObjects, s as sortUnionTypes } from '../sortUnionTypes_B60tZBM_.js';
2
2
 
3
3
  const sortClasses = [
4
4
  'error',
@@ -5,6 +5,7 @@
5
5
  * - use: что писать вместо (строка или массив вариантов).
6
6
  */
7
7
  const RESTRICTED_WORDS = [
8
+ { forbidden: 'e', use: ['event', 'element'] },
8
9
  { forbidden: 'btn', use: 'button' },
9
10
  { forbidden: 'lbl', use: 'label' },
10
11
  { forbidden: 'lnk', use: 'link' },
@@ -13,6 +14,7 @@ const RESTRICTED_WORDS = [
13
14
  { forbidden: 'pw', use: 'password' },
14
15
  { forbidden: 'pwd', use: 'password' },
15
16
  { forbidden: 'usr', use: 'user' },
17
+ { forbidden: 'res', use: 'response' },
16
18
  { forbidden: 'mod', use: ['modify', 'module'] },
17
19
  { forbidden: 'tmp', use: 'temporary' },
18
20
  { forbidden: 'dir', use: ['directory', 'direction'] },
package/dist/eslint.js CHANGED
@@ -11,7 +11,7 @@ import eslintReact from 'eslint-plugin-react';
11
11
  import eslintReactHooks from 'eslint-plugin-react-hooks';
12
12
  import globals from 'globals';
13
13
  import eslintTypeScript from 'typescript-eslint';
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_G8w5Oj3O.js';
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_B60tZBM_.js';
15
15
  import parser from '@typescript-eslint/parser';
16
16
  import { i as itcaseLintPlugin, p as pluginName, r as ruleName, s as storybookConfig } from './index_BUaP0Zu6.js';
17
17
  import { noRestrictedSyntaxRestrictWords } from './eslint/restrictWords.js';
@@ -1,45 +1,16 @@
1
1
  const sortEnums = ['error', { type: 'natural', order: 'asc' }];
2
2
 
3
- const sortExports = [
4
- 'error',
5
- {
6
- type: 'alphabetical',
7
- customGroups: [],
8
- fallbackSort: { type: 'unsorted' },
9
- groups: [],
10
- ignoreCase: true,
11
- newlinesBetween: 'ignore',
12
- order: 'asc',
13
- partitionByComment: false,
14
- partitionByNewLine: false,
15
- specialCharacters: 'keep',
16
- },
17
- ];
3
+ const sortExports = ['error', { type: 'alphabetical', order: 'asc' }];
18
4
 
19
5
  // In what order they are written, that's how they will be sorted
20
6
  // В каком порядке они записаны, так они и будут отсортированы
21
- const groups$3 = ['id', 'unknown', 'is', 'callback', 'set'];
7
+ const groups$3 = ['id', 'literalUnknown', 'is', 'callback', 'set'];
22
8
  const customGroups$1 = [
23
- {
24
- elementNamePattern: '^id$',
25
- groupName: 'id',
26
- },
27
- {
28
- elementNamePattern: '^unknown$',
29
- groupName: 'unknown',
30
- },
31
- {
32
- elementNamePattern: '^is.*',
33
- groupName: 'is',
34
- },
35
- {
36
- elementNamePattern: '^on.*',
37
- groupName: 'callback',
38
- },
39
- {
40
- elementNamePattern: '^set.*',
41
- groupName: 'set',
42
- },
9
+ { elementNamePattern: '^id$', groupName: 'id' },
10
+ { elementNamePattern: '^unknown$', groupName: 'literalUnknown' },
11
+ { elementNamePattern: '^is.*', groupName: 'is' },
12
+ { elementNamePattern: '^on.*', groupName: 'callback' },
13
+ { elementNamePattern: '^set.*', groupName: 'set' },
43
14
  ];
44
15
  const sortInterfaces = [
45
16
  'error',
@@ -53,19 +24,6 @@ const sortInterfaces = [
53
24
 
54
25
  const sortIntersectionTypes = ['error', { type: 'natural', order: 'asc' }];
55
26
 
56
- function validateArray(arr) {
57
- if (!Array.isArray(arr) || !arr.every((str) => typeof str === 'string')) {
58
- throw new Error('Input must be an array of strings');
59
- }
60
- }
61
- const wrapArrayWithCaretAndDollarAnchors = (arr) => {
62
- validateArray(arr);
63
- return arr.reduce((acc, str) => {
64
- acc[str] = `^${str}$`;
65
- return acc;
66
- }, {});
67
- };
68
-
69
27
  const customGroups = {
70
28
  id: '^id$',
71
29
  direction: '^direction.*',
@@ -491,23 +449,39 @@ const props = [
491
449
  'SuccessMock',
492
450
  ];
493
451
 
494
- const groups$2 = [...props];
495
- // Convert object to array of objects format
496
- const convertCustomGroupsToArray$2 = (groupsObj) => {
452
+ function validateArray(arr) {
453
+ if (!Array.isArray(arr) || !arr.every((str) => typeof str === 'string')) {
454
+ throw new Error('Input must be an array of strings');
455
+ }
456
+ }
457
+ const wrapArrayWithCaretAndDollarAnchors = (arr) => {
458
+ validateArray(arr);
459
+ return arr.reduce((acc, str) => {
460
+ acc[str] = `^${str}$`;
461
+ return acc;
462
+ }, {});
463
+ };
464
+
465
+ function convertCustomGroupsToArray(groupsObj) {
497
466
  return Object.entries(groupsObj).map(([groupName, elementNamePattern]) => ({
498
467
  elementNamePattern,
499
468
  groupName,
500
469
  }));
501
- };
502
- const allCustomGroups$2 = {
503
- ...wrapArrayWithCaretAndDollarAnchors(groups$2),
504
- ...customGroups,
505
- };
470
+ }
471
+ function buildCustomGroupsArray(groupNames, extraGroups) {
472
+ const all = {
473
+ ...wrapArrayWithCaretAndDollarAnchors(groupNames),
474
+ ...extraGroups,
475
+ };
476
+ return convertCustomGroupsToArray(all);
477
+ }
478
+
479
+ const groups$2 = [...props];
506
480
  const sortJSXProps = [
507
481
  'error',
508
482
  {
509
483
  type: 'natural',
510
- customGroups: convertCustomGroupsToArray$2(allCustomGroups$2),
484
+ customGroups: buildCustomGroupsArray(groups$2, customGroups),
511
485
  groups: groups$2,
512
486
  order: 'asc',
513
487
  },
@@ -515,47 +489,14 @@ const sortJSXProps = [
515
489
 
516
490
  const sortMaps = ['error', { type: 'natural', order: 'asc' }];
517
491
 
518
- const sortNamedExports = [
519
- 'error',
520
- {
521
- type: 'alphabetical',
522
- customGroups: [],
523
- fallbackSort: { type: 'unsorted' },
524
- groups: [],
525
- ignoreAlias: false,
526
- ignoreCase: true,
527
- newlinesBetween: 'ignore',
528
- order: 'asc',
529
- partitionByComment: false,
530
- partitionByNewLine: false,
531
- specialCharacters: 'keep',
532
- },
533
- ];
492
+ const sortNamedExports = ['error', { type: 'alphabetical', order: 'asc' }];
534
493
 
535
494
  /* eslint-disable perfectionist/sort-objects */
536
495
  const groups$1 = [...props];
537
- // Convert object to array of objects format
538
- const convertCustomGroupsToArray$1 = (groupsObj) => {
539
- return Object.entries(groupsObj).map(([groupName, elementNamePattern]) => ({
540
- groupName,
541
- elementNamePattern,
542
- }));
543
- };
544
- const allCustomGroups$1 = {
545
- ...wrapArrayWithCaretAndDollarAnchors(groups$1),
546
- ...customGroups,
547
- };
548
496
  const sortObjects = [
549
497
  'error',
550
498
  {
551
499
  type: 'unsorted', // Don't sort objects passed to constructor
552
- groups: ['MESSAGES_FIELDS'],
553
- customGroups: [
554
- {
555
- groupName: 'formConfig',
556
- elementNamePattern: '.*(?<!FormConfig)$',
557
- },
558
- ],
559
500
  useConfigurationIf: {
560
501
  allNamesMatchPattern: 'MESSAGES_FIELDS',
561
502
  callingFunctionNamePattern: '^.*',
@@ -565,31 +506,19 @@ const sortObjects = [
565
506
  type: 'natural',
566
507
  order: 'asc',
567
508
  groups: groups$1,
568
- customGroups: convertCustomGroupsToArray$1(allCustomGroups$1),
509
+ customGroups: buildCustomGroupsArray(groups$1, customGroups),
569
510
  },
570
511
  ];
571
512
 
572
513
  // In what order they are written, that's how they will be sorted
573
514
  // В каком порядке они записаны, так они и будут отсортированы
574
515
  const groups = ['id'];
575
- const customRulesForGroups = {};
576
- // Convert object to array of objects format
577
- const convertCustomGroupsToArray = (groupsObj) => {
578
- return Object.entries(groupsObj).map(([groupName, elementNamePattern]) => ({
579
- elementNamePattern,
580
- groupName,
581
- }));
582
- };
583
- const allCustomGroups = {
584
- ...wrapArrayWithCaretAndDollarAnchors(groups),
585
- ...customRulesForGroups,
586
- };
587
516
  const sortObjectTypes = [
588
517
  'error',
589
518
  {
590
519
  type: 'natural',
591
- customGroups: convertCustomGroupsToArray(allCustomGroups),
592
- groups: groups,
520
+ customGroups: buildCustomGroupsArray(groups, {}),
521
+ groups,
593
522
  order: 'asc',
594
523
  },
595
524
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/lint",
3
- "version": "1.1.101",
3
+ "version": "1.1.103",
4
4
  "author": "ITCase",
5
5
  "description": "Code style linter configuration presets",
6
6
  "engines": {
@@ -47,46 +47,46 @@
47
47
  "dependencies": {
48
48
  "@babel/eslint-parser": "^7.28.6",
49
49
  "@babel/eslint-plugin": "^7.27.1",
50
- "@eslint/compat": "^2.0.2",
50
+ "@eslint/compat": "^2.0.3",
51
51
  "@figma/eslint-plugin-figma-plugins": "^1.0.0",
52
52
  "@eslint/js": "^10.0.1",
53
53
  "@eslint/markdown": "^7.5.1",
54
54
  "@html-eslint/eslint-plugin": "^0.58.1",
55
55
  "@html-eslint/parser": "^0.58.1",
56
56
  "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
57
- "@typescript-eslint/eslint-plugin": "^8.56.1",
58
- "@typescript-eslint/parser": "^8.56.1",
57
+ "@typescript-eslint/eslint-plugin": "^8.57.1",
58
+ "@typescript-eslint/parser": "^8.57.1",
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
64
  "eslint-plugin-json": "^4.0.1",
65
- "eslint-plugin-mobx": "^0.0.13",
65
+ "eslint-plugin-mobx": "^0.0.14",
66
66
  "eslint-plugin-n": "^17.24.0",
67
67
  "eslint-plugin-node": "^11.1.0",
68
- "eslint-plugin-perfectionist": "^5.6.0",
68
+ "eslint-plugin-perfectionist": "^5.7.0",
69
69
  "eslint-plugin-prettier": "^5.5.5",
70
70
  "eslint-plugin-promise": "^7.2.1",
71
71
  "eslint-plugin-react": "^7.37.5",
72
72
  "eslint-plugin-react-hooks": "^7.0.1",
73
73
  "eslint-plugin-react-native": "^5.0.0",
74
74
  "eslint-plugin-react-refresh": "^0.5.2",
75
- "eslint-plugin-storybook": "^10.2.15",
76
- "expo-modules-autolinking": "^55.0.8",
75
+ "eslint-plugin-storybook": "^10.3.0",
76
+ "expo-modules-autolinking": "^55.0.11",
77
77
  "globals": "^17.4.0",
78
78
  "prettier": "^3.8.1",
79
79
  "stylelint": "^17.4.0",
80
80
  "stylelint-config-standard": "^40.0.0",
81
81
  "stylelint-no-unsupported-browser-features": "^8.1.1",
82
- "stylelint-order": "^7.0.1",
82
+ "stylelint-order": "^8.1.1",
83
83
  "stylelint-prettier": "^5.0.3",
84
- "typescript-eslint": "^8.56.1"
84
+ "typescript-eslint": "^8.57.1"
85
85
  },
86
86
  "devDependencies": {
87
- "@commitlint/cli": "^20.4.3",
88
- "@commitlint/config-conventional": "^20.4.3",
89
- "@itcase/config": "^1.6.52",
87
+ "@commitlint/cli": "^20.5.0",
88
+ "@commitlint/config-conventional": "^20.5.0",
89
+ "@itcase/config": "^1.6.53",
90
90
  "@rollup/plugin-alias": "^6.0.0",
91
91
  "@rollup/plugin-babel": "^7.0.0",
92
92
  "@rollup/plugin-image": "^3.0.3",
@@ -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": "^25.3.5",
98
- "@types/react": "^18.3.0",
99
- "@typescript-eslint/rule-tester": "^8.56.1",
97
+ "@types/node": "^25.5.0",
98
+ "@types/react": "^19.2.14",
99
+ "@typescript-eslint/rule-tester": "^8.57.1",
100
100
  "conventional-changelog-conventionalcommits": "^9.3.0",
101
101
  "del-cli": "^7.0.0",
102
102
  "husky": "^9.1.7",
103
- "lint-staged": "^16.3.2",
103
+ "lint-staged": "^16.4.0",
104
104
  "rollup": "4.59.0",
105
105
  "rollup-plugin-copy": "^3.5.0",
106
- "rollup-plugin-dts": "^6.3.0",
106
+ "rollup-plugin-dts": "^6.4.0",
107
107
  "rollup-plugin-peer-deps-external": "^2.2.4",
108
- "react": "^18.3.0",
108
+ "react": "^19.2.4",
109
109
  "rollup-preserve-directives": "^1.1.3",
110
110
  "semantic-release": "^25.0.3",
111
- "storybook": "^10.2.15",
111
+ "storybook": "^10.3.0",
112
112
  "tsx": "^4.21.0",
113
113
  "typescript": "^5.9.3"
114
114
  }