eslint-plugin-react-naming-convention 1.38.0 → 1.38.1-next.1
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.js +3 -11
- package/dist/index.mjs +2 -10
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -51,17 +51,9 @@ var rules = {};
|
|
|
51
51
|
|
|
52
52
|
// package.json
|
|
53
53
|
var name2 = "eslint-plugin-react-naming-convention";
|
|
54
|
-
var version = "1.38.
|
|
54
|
+
var version = "1.38.1-next.1";
|
|
55
55
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("naming-convention"));
|
|
56
56
|
|
|
57
|
-
// src/utils/regexp.ts
|
|
58
|
-
var RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
|
|
59
|
-
function toRegExp(string) {
|
|
60
|
-
const [, pattern, flags = "u"] = RE_REGEXP_STR.exec(string) ?? [];
|
|
61
|
-
if (pattern) return new RegExp(pattern, flags);
|
|
62
|
-
return { test: (s) => s === string };
|
|
63
|
-
}
|
|
64
|
-
|
|
65
57
|
// src/rules/component-name.ts
|
|
66
58
|
var defaultOptions = [
|
|
67
59
|
{
|
|
@@ -166,7 +158,7 @@ function normalizeOptions(options) {
|
|
|
166
158
|
...defaultOpts,
|
|
167
159
|
...typeof opts === "string" ? { rule: opts } : {
|
|
168
160
|
...opts,
|
|
169
|
-
excepts: opts.excepts?.map(toRegExp) ?? []
|
|
161
|
+
excepts: opts.excepts?.map(kit.toRegExp) ?? []
|
|
170
162
|
}
|
|
171
163
|
};
|
|
172
164
|
}
|
|
@@ -275,7 +267,7 @@ function create3(context) {
|
|
|
275
267
|
const rule = typeof options === "string" ? options : options.rule ?? "PascalCase";
|
|
276
268
|
const excepts = typeof options === "string" ? [] : options.excepts ?? [];
|
|
277
269
|
function validate(name3, casing = rule, ignores = excepts) {
|
|
278
|
-
const shouldIgnore = ignores.map(toRegExp).some((pattern) => pattern.test(name3));
|
|
270
|
+
const shouldIgnore = ignores.map(kit.toRegExp).some((pattern) => pattern.test(name3));
|
|
279
271
|
if (shouldIgnore) return true;
|
|
280
272
|
return tsPattern.match(casing).with("PascalCase", () => kit.RE_PASCAL_CASE.test(name3)).with("camelCase", () => kit.RE_CAMEL_CASE.test(name3)).with("kebab-case", () => kit.RE_KEBAB_CASE.test(name3)).with("snake_case", () => kit.RE_SNAKE_CASE.test(name3)).exhaustive();
|
|
281
273
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as AST from '@eslint-react/ast';
|
|
2
2
|
import { useComponentCollector, useComponentCollectorLegacy, isCreateContextCall, getInstanceId, isComponentName } from '@eslint-react/core';
|
|
3
|
-
import { RE_PASCAL_CASE, RE_CONSTANT_CASE, RE_CAMEL_CASE, RE_KEBAB_CASE, RE_SNAKE_CASE } from '@eslint-react/kit';
|
|
3
|
+
import { toRegExp, RE_PASCAL_CASE, RE_CONSTANT_CASE, RE_CAMEL_CASE, RE_KEBAB_CASE, RE_SNAKE_CASE } from '@eslint-react/kit';
|
|
4
4
|
import { getDocsUrl } from '@eslint-react/shared';
|
|
5
5
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
6
6
|
import { identity, _, isObject } from '@eslint-react/eff';
|
|
@@ -26,17 +26,9 @@ var rules = {};
|
|
|
26
26
|
|
|
27
27
|
// package.json
|
|
28
28
|
var name2 = "eslint-plugin-react-naming-convention";
|
|
29
|
-
var version = "1.38.
|
|
29
|
+
var version = "1.38.1-next.1";
|
|
30
30
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("naming-convention"));
|
|
31
31
|
|
|
32
|
-
// src/utils/regexp.ts
|
|
33
|
-
var RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
|
|
34
|
-
function toRegExp(string) {
|
|
35
|
-
const [, pattern, flags = "u"] = RE_REGEXP_STR.exec(string) ?? [];
|
|
36
|
-
if (pattern) return new RegExp(pattern, flags);
|
|
37
|
-
return { test: (s) => s === string };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
32
|
// src/rules/component-name.ts
|
|
41
33
|
var defaultOptions = [
|
|
42
34
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "1.38.
|
|
3
|
+
"version": "1.38.1-next.1",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"@typescript-eslint/utils": "^8.28.0",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.6.2",
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/kit": "1.38.
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.38.1-next.1",
|
|
53
|
+
"@eslint-react/eff": "1.38.1-next.1",
|
|
54
|
+
"@eslint-react/core": "1.38.1-next.1",
|
|
55
|
+
"@eslint-react/jsx": "1.38.1-next.1",
|
|
56
|
+
"@eslint-react/shared": "1.38.1-next.1",
|
|
57
|
+
"@eslint-react/kit": "1.38.1-next.1",
|
|
58
|
+
"@eslint-react/var": "1.38.1-next.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.12",
|