eslint-plugin-react-naming-convention 2.0.0-next.5 → 2.0.0-next.50
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.ts +0 -6
- package/dist/index.js +4 -15
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -19,15 +19,12 @@ declare const _default: {
|
|
|
19
19
|
readonly rules: {
|
|
20
20
|
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<"invalid", readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
21
21
|
allowAllCaps?: boolean;
|
|
22
|
-
allowLeadingUnderscore?: boolean;
|
|
23
|
-
allowNamespace?: boolean;
|
|
24
22
|
excepts?: readonly string[];
|
|
25
23
|
rule?: "CONSTANT_CASE" | "PascalCase";
|
|
26
24
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
27
25
|
readonly "context-name": _typescript_eslint_utils_ts_eslint.RuleModule<"invalid", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
28
26
|
readonly filename: _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
29
27
|
excepts?: readonly string[];
|
|
30
|
-
extensions?: readonly string[];
|
|
31
28
|
rule?: "PascalCase" | "camelCase" | "kebab-case" | "snake_case";
|
|
32
29
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
33
30
|
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("always" | "as-needed") | {
|
|
@@ -54,15 +51,12 @@ declare const _default: {
|
|
|
54
51
|
rules: {
|
|
55
52
|
readonly "component-name": _typescript_eslint_utils_ts_eslint.RuleModule<"invalid", readonly [("CONSTANT_CASE" | "PascalCase") | {
|
|
56
53
|
allowAllCaps?: boolean;
|
|
57
|
-
allowLeadingUnderscore?: boolean;
|
|
58
|
-
allowNamespace?: boolean;
|
|
59
54
|
excepts?: readonly string[];
|
|
60
55
|
rule?: "CONSTANT_CASE" | "PascalCase";
|
|
61
56
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
62
57
|
readonly "context-name": _typescript_eslint_utils_ts_eslint.RuleModule<"invalid", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
63
58
|
readonly filename: _typescript_eslint_utils_ts_eslint.RuleModule<MessageID, readonly [("PascalCase" | "camelCase" | "kebab-case" | "snake_case") | {
|
|
64
59
|
excepts?: readonly string[];
|
|
65
|
-
extensions?: readonly string[];
|
|
66
60
|
rule?: "PascalCase" | "camelCase" | "kebab-case" | "snake_case";
|
|
67
61
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
68
62
|
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("always" | "as-needed") | {
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ESLintUtils } from '@typescript-eslint/utils';
|
|
|
6
6
|
import { identity, isObject } from '@eslint-react/eff';
|
|
7
7
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
8
8
|
import { match, P } from 'ts-pattern';
|
|
9
|
-
import path from '
|
|
9
|
+
import path from 'path';
|
|
10
10
|
import { snakeCase, pascalCase, camelCase, kebabCase } from 'string-ts';
|
|
11
11
|
|
|
12
12
|
var __defProp = Object.defineProperty;
|
|
@@ -29,7 +29,7 @@ var rules = {
|
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
31
|
var name2 = "eslint-plugin-react-naming-convention";
|
|
32
|
-
var version = "2.0.0-next.
|
|
32
|
+
var version = "2.0.0-next.50";
|
|
33
33
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("naming-convention"));
|
|
34
34
|
|
|
35
35
|
// src/rules/component-name.ts
|
|
@@ -52,16 +52,6 @@ var schema = [
|
|
|
52
52
|
additionalProperties: false,
|
|
53
53
|
properties: {
|
|
54
54
|
allowAllCaps: { type: "boolean" },
|
|
55
|
-
/**
|
|
56
|
-
* @todo Remove in the next major version
|
|
57
|
-
* @deprecated
|
|
58
|
-
*/
|
|
59
|
-
allowLeadingUnderscore: { type: "boolean" },
|
|
60
|
-
/**
|
|
61
|
-
* @todo Remove in the next major version
|
|
62
|
-
* @deprecated
|
|
63
|
-
*/
|
|
64
|
-
allowNamespace: { type: "boolean" },
|
|
65
55
|
excepts: {
|
|
66
56
|
type: "array",
|
|
67
57
|
items: { type: "string", format: "regex" }
|
|
@@ -190,7 +180,6 @@ var RULE_NAME3 = "filename";
|
|
|
190
180
|
var defaultOptions2 = [
|
|
191
181
|
{
|
|
192
182
|
excepts: ["^index$"],
|
|
193
|
-
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
194
183
|
rule: "PascalCase"
|
|
195
184
|
}
|
|
196
185
|
];
|
|
@@ -243,9 +232,9 @@ var filename_default = createRule({
|
|
|
243
232
|
function create3(context) {
|
|
244
233
|
const options = context.options[0] ?? defaultOptions2[0];
|
|
245
234
|
const rule = typeof options === "string" ? options : options.rule ?? "PascalCase";
|
|
246
|
-
const excepts = typeof options === "string" ? [] : options.excepts ?? [];
|
|
235
|
+
const excepts = typeof options === "string" ? [] : (options.excepts ?? []).map((s) => RegExp.toRegExp(s));
|
|
247
236
|
function validate(name3, casing = rule, ignores = excepts) {
|
|
248
|
-
const shouldIgnore = ignores.
|
|
237
|
+
const shouldIgnore = ignores.some((pattern) => pattern.test(name3));
|
|
249
238
|
if (shouldIgnore) return true;
|
|
250
239
|
return match(casing).with("PascalCase", () => RegExp.PASCAL_CASE.test(name3)).with("camelCase", () => RegExp.CAMEL_CASE.test(name3)).with("kebab-case", () => RegExp.KEBAB_CASE.test(name3)).with("snake_case", () => RegExp.SNAKE_CASE.test(name3)).exhaustive();
|
|
251
240
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.50",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
"./package.json"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
39
|
-
"@typescript-eslint/type-utils": "^8.
|
|
40
|
-
"@typescript-eslint/types": "^8.
|
|
41
|
-
"@typescript-eslint/utils": "^8.
|
|
38
|
+
"@typescript-eslint/scope-manager": "^8.34.1",
|
|
39
|
+
"@typescript-eslint/type-utils": "^8.34.1",
|
|
40
|
+
"@typescript-eslint/types": "^8.34.1",
|
|
41
|
+
"@typescript-eslint/utils": "^8.34.1",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
|
-
"ts-pattern": "^5.7.
|
|
44
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
45
|
-
"@eslint-react/core": "2.0.0-next.
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
43
|
+
"ts-pattern": "^5.7.1",
|
|
44
|
+
"@eslint-react/ast": "2.0.0-next.50",
|
|
45
|
+
"@eslint-react/core": "2.0.0-next.50",
|
|
46
|
+
"@eslint-react/eff": "2.0.0-next.50",
|
|
47
|
+
"@eslint-react/kit": "2.0.0-next.50",
|
|
48
|
+
"@eslint-react/shared": "2.0.0-next.50",
|
|
49
|
+
"@eslint-react/var": "2.0.0-next.50"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/react": "^19.1.
|
|
53
|
-
"@types/react-dom": "^19.1.
|
|
54
|
-
"tsup": "^8.
|
|
52
|
+
"@types/react": "^19.1.8",
|
|
53
|
+
"@types/react-dom": "^19.1.6",
|
|
54
|
+
"tsup": "^8.5.0",
|
|
55
55
|
"@local/configs": "0.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"eslint": "^9.
|
|
58
|
+
"eslint": "^9.29.0",
|
|
59
59
|
"typescript": "^4.9.5 || ^5.4.5"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|