@itcase/lint 1.1.93 → 1.1.95
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 +24 -0
- package/README.md +64 -0
- package/dist/eslint/customPlugins/dataTestIdPlugin/extra.d.ts +10 -4
- package/dist/eslint/customPlugins/dataTestIdPlugin/plugin.d.ts +6 -6
- package/dist/eslint/customPlugins/dataTestIdPlugin/rule.d.ts +2 -1
- package/dist/eslint/figma/index.d.ts +18 -0
- package/dist/eslint/figma.js +6 -0
- package/dist/eslint/index.d.ts +1 -0
- package/dist/eslint/mobx.js +2 -0
- package/dist/eslint/perfectionist/sortJSXProps.d.ts +1 -1
- package/dist/eslint/perfectionist/sortObjectTypes.d.ts +1 -1
- package/dist/eslint/perfectionist/sortObjects.d.ts +1 -1
- package/dist/eslint/perfectionist.js +1 -1
- package/dist/eslint/utils.d.ts +2 -2
- package/dist/eslint.js +70 -13
- package/dist/prettier/react-native.js +1 -0
- package/dist/prettier.js +1 -0
- package/dist/{sortUnionTypes_rTLrktP3.js → sortUnionTypes_G8w5Oj3O.js} +2 -2
- package/dist/stylelint/index.d.ts +1 -0
- package/dist/stylelint.js +4 -0
- package/package.json +19 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [1.1.95](https://github.com/ITCase/itcase-lint/compare/v1.1.94...v1.1.95) (2026-01-30)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **eslint:** add ability to pass options to plugin ([f9bc8b6](https://github.com/ITCase/itcase-lint/commit/f9bc8b6c3663659797865d7a21f8404e9b53235f))
|
|
6
|
+
* **stylelint:** add color-no-hex rule ([2dcca4e](https://github.com/ITCase/itcase-lint/commit/2dcca4e61f1d4ba768e60b5b368cfa7c6dd9e983))
|
|
7
|
+
* **eslint:** add documentation for data-test-id-plugin options and setup ([78b5e7d](https://github.com/ITCase/itcase-lint/commit/78b5e7d033b8660f9977956ca433ae273e8e807b))
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **eslint:** fix type errors ([346570a](https://github.com/ITCase/itcase-lint/commit/346570a156096edce64ef1a174182ed62bcef9da))
|
|
12
|
+
* **eslint:** remove useless deps ([266c61f](https://github.com/ITCase/itcase-lint/commit/266c61f18e8c3fb7df7b28b869114f0b19000b90))
|
|
13
|
+
* **eslint:** update ignore pattern for stories files in configuration ([97bca4e](https://github.com/ITCase/itcase-lint/commit/97bca4eb0dd4b98201e84c1b9258c3e7080420d6))
|
|
14
|
+
|
|
15
|
+
### Refactoring
|
|
16
|
+
|
|
17
|
+
* **eslint:** rename, make sure rules working ([0719e6c](https://github.com/ITCase/itcase-lint/commit/0719e6cf2fdf16d81b417353f28ca69ffd3960c4))
|
|
18
|
+
|
|
19
|
+
## [1.1.94](https://github.com/ITCase/itcase-lint/compare/v1.1.93...v1.1.94) (2026-01-23)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **stylelint:** add ignore rules ([8122b17](https://github.com/ITCase/itcase-lint/commit/8122b17285b0670718821eea1f7c1caef43c27ca))
|
|
24
|
+
|
|
1
25
|
## [1.1.93](https://github.com/ITCase/itcase-lint/compare/v1.1.92...v1.1.93) (2026-01-22)
|
|
2
26
|
|
|
3
27
|
### Continuous Integrations
|
package/README.md
CHANGED
|
@@ -87,6 +87,70 @@ import eslintReactNative from '@itcase/lint/eslint/react-native/index.js'
|
|
|
87
87
|
export default [...eslint, ...eslintMobx, ...eslintReactNative]
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
### ESLint with data-test-id-plugin
|
|
91
|
+
|
|
92
|
+
`data-test-id-plugin` accepts these options:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
appendElementNamesToCheck?: string[] | null
|
|
96
|
+
overrideElementNamesToCheck?: string[] | null
|
|
97
|
+
overrideElementNamesToIgnore?: string[] | null
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Defaults**
|
|
101
|
+
|
|
102
|
+
- `overrideElementNamesToIgnore`: `['IgnoredElement', 'Html']`
|
|
103
|
+
- `overrideElementNamesToCheck`: `['Group', 'Modal', 'Drawer', 'ModalSheetBottom', 'Grid', 'Flex']`
|
|
104
|
+
- `appendElementNamesToCheck`: `[]`
|
|
105
|
+
|
|
106
|
+
**Behavior**
|
|
107
|
+
|
|
108
|
+
- `overrideElementNamesToIgnore`: replaces the default ignore list.
|
|
109
|
+
- `overrideElementNamesToCheck`: replaces the default check list.
|
|
110
|
+
- `appendElementNamesToCheck`: adds to the current check list (default or overridden).
|
|
111
|
+
- `null` or `undefined`: keep the default behavior for that option.
|
|
112
|
+
|
|
113
|
+
**Minimal setup (defaults):**
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
import eslint from '@itcase/lint/eslint'
|
|
117
|
+
|
|
118
|
+
export default [
|
|
119
|
+
...eslint,
|
|
120
|
+
{
|
|
121
|
+
ignores: ['./**/*.stories.*'],
|
|
122
|
+
files: ['./packages/*.{ts,tsx,js,jsx}'],
|
|
123
|
+
rules: {
|
|
124
|
+
'data-test-id-plugin/data-test-id': 'warn',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Customized setup:**
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
import eslint from '@itcase/lint/eslint'
|
|
134
|
+
|
|
135
|
+
export default [
|
|
136
|
+
...eslint,
|
|
137
|
+
{
|
|
138
|
+
ignores: ['./**/*.stories.*'],
|
|
139
|
+
files: ['./packages/*.{ts,tsx,js,jsx}'],
|
|
140
|
+
rules: {
|
|
141
|
+
'data-test-id-plugin/data-test-id': [
|
|
142
|
+
'warn',
|
|
143
|
+
{
|
|
144
|
+
overrideElementNamesToIgnore: ['IgnoredElement', 'Html', 'SkipMe'],
|
|
145
|
+
overrideElementNamesToCheck: ['Modal', 'Drawer'],
|
|
146
|
+
appendElementNamesToCheck: ['Card', 'Panel'],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
]
|
|
152
|
+
```
|
|
153
|
+
|
|
90
154
|
### Stylelint
|
|
91
155
|
|
|
92
156
|
Create a `eslint.config.mjs` configuration file in the root of your project with the following content:
|
|
@@ -4,9 +4,15 @@ declare const createRule: <Options extends readonly unknown[], MessageIds extend
|
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
6
|
declare const ruleName = "data-test-id";
|
|
7
|
-
declare const pluginName = "
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
declare const pluginName = "data-test-id-plugin";
|
|
8
|
+
type Options = [
|
|
9
|
+
{
|
|
10
|
+
appendElementNamesToCheck?: string[] | null;
|
|
11
|
+
overrideElementNamesToCheck?: string[] | null;
|
|
12
|
+
overrideElementNamesToIgnore?: string[] | null;
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
declare const defaultOptions: Options;
|
|
10
16
|
type Context = Readonly<TSESLint.RuleContext<keyof MessageIds, Options>>;
|
|
11
17
|
type RuleVisitors = (context: Context, optionsWithDefault: Readonly<Options>) => TSESLint.RuleListener;
|
|
12
|
-
export { type Context, createRule, defaultOptions, pluginName, ruleName, type RuleVisitors, };
|
|
18
|
+
export { type Context, createRule, defaultOptions, type Options, pluginName, ruleName, type RuleVisitors, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import parser from '@typescript-eslint/parser';
|
|
2
2
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
3
|
-
declare const
|
|
3
|
+
declare const pluginWithConfigs: {
|
|
4
4
|
configs: {
|
|
5
5
|
recommended: {
|
|
6
6
|
languageOptions: {
|
|
@@ -8,21 +8,21 @@ declare const pluginWithoutConfigs: {
|
|
|
8
8
|
parser: typeof parser;
|
|
9
9
|
};
|
|
10
10
|
plugins: {
|
|
11
|
-
"
|
|
11
|
+
"data-test-id-plugin": {
|
|
12
12
|
meta: {
|
|
13
13
|
name: string;
|
|
14
14
|
version: string;
|
|
15
15
|
};
|
|
16
16
|
processors: {};
|
|
17
17
|
rules: {
|
|
18
|
-
"data-test-id": TSESLint.RuleModule<"missingAttribute" | "missingAttributeValue",
|
|
18
|
+
"data-test-id": TSESLint.RuleModule<"missingAttribute" | "missingAttributeValue", import("./extra").Options, unknown, TSESLint.RuleListener> & {
|
|
19
19
|
name: string;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
rules: {
|
|
25
|
-
"
|
|
25
|
+
"data-test-id-plugin/data-test-id": "off";
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
};
|
|
@@ -32,9 +32,9 @@ declare const pluginWithoutConfigs: {
|
|
|
32
32
|
};
|
|
33
33
|
processors: {};
|
|
34
34
|
rules: {
|
|
35
|
-
"data-test-id": TSESLint.RuleModule<"missingAttribute" | "missingAttributeValue",
|
|
35
|
+
"data-test-id": TSESLint.RuleModule<"missingAttribute" | "missingAttributeValue", import("./extra").Options, unknown, TSESLint.RuleListener> & {
|
|
36
36
|
name: string;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export default
|
|
40
|
+
export default pluginWithConfigs;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
2
|
+
import { type Options } from './extra';
|
|
3
|
+
declare const rule: ESLintUtils.RuleModule<"missingAttribute" | "missingAttributeValue", Options, unknown, ESLintUtils.RuleListener> & {
|
|
3
4
|
name: string;
|
|
4
5
|
};
|
|
5
6
|
export { rule };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
name: string;
|
|
3
|
+
plugins: {
|
|
4
|
+
"@figma/figma-plugins": {
|
|
5
|
+
meta: {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
};
|
|
9
|
+
rules: {
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
rules: {
|
|
15
|
+
[x: string]: string;
|
|
16
|
+
};
|
|
17
|
+
}[];
|
|
18
|
+
export default _default;
|
package/dist/eslint/index.d.ts
CHANGED
package/dist/eslint/mobx.js
CHANGED
|
@@ -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 '../
|
|
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';
|
|
2
2
|
|
|
3
3
|
const sortClasses = [
|
|
4
4
|
'error',
|
package/dist/eslint/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const wrapArrayWithCaretAndDollarAnchors: (arr:
|
|
2
|
-
declare const wrapArrayWithCaretAndWildcard: (arr:
|
|
1
|
+
declare const wrapArrayWithCaretAndDollarAnchors: (arr: unknown[]) => Record<string, string>;
|
|
2
|
+
declare const wrapArrayWithCaretAndWildcard: (arr: unknown[]) => Record<string, string>;
|
|
3
3
|
export { wrapArrayWithCaretAndDollarAnchors, wrapArrayWithCaretAndWildcard };
|
package/dist/eslint.js
CHANGED
|
@@ -13,14 +13,22 @@ import globals from 'globals';
|
|
|
13
13
|
import eslintTypeScript from 'typescript-eslint';
|
|
14
14
|
import parser from '@typescript-eslint/parser';
|
|
15
15
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
16
|
-
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 './
|
|
16
|
+
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';
|
|
17
|
+
export { default as eslintFigma } from './eslint/figma.js';
|
|
18
|
+
import '@figma/eslint-plugin-figma-plugins';
|
|
17
19
|
|
|
18
20
|
const createRule = ESLintUtils.RuleCreator(() => {
|
|
19
21
|
return ``;
|
|
20
22
|
});
|
|
21
23
|
const ruleName = 'data-test-id';
|
|
22
|
-
const pluginName = '
|
|
23
|
-
const defaultOptions = [
|
|
24
|
+
const pluginName = 'data-test-id-plugin';
|
|
25
|
+
const defaultOptions = [
|
|
26
|
+
{
|
|
27
|
+
appendElementNamesToCheck: null,
|
|
28
|
+
overrideElementNamesToCheck: null,
|
|
29
|
+
overrideElementNamesToIgnore: null,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
24
32
|
|
|
25
33
|
const MESSAGE_IDS = {
|
|
26
34
|
missingAttribute: 'missingAttribute',
|
|
@@ -108,7 +116,8 @@ const getFunctionOrVariableAncestorNameItems = (context, node) => {
|
|
|
108
116
|
return nameItems;
|
|
109
117
|
};
|
|
110
118
|
|
|
111
|
-
const handleReturnStatement = (context, returnStatementNode) => {
|
|
119
|
+
const handleReturnStatement = (context, returnStatementNode, options) => {
|
|
120
|
+
const { elementNamesToCheck, elementNamesToIgnore } = options;
|
|
112
121
|
// We only care about return statements that return JSX elements
|
|
113
122
|
assert(returnStatementNode.argument);
|
|
114
123
|
assert(returnStatementNode.argument.type === AST_NODE_TYPES.JSXElement);
|
|
@@ -116,12 +125,12 @@ const handleReturnStatement = (context, returnStatementNode) => {
|
|
|
116
125
|
// Something is wrong if it's not a JSXIdentifier
|
|
117
126
|
assert(openingElement.name.type === AST_NODE_TYPES.JSXIdentifier);
|
|
118
127
|
const elementName = openingElement.name.name;
|
|
119
|
-
const isIgnoredElement =
|
|
128
|
+
const isIgnoredElement = elementNamesToIgnore.includes(elementName);
|
|
120
129
|
// Ignore elements that are in the ignore list
|
|
121
130
|
assert(!isIgnoredElement);
|
|
122
131
|
const isLowerCasedName = elementName[0] === elementName[0].toLowerCase();
|
|
123
|
-
const isElementToCheck =
|
|
124
|
-
const isAllElementsToCheck =
|
|
132
|
+
const isElementToCheck = elementNamesToCheck.includes(elementName);
|
|
133
|
+
const isAllElementsToCheck = elementNamesToCheck.length === 0;
|
|
125
134
|
// We only care about lowercase elements or specific Elements
|
|
126
135
|
assert(isLowerCasedName || isElementToCheck || isAllElementsToCheck);
|
|
127
136
|
// Determine which prop name we are looking for
|
|
@@ -187,12 +196,31 @@ const handleReturnStatement = (context, returnStatementNode) => {
|
|
|
187
196
|
node: openingElement,
|
|
188
197
|
});
|
|
189
198
|
};
|
|
190
|
-
const ruleVisitors = (context) => {
|
|
199
|
+
const ruleVisitors = (context, optionsWithDefault) => {
|
|
200
|
+
const [options] = optionsWithDefault;
|
|
201
|
+
const { appendElementNamesToCheck, overrideElementNamesToCheck, overrideElementNamesToIgnore, } = options;
|
|
202
|
+
let elementNamesToCheck = ELEMENT_NAMES_TO_CHECK.slice();
|
|
203
|
+
let elementNamesToIgnore = ELEMENT_NAMES_TO_IGNORE.slice();
|
|
204
|
+
// Override default element names
|
|
205
|
+
if (overrideElementNamesToCheck) {
|
|
206
|
+
elementNamesToCheck = overrideElementNamesToCheck.slice();
|
|
207
|
+
}
|
|
208
|
+
// Override default element names
|
|
209
|
+
if (overrideElementNamesToIgnore) {
|
|
210
|
+
elementNamesToIgnore = overrideElementNamesToIgnore.slice();
|
|
211
|
+
}
|
|
212
|
+
// Append additional element names
|
|
213
|
+
if (appendElementNamesToCheck) {
|
|
214
|
+
elementNamesToCheck.push(...appendElementNamesToCheck);
|
|
215
|
+
}
|
|
191
216
|
return {
|
|
192
217
|
// Iterate over all return statements
|
|
193
218
|
[AST_NODE_TYPES.ReturnStatement]: (node) => {
|
|
194
219
|
try {
|
|
195
|
-
handleReturnStatement(context, node
|
|
220
|
+
handleReturnStatement(context, node, {
|
|
221
|
+
elementNamesToCheck,
|
|
222
|
+
elementNamesToIgnore,
|
|
223
|
+
});
|
|
196
224
|
}
|
|
197
225
|
catch (error) {
|
|
198
226
|
// Only log errors that are not from assert checks.
|
|
@@ -216,7 +244,35 @@ const ruleMeta = {
|
|
|
216
244
|
description: '',
|
|
217
245
|
},
|
|
218
246
|
fixable: 'code',
|
|
219
|
-
schema: [
|
|
247
|
+
schema: [
|
|
248
|
+
{
|
|
249
|
+
type: 'object',
|
|
250
|
+
additionalProperties: false,
|
|
251
|
+
properties: {
|
|
252
|
+
appendElementNamesToCheck: {
|
|
253
|
+
anyOf: [
|
|
254
|
+
{ type: 'array', items: { type: 'string' } },
|
|
255
|
+
{ type: 'null' },
|
|
256
|
+
],
|
|
257
|
+
default: defaultOptions[0].appendElementNamesToCheck,
|
|
258
|
+
},
|
|
259
|
+
overrideElementNamesToCheck: {
|
|
260
|
+
anyOf: [
|
|
261
|
+
{ type: 'array', items: { type: 'string' } },
|
|
262
|
+
{ type: 'null' },
|
|
263
|
+
],
|
|
264
|
+
default: defaultOptions[0].overrideElementNamesToCheck,
|
|
265
|
+
},
|
|
266
|
+
overrideElementNamesToIgnore: {
|
|
267
|
+
anyOf: [
|
|
268
|
+
{ type: 'array', items: { type: 'string' } },
|
|
269
|
+
{ type: 'null' },
|
|
270
|
+
],
|
|
271
|
+
default: defaultOptions[0].overrideElementNamesToIgnore,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
],
|
|
220
276
|
};
|
|
221
277
|
const rule = createRule({
|
|
222
278
|
name: ruleName,
|
|
@@ -235,7 +291,7 @@ const plugin = {
|
|
|
235
291
|
[ruleName]: rule,
|
|
236
292
|
},
|
|
237
293
|
};
|
|
238
|
-
const
|
|
294
|
+
const pluginWithConfigs = {
|
|
239
295
|
...plugin,
|
|
240
296
|
configs: {
|
|
241
297
|
recommended: {
|
|
@@ -258,11 +314,10 @@ const pluginWithoutConfigs = {
|
|
|
258
314
|
const eslintConfig = [
|
|
259
315
|
eslintJs.configs.recommended,
|
|
260
316
|
...eslintTypeScript.configs.recommended,
|
|
261
|
-
//...eslintStorybook.configs['flat/recommended'],
|
|
262
317
|
eslintPluginPrettierRecommended,
|
|
263
|
-
pluginWithoutConfigs.configs.recommended,
|
|
264
318
|
{
|
|
265
319
|
languageOptions: {
|
|
320
|
+
...pluginWithConfigs.configs.recommended.languageOptions,
|
|
266
321
|
globals: {
|
|
267
322
|
...globals.browser,
|
|
268
323
|
...globals.node,
|
|
@@ -271,6 +326,7 @@ const eslintConfig = [
|
|
|
271
326
|
},
|
|
272
327
|
{
|
|
273
328
|
plugins: {
|
|
329
|
+
...pluginWithConfigs.configs.recommended.plugins,
|
|
274
330
|
react: eslintReact,
|
|
275
331
|
// eslint-plugin-react-hooks already supports flat config, but fixupPluginRules
|
|
276
332
|
// is used for compatibility. Type assertion is needed due to type incompatibility.
|
|
@@ -309,6 +365,7 @@ const eslintConfig = [
|
|
|
309
365
|
rules: {
|
|
310
366
|
// react-hooks configs recommended rules
|
|
311
367
|
...eslintReactHooks.configs.recommended.rules,
|
|
368
|
+
...pluginWithConfigs.configs.recommended.rules,
|
|
312
369
|
'react/jsx-fragments': ['error', 'element'],
|
|
313
370
|
// @typescript-eslint
|
|
314
371
|
'@typescript-eslint/ban-ts-comment': 'off',
|
package/dist/prettier.js
CHANGED
|
@@ -53,11 +53,11 @@ const sortInterfaces = [
|
|
|
53
53
|
|
|
54
54
|
const sortIntersectionTypes = ['error', { type: 'natural', order: 'asc' }];
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
function validateArray(arr) {
|
|
57
57
|
if (!Array.isArray(arr) || !arr.every((str) => typeof str === 'string')) {
|
|
58
58
|
throw new Error('Input must be an array of strings');
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
const wrapArrayWithCaretAndDollarAnchors = (arr) => {
|
|
62
62
|
validateArray(arr);
|
|
63
63
|
return arr.reduce((acc, str) => {
|
package/dist/stylelint.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-default-export
|
|
1
2
|
var index = {
|
|
2
3
|
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
|
|
3
4
|
ignoreFiles: [
|
|
@@ -9,7 +10,9 @@ var index = {
|
|
|
9
10
|
'**/*.ts',
|
|
10
11
|
'**/*.tsx',
|
|
11
12
|
'**/*.js',
|
|
13
|
+
'**/*.jsx',
|
|
12
14
|
'**/*.mjs',
|
|
15
|
+
'**/*.md',
|
|
13
16
|
'ios/**/*',
|
|
14
17
|
'android/**/*',
|
|
15
18
|
],
|
|
@@ -53,6 +56,7 @@ var index = {
|
|
|
53
56
|
],
|
|
54
57
|
'block-no-empty': null,
|
|
55
58
|
'color-function-notation': 'legacy',
|
|
59
|
+
'color-no-hex': true,
|
|
56
60
|
'comment-empty-line-before': [
|
|
57
61
|
'always',
|
|
58
62
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/lint",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.95",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets",
|
|
6
6
|
"engines": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"prepack": "NODE_ENV=production npm run build",
|
|
15
15
|
"pre-commit": "npm run typecheck",
|
|
16
16
|
"semantic-release": "semantic-release",
|
|
17
|
+
"test": "npx tsx --test --test-reporter=dot src/**/*.test.ts",
|
|
17
18
|
"typecheck": "tsc --noEmit"
|
|
18
19
|
},
|
|
19
20
|
"type": "module",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
],
|
|
31
32
|
"exports": {
|
|
32
33
|
"./eslint": "./dist/eslint.js",
|
|
34
|
+
"./eslint/figma": "./dist/eslint/figma.js",
|
|
33
35
|
"./eslint/mobx": "./dist/eslint/mobx.js",
|
|
34
36
|
"./eslint/perfectionist": "./dist/eslint/perfectionist.js",
|
|
35
37
|
"./eslint/react-native": "./dist/eslint/react-native.js",
|
|
@@ -46,17 +48,18 @@
|
|
|
46
48
|
"@babel/eslint-parser": "^7.28.6",
|
|
47
49
|
"@babel/eslint-plugin": "^7.27.1",
|
|
48
50
|
"@eslint/compat": "^2.0.1",
|
|
51
|
+
"@figma/eslint-plugin-figma-plugins": "^1.0.0",
|
|
49
52
|
"@eslint/js": "^9.39.2",
|
|
50
53
|
"@eslint/markdown": "^7.5.1",
|
|
51
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
52
|
-
"@html-eslint/parser": "^0.
|
|
54
|
+
"@html-eslint/eslint-plugin": "^0.54.0",
|
|
55
|
+
"@html-eslint/parser": "^0.54.0",
|
|
53
56
|
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
55
|
-
"@typescript-eslint/parser": "^8.
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
58
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
56
59
|
"eslint": "^9.39.2",
|
|
57
60
|
"eslint-config-prettier": "^10.1.8",
|
|
58
61
|
"eslint-import-resolver-alias": "^1.1.2",
|
|
59
|
-
"eslint-plugin-html": "^8.1.
|
|
62
|
+
"eslint-plugin-html": "^8.1.4",
|
|
60
63
|
"eslint-plugin-import": "^2.32.0",
|
|
61
64
|
"eslint-plugin-json": "^4.0.1",
|
|
62
65
|
"eslint-plugin-mobx": "^0.0.13",
|
|
@@ -69,20 +72,21 @@
|
|
|
69
72
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
70
73
|
"eslint-plugin-react-native": "^5.0.0",
|
|
71
74
|
"eslint-plugin-react-refresh": "^0.4.26",
|
|
72
|
-
"eslint-plugin-storybook": "^10.2.
|
|
75
|
+
"eslint-plugin-storybook": "^10.2.1",
|
|
73
76
|
"expo-modules-autolinking": "^3.0.24",
|
|
74
|
-
"globals": "^17.
|
|
77
|
+
"globals": "^17.2.0",
|
|
75
78
|
"prettier": "^3.8.1",
|
|
79
|
+
"stylelint": "^17.0.0",
|
|
76
80
|
"stylelint-config-standard": "^40.0.0",
|
|
77
81
|
"stylelint-no-unsupported-browser-features": "^8.0.5",
|
|
78
82
|
"stylelint-order": "^7.0.1",
|
|
79
83
|
"stylelint-prettier": "^5.0.3",
|
|
80
|
-
"typescript-eslint": "^8.
|
|
84
|
+
"typescript-eslint": "^8.54.0"
|
|
81
85
|
},
|
|
82
86
|
"devDependencies": {
|
|
83
87
|
"@commitlint/cli": "^20.3.1",
|
|
84
88
|
"@commitlint/config-conventional": "^20.3.1",
|
|
85
|
-
"@itcase/config": "^1.6.
|
|
89
|
+
"@itcase/config": "^1.6.45",
|
|
86
90
|
"@rollup/plugin-alias": "^6.0.0",
|
|
87
91
|
"@rollup/plugin-babel": "^6.1.0",
|
|
88
92
|
"@rollup/plugin-image": "^3.0.3",
|
|
@@ -90,20 +94,20 @@
|
|
|
90
94
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
91
95
|
"@rollup/plugin-terser": "^0.4.4",
|
|
92
96
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
93
|
-
"@types/node": "^25.0
|
|
94
|
-
"@types/react": "^19.2.
|
|
97
|
+
"@types/node": "^25.1.0",
|
|
98
|
+
"@types/react": "^19.2.10",
|
|
95
99
|
"@types/react-dom": "^19.2.3",
|
|
96
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
100
|
+
"@typescript-eslint/rule-tester": "^8.54.0",
|
|
101
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
97
102
|
"del-cli": "^7.0.0",
|
|
98
103
|
"husky": "^9.1.7",
|
|
99
104
|
"lint-staged": "^16.2.7",
|
|
100
|
-
"rollup": "4.
|
|
105
|
+
"rollup": "4.57.0",
|
|
101
106
|
"rollup-plugin-copy": "^3.5.0",
|
|
102
107
|
"rollup-plugin-dts": "^6.3.0",
|
|
103
108
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
104
109
|
"rollup-preserve-directives": "^1.1.3",
|
|
105
110
|
"semantic-release": "^25.0.2",
|
|
106
|
-
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
107
111
|
"tsx": "^4.21.0",
|
|
108
112
|
"typescript": "^5.9.3"
|
|
109
113
|
}
|