eslint-plugin-react-naming-convention 1.26.3-next.14 → 1.26.3-next.16
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/dist/index.d.mts +41 -2
- package/dist/index.d.ts +41 -2
- package/dist/index.js +64 -26
- package/dist/index.mjs +64 -26
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
import { RulePreset } from '@eslint-react/shared';
|
|
2
3
|
|
|
3
4
|
type MessageID$2 = "useJsxFileExtension" | "useJsxFileExtensionAsNeeded";
|
|
4
5
|
|
|
@@ -7,11 +8,49 @@ type MessageID$1 = "filenameCaseMismatch" | "filenameEmpty";
|
|
|
7
8
|
type MessageID = "usePascalCase" | "useConstantCase";
|
|
8
9
|
|
|
9
10
|
declare const _default: {
|
|
10
|
-
|
|
11
|
+
configs: {
|
|
12
|
+
recommended: {
|
|
13
|
+
plugins: {
|
|
14
|
+
"react-x": {
|
|
15
|
+
readonly meta: {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly version: string;
|
|
18
|
+
};
|
|
19
|
+
readonly rules: {
|
|
20
|
+
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
21
|
+
allowAllCaps?: boolean;
|
|
22
|
+
allowLeadingUnderscore?: boolean;
|
|
23
|
+
allowNamespace?: boolean;
|
|
24
|
+
excepts?: readonly string[];
|
|
25
|
+
rule?: "CONSTANT_CASE" | "PascalCase";
|
|
26
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
27
|
+
readonly filename: _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
28
|
+
excepts?: readonly string[];
|
|
29
|
+
extensions?: readonly string[];
|
|
30
|
+
rule?: "PascalCase" | "camelCase" | "kebab-case" | "snake_case";
|
|
31
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
32
|
+
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$2, readonly [("always" | "as-needed") | {
|
|
33
|
+
allow?: "always" | "as-needed";
|
|
34
|
+
extensions?: readonly string[];
|
|
35
|
+
ignoreFilesWithoutCode?: boolean;
|
|
36
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
37
|
+
readonly "use-state": _typescript_eslint_utils_ts_eslint.RuleModule<"unexpected", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
name: string;
|
|
42
|
+
rules: RulePreset;
|
|
43
|
+
};
|
|
44
|
+
"recommended-legacy": {
|
|
45
|
+
plugins: string[];
|
|
46
|
+
rules: RulePreset;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
meta: {
|
|
11
50
|
readonly name: string;
|
|
12
51
|
readonly version: string;
|
|
13
52
|
};
|
|
14
|
-
|
|
53
|
+
rules: {
|
|
15
54
|
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
16
55
|
allowAllCaps?: boolean;
|
|
17
56
|
allowLeadingUnderscore?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
|
+
import { RulePreset } from '@eslint-react/shared';
|
|
2
3
|
|
|
3
4
|
type MessageID$2 = "useJsxFileExtension" | "useJsxFileExtensionAsNeeded";
|
|
4
5
|
|
|
@@ -7,11 +8,49 @@ type MessageID$1 = "filenameCaseMismatch" | "filenameEmpty";
|
|
|
7
8
|
type MessageID = "usePascalCase" | "useConstantCase";
|
|
8
9
|
|
|
9
10
|
declare const _default: {
|
|
10
|
-
|
|
11
|
+
configs: {
|
|
12
|
+
recommended: {
|
|
13
|
+
plugins: {
|
|
14
|
+
"react-x": {
|
|
15
|
+
readonly meta: {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly version: string;
|
|
18
|
+
};
|
|
19
|
+
readonly rules: {
|
|
20
|
+
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
21
|
+
allowAllCaps?: boolean;
|
|
22
|
+
allowLeadingUnderscore?: boolean;
|
|
23
|
+
allowNamespace?: boolean;
|
|
24
|
+
excepts?: readonly string[];
|
|
25
|
+
rule?: "CONSTANT_CASE" | "PascalCase";
|
|
26
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
27
|
+
readonly filename: _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
28
|
+
excepts?: readonly string[];
|
|
29
|
+
extensions?: readonly string[];
|
|
30
|
+
rule?: "PascalCase" | "camelCase" | "kebab-case" | "snake_case";
|
|
31
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
32
|
+
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$2, readonly [("always" | "as-needed") | {
|
|
33
|
+
allow?: "always" | "as-needed";
|
|
34
|
+
extensions?: readonly string[];
|
|
35
|
+
ignoreFilesWithoutCode?: boolean;
|
|
36
|
+
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
37
|
+
readonly "use-state": _typescript_eslint_utils_ts_eslint.RuleModule<"unexpected", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
name: string;
|
|
42
|
+
rules: RulePreset;
|
|
43
|
+
};
|
|
44
|
+
"recommended-legacy": {
|
|
45
|
+
plugins: string[];
|
|
46
|
+
rules: RulePreset;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
meta: {
|
|
11
50
|
readonly name: string;
|
|
12
51
|
readonly version: string;
|
|
13
52
|
};
|
|
14
|
-
|
|
53
|
+
rules: {
|
|
15
54
|
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
16
55
|
allowAllCaps?: boolean;
|
|
17
56
|
allowLeadingUnderscore?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -34,9 +34,24 @@ var AST__namespace = /*#__PURE__*/_interopNamespace(AST);
|
|
|
34
34
|
var JSX__namespace = /*#__PURE__*/_interopNamespace(JSX);
|
|
35
35
|
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
36
36
|
|
|
37
|
+
var __defProp = Object.defineProperty;
|
|
38
|
+
var __export = (target, all) => {
|
|
39
|
+
for (var name3 in all)
|
|
40
|
+
__defProp(target, name3, { get: all[name3], enumerable: true });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// src/configs/recommended.ts
|
|
44
|
+
var recommended_exports = {};
|
|
45
|
+
__export(recommended_exports, {
|
|
46
|
+
name: () => name,
|
|
47
|
+
rules: () => rules
|
|
48
|
+
});
|
|
49
|
+
var name = "react-naming-convention/recommended";
|
|
50
|
+
var rules = {};
|
|
51
|
+
|
|
37
52
|
// package.json
|
|
38
|
-
var
|
|
39
|
-
var version = "1.26.3-next.
|
|
53
|
+
var name2 = "eslint-plugin-react-naming-convention";
|
|
54
|
+
var version = "1.26.3-next.16";
|
|
40
55
|
var createRule = shared.createRuleForPlugin("naming-convention");
|
|
41
56
|
|
|
42
57
|
// src/rules/component-name.ts
|
|
@@ -90,8 +105,8 @@ function normalizeOptions(options) {
|
|
|
90
105
|
excepts: opts.excepts?.map((pattern) => new RegExp(pattern, "u")) ?? []
|
|
91
106
|
};
|
|
92
107
|
}
|
|
93
|
-
function getViolationMessage(
|
|
94
|
-
if (
|
|
108
|
+
function getViolationMessage(name3, options) {
|
|
109
|
+
if (name3 == null) return eff._;
|
|
95
110
|
const {
|
|
96
111
|
allowAllCaps = false,
|
|
97
112
|
allowLeadingUnderscore = false,
|
|
@@ -99,10 +114,10 @@ function getViolationMessage(name2, options) {
|
|
|
99
114
|
excepts,
|
|
100
115
|
rule
|
|
101
116
|
} = options;
|
|
102
|
-
if (excepts.some((regex) => regex.test(
|
|
117
|
+
if (excepts.some((regex) => regex.test(name3))) {
|
|
103
118
|
return eff._;
|
|
104
119
|
}
|
|
105
|
-
let normalized =
|
|
120
|
+
let normalized = name3.normalize("NFKD").replace(/[\u0300-\u036F]/g, "");
|
|
106
121
|
normalized = normalized.split(".").at(-1) ?? normalized;
|
|
107
122
|
if (allowNamespace) {
|
|
108
123
|
normalized = normalized.replace(":", "");
|
|
@@ -139,17 +154,17 @@ var component_name_default = createRule({
|
|
|
139
154
|
...collector.listeners,
|
|
140
155
|
...collectorLegacy.listeners,
|
|
141
156
|
JSXOpeningElement(node) {
|
|
142
|
-
const
|
|
143
|
-
if (/^[a-z]/u.test(
|
|
157
|
+
const name3 = JSX__namespace.getElementName(node.parent);
|
|
158
|
+
if (/^[a-z]/u.test(name3)) {
|
|
144
159
|
return;
|
|
145
160
|
}
|
|
146
|
-
const violation = getViolationMessage(
|
|
161
|
+
const violation = getViolationMessage(name3, options);
|
|
147
162
|
if (violation == null) return;
|
|
148
163
|
context.report({
|
|
149
164
|
messageId: violation,
|
|
150
165
|
node,
|
|
151
166
|
data: {
|
|
152
|
-
name:
|
|
167
|
+
name: name3
|
|
153
168
|
}
|
|
154
169
|
});
|
|
155
170
|
},
|
|
@@ -159,22 +174,22 @@ var component_name_default = createRule({
|
|
|
159
174
|
for (const { node: component } of functionComponents.values()) {
|
|
160
175
|
const id = AST__namespace.getFunctionIdentifier(component);
|
|
161
176
|
if (id?.name == null) continue;
|
|
162
|
-
const
|
|
163
|
-
const violation = getViolationMessage(
|
|
177
|
+
const name3 = id.name;
|
|
178
|
+
const violation = getViolationMessage(name3, options);
|
|
164
179
|
if (violation == null) continue;
|
|
165
180
|
context.report({
|
|
166
181
|
messageId: violation,
|
|
167
182
|
node: id,
|
|
168
183
|
data: {
|
|
169
|
-
name:
|
|
184
|
+
name: name3
|
|
170
185
|
}
|
|
171
186
|
});
|
|
172
187
|
}
|
|
173
188
|
for (const { node: component } of classComponents.values()) {
|
|
174
189
|
const id = AST__namespace.getClassIdentifier(component);
|
|
175
190
|
if (id?.name == null) continue;
|
|
176
|
-
const
|
|
177
|
-
const violation = getViolationMessage(
|
|
191
|
+
const name3 = id.name;
|
|
192
|
+
const violation = getViolationMessage(name3, options);
|
|
178
193
|
if (violation == null) continue;
|
|
179
194
|
context.report({
|
|
180
195
|
messageId: violation,
|
|
@@ -244,13 +259,13 @@ var filename_default = createRule({
|
|
|
244
259
|
const options = context.options[0] ?? defaultOptions2[0];
|
|
245
260
|
const rule = typeof options === "string" ? options : options.rule ?? "PascalCase";
|
|
246
261
|
const excepts = typeof options === "string" ? [] : options.excepts ?? [];
|
|
247
|
-
function validate(
|
|
248
|
-
const shouldIgnore = ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(
|
|
262
|
+
function validate(name3, casing = rule, ignores = excepts) {
|
|
263
|
+
const shouldIgnore = ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(name3));
|
|
249
264
|
if (shouldIgnore) return true;
|
|
250
|
-
return tsPattern.match(casing).with("PascalCase", () => shared.RE_PASCAL_CASE.test(
|
|
265
|
+
return tsPattern.match(casing).with("PascalCase", () => shared.RE_PASCAL_CASE.test(name3)).with("camelCase", () => shared.RE_CAMEL_CASE.test(name3)).with("kebab-case", () => shared.RE_KEBAB_CASE.test(name3)).with("snake_case", () => shared.RE_SNAKE_CASE.test(name3)).exhaustive();
|
|
251
266
|
}
|
|
252
|
-
function getSuggestion(
|
|
253
|
-
return tsPattern.match(casing).with("PascalCase", () => stringTs.pascalCase(
|
|
267
|
+
function getSuggestion(name3, casing = rule) {
|
|
268
|
+
return tsPattern.match(casing).with("PascalCase", () => stringTs.pascalCase(name3)).with("camelCase", () => stringTs.camelCase(name3)).with("kebab-case", () => stringTs.kebabCase(name3)).with("snake_case", () => stringTs.snakeCase(name3)).exhaustive();
|
|
254
269
|
}
|
|
255
270
|
return {
|
|
256
271
|
Program(node) {
|
|
@@ -376,9 +391,9 @@ var RULE_NAME4 = "use-state";
|
|
|
376
391
|
var RULE_FEATURES = [
|
|
377
392
|
"CHK"
|
|
378
393
|
];
|
|
379
|
-
function isSetterNameLoose(
|
|
380
|
-
const fourthChar = [...
|
|
381
|
-
return
|
|
394
|
+
function isSetterNameLoose(name3) {
|
|
395
|
+
const fourthChar = [...name3][3];
|
|
396
|
+
return name3.startsWith("set") && fourthChar === fourthChar?.toUpperCase();
|
|
382
397
|
}
|
|
383
398
|
var use_state_default = createRule({
|
|
384
399
|
meta: {
|
|
@@ -454,10 +469,10 @@ var use_state_default = createRule({
|
|
|
454
469
|
defaultOptions: []
|
|
455
470
|
});
|
|
456
471
|
|
|
457
|
-
// src/
|
|
458
|
-
var
|
|
472
|
+
// src/plugin.ts
|
|
473
|
+
var plugin = {
|
|
459
474
|
meta: {
|
|
460
|
-
name,
|
|
475
|
+
name: name2,
|
|
461
476
|
version
|
|
462
477
|
},
|
|
463
478
|
rules: {
|
|
@@ -468,4 +483,27 @@ var index_default = {
|
|
|
468
483
|
}
|
|
469
484
|
};
|
|
470
485
|
|
|
486
|
+
// src/index.ts
|
|
487
|
+
function makeConfig(config) {
|
|
488
|
+
return {
|
|
489
|
+
...config,
|
|
490
|
+
plugins: {
|
|
491
|
+
"react-x": plugin
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
function makeLegacyConfig(config) {
|
|
496
|
+
return {
|
|
497
|
+
plugins: ["react-x"],
|
|
498
|
+
rules: config.rules
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
var index_default = {
|
|
502
|
+
...plugin,
|
|
503
|
+
configs: {
|
|
504
|
+
["recommended"]: makeConfig(recommended_exports),
|
|
505
|
+
["recommended-legacy"]: makeLegacyConfig(recommended_exports)
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
471
509
|
module.exports = index_default;
|
package/dist/index.mjs
CHANGED
|
@@ -8,9 +8,24 @@ import path from 'node:path';
|
|
|
8
8
|
import { capitalize, pascalCase, camelCase, kebabCase, snakeCase } from 'string-ts';
|
|
9
9
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
10
10
|
|
|
11
|
+
var __defProp = Object.defineProperty;
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name3 in all)
|
|
14
|
+
__defProp(target, name3, { get: all[name3], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/configs/recommended.ts
|
|
18
|
+
var recommended_exports = {};
|
|
19
|
+
__export(recommended_exports, {
|
|
20
|
+
name: () => name,
|
|
21
|
+
rules: () => rules
|
|
22
|
+
});
|
|
23
|
+
var name = "react-naming-convention/recommended";
|
|
24
|
+
var rules = {};
|
|
25
|
+
|
|
11
26
|
// package.json
|
|
12
|
-
var
|
|
13
|
-
var version = "1.26.3-next.
|
|
27
|
+
var name2 = "eslint-plugin-react-naming-convention";
|
|
28
|
+
var version = "1.26.3-next.16";
|
|
14
29
|
var createRule = createRuleForPlugin("naming-convention");
|
|
15
30
|
|
|
16
31
|
// src/rules/component-name.ts
|
|
@@ -64,8 +79,8 @@ function normalizeOptions(options) {
|
|
|
64
79
|
excepts: opts.excepts?.map((pattern) => new RegExp(pattern, "u")) ?? []
|
|
65
80
|
};
|
|
66
81
|
}
|
|
67
|
-
function getViolationMessage(
|
|
68
|
-
if (
|
|
82
|
+
function getViolationMessage(name3, options) {
|
|
83
|
+
if (name3 == null) return _;
|
|
69
84
|
const {
|
|
70
85
|
allowAllCaps = false,
|
|
71
86
|
allowLeadingUnderscore = false,
|
|
@@ -73,10 +88,10 @@ function getViolationMessage(name2, options) {
|
|
|
73
88
|
excepts,
|
|
74
89
|
rule
|
|
75
90
|
} = options;
|
|
76
|
-
if (excepts.some((regex) => regex.test(
|
|
91
|
+
if (excepts.some((regex) => regex.test(name3))) {
|
|
77
92
|
return _;
|
|
78
93
|
}
|
|
79
|
-
let normalized =
|
|
94
|
+
let normalized = name3.normalize("NFKD").replace(/[\u0300-\u036F]/g, "");
|
|
80
95
|
normalized = normalized.split(".").at(-1) ?? normalized;
|
|
81
96
|
if (allowNamespace) {
|
|
82
97
|
normalized = normalized.replace(":", "");
|
|
@@ -113,17 +128,17 @@ var component_name_default = createRule({
|
|
|
113
128
|
...collector.listeners,
|
|
114
129
|
...collectorLegacy.listeners,
|
|
115
130
|
JSXOpeningElement(node) {
|
|
116
|
-
const
|
|
117
|
-
if (/^[a-z]/u.test(
|
|
131
|
+
const name3 = JSX.getElementName(node.parent);
|
|
132
|
+
if (/^[a-z]/u.test(name3)) {
|
|
118
133
|
return;
|
|
119
134
|
}
|
|
120
|
-
const violation = getViolationMessage(
|
|
135
|
+
const violation = getViolationMessage(name3, options);
|
|
121
136
|
if (violation == null) return;
|
|
122
137
|
context.report({
|
|
123
138
|
messageId: violation,
|
|
124
139
|
node,
|
|
125
140
|
data: {
|
|
126
|
-
name:
|
|
141
|
+
name: name3
|
|
127
142
|
}
|
|
128
143
|
});
|
|
129
144
|
},
|
|
@@ -133,22 +148,22 @@ var component_name_default = createRule({
|
|
|
133
148
|
for (const { node: component } of functionComponents.values()) {
|
|
134
149
|
const id = AST.getFunctionIdentifier(component);
|
|
135
150
|
if (id?.name == null) continue;
|
|
136
|
-
const
|
|
137
|
-
const violation = getViolationMessage(
|
|
151
|
+
const name3 = id.name;
|
|
152
|
+
const violation = getViolationMessage(name3, options);
|
|
138
153
|
if (violation == null) continue;
|
|
139
154
|
context.report({
|
|
140
155
|
messageId: violation,
|
|
141
156
|
node: id,
|
|
142
157
|
data: {
|
|
143
|
-
name:
|
|
158
|
+
name: name3
|
|
144
159
|
}
|
|
145
160
|
});
|
|
146
161
|
}
|
|
147
162
|
for (const { node: component } of classComponents.values()) {
|
|
148
163
|
const id = AST.getClassIdentifier(component);
|
|
149
164
|
if (id?.name == null) continue;
|
|
150
|
-
const
|
|
151
|
-
const violation = getViolationMessage(
|
|
165
|
+
const name3 = id.name;
|
|
166
|
+
const violation = getViolationMessage(name3, options);
|
|
152
167
|
if (violation == null) continue;
|
|
153
168
|
context.report({
|
|
154
169
|
messageId: violation,
|
|
@@ -218,13 +233,13 @@ var filename_default = createRule({
|
|
|
218
233
|
const options = context.options[0] ?? defaultOptions2[0];
|
|
219
234
|
const rule = typeof options === "string" ? options : options.rule ?? "PascalCase";
|
|
220
235
|
const excepts = typeof options === "string" ? [] : options.excepts ?? [];
|
|
221
|
-
function validate(
|
|
222
|
-
const shouldIgnore = ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(
|
|
236
|
+
function validate(name3, casing = rule, ignores = excepts) {
|
|
237
|
+
const shouldIgnore = ignores.map((pattern) => new RegExp(pattern, "u")).some((pattern) => pattern.test(name3));
|
|
223
238
|
if (shouldIgnore) return true;
|
|
224
|
-
return match(casing).with("PascalCase", () => RE_PASCAL_CASE.test(
|
|
239
|
+
return match(casing).with("PascalCase", () => RE_PASCAL_CASE.test(name3)).with("camelCase", () => RE_CAMEL_CASE.test(name3)).with("kebab-case", () => RE_KEBAB_CASE.test(name3)).with("snake_case", () => RE_SNAKE_CASE.test(name3)).exhaustive();
|
|
225
240
|
}
|
|
226
|
-
function getSuggestion(
|
|
227
|
-
return match(casing).with("PascalCase", () => pascalCase(
|
|
241
|
+
function getSuggestion(name3, casing = rule) {
|
|
242
|
+
return match(casing).with("PascalCase", () => pascalCase(name3)).with("camelCase", () => camelCase(name3)).with("kebab-case", () => kebabCase(name3)).with("snake_case", () => snakeCase(name3)).exhaustive();
|
|
228
243
|
}
|
|
229
244
|
return {
|
|
230
245
|
Program(node) {
|
|
@@ -350,9 +365,9 @@ var RULE_NAME4 = "use-state";
|
|
|
350
365
|
var RULE_FEATURES = [
|
|
351
366
|
"CHK"
|
|
352
367
|
];
|
|
353
|
-
function isSetterNameLoose(
|
|
354
|
-
const fourthChar = [...
|
|
355
|
-
return
|
|
368
|
+
function isSetterNameLoose(name3) {
|
|
369
|
+
const fourthChar = [...name3][3];
|
|
370
|
+
return name3.startsWith("set") && fourthChar === fourthChar?.toUpperCase();
|
|
356
371
|
}
|
|
357
372
|
var use_state_default = createRule({
|
|
358
373
|
meta: {
|
|
@@ -428,10 +443,10 @@ var use_state_default = createRule({
|
|
|
428
443
|
defaultOptions: []
|
|
429
444
|
});
|
|
430
445
|
|
|
431
|
-
// src/
|
|
432
|
-
var
|
|
446
|
+
// src/plugin.ts
|
|
447
|
+
var plugin = {
|
|
433
448
|
meta: {
|
|
434
|
-
name,
|
|
449
|
+
name: name2,
|
|
435
450
|
version
|
|
436
451
|
},
|
|
437
452
|
rules: {
|
|
@@ -442,4 +457,27 @@ var index_default = {
|
|
|
442
457
|
}
|
|
443
458
|
};
|
|
444
459
|
|
|
460
|
+
// src/index.ts
|
|
461
|
+
function makeConfig(config) {
|
|
462
|
+
return {
|
|
463
|
+
...config,
|
|
464
|
+
plugins: {
|
|
465
|
+
"react-x": plugin
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
function makeLegacyConfig(config) {
|
|
470
|
+
return {
|
|
471
|
+
plugins: ["react-x"],
|
|
472
|
+
rules: config.rules
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
var index_default = {
|
|
476
|
+
...plugin,
|
|
477
|
+
configs: {
|
|
478
|
+
["recommended"]: makeConfig(recommended_exports),
|
|
479
|
+
["recommended-legacy"]: makeLegacyConfig(recommended_exports)
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
|
|
445
483
|
export { index_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "1.26.3-next.
|
|
3
|
+
"version": "1.26.3-next.16",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
"./package.json"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@typescript-eslint/scope-manager": "^8.24.
|
|
47
|
-
"@typescript-eslint/type-utils": "^8.24.
|
|
48
|
-
"@typescript-eslint/types": "^8.24.
|
|
49
|
-
"@typescript-eslint/utils": "^8.24.
|
|
46
|
+
"@typescript-eslint/scope-manager": "^8.24.1",
|
|
47
|
+
"@typescript-eslint/type-utils": "^8.24.1",
|
|
48
|
+
"@typescript-eslint/types": "^8.24.1",
|
|
49
|
+
"@typescript-eslint/utils": "^8.24.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.6.2",
|
|
52
|
-
"@eslint-react/ast": "1.26.3-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/jsx": "1.26.3-next.
|
|
56
|
-
"@eslint-react/shared": "1.26.3-next.
|
|
52
|
+
"@eslint-react/ast": "1.26.3-next.16",
|
|
53
|
+
"@eslint-react/core": "1.26.3-next.16",
|
|
54
|
+
"@eslint-react/eff": "1.26.3-next.16",
|
|
55
|
+
"@eslint-react/jsx": "1.26.3-next.16",
|
|
56
|
+
"@eslint-react/shared": "1.26.3-next.16"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/react": "^19.0.10",
|