@eslint-react/kit 1.38.0-next.9 → 1.38.1-next.0

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 CHANGED
@@ -62,4 +62,22 @@ declare function createReport<MessageID extends string>(context: RuleContext): (
62
62
  declare function isInEditorEnv(): boolean;
63
63
  declare function isInGitHooksOrLintStaged(): boolean;
64
64
 
65
- export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isInEditorEnv, isInGitHooksOrLintStaged };
65
+ /**
66
+ * Convert a string to the `RegExp`.
67
+ * Normal strings (e.g. `"foo"`) is converted to `/^foo$/` of `RegExp`.
68
+ * Strings like `"/^foo/i"` are converted to `/^foo/i` of `RegExp`.
69
+ *
70
+ * @param string The string to convert.
71
+ * @returns Returns the `RegExp`.
72
+ */
73
+ declare function toRegExp(string: string): {
74
+ test(s: string): boolean;
75
+ };
76
+ /**
77
+ * Checks whether given string is regexp string
78
+ * @param string The string to check
79
+ * @returns boolean
80
+ */
81
+ declare function isRegExp(string: string): boolean;
82
+
83
+ export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isInEditorEnv, isInGitHooksOrLintStaged, isRegExp, toRegExp };
package/dist/index.d.ts CHANGED
@@ -62,4 +62,22 @@ declare function createReport<MessageID extends string>(context: RuleContext): (
62
62
  declare function isInEditorEnv(): boolean;
63
63
  declare function isInGitHooksOrLintStaged(): boolean;
64
64
 
65
- export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isInEditorEnv, isInGitHooksOrLintStaged };
65
+ /**
66
+ * Convert a string to the `RegExp`.
67
+ * Normal strings (e.g. `"foo"`) is converted to `/^foo$/` of `RegExp`.
68
+ * Strings like `"/^foo/i"` are converted to `/^foo/i` of `RegExp`.
69
+ *
70
+ * @param string The string to convert.
71
+ * @returns Returns the `RegExp`.
72
+ */
73
+ declare function toRegExp(string: string): {
74
+ test(s: string): boolean;
75
+ };
76
+ /**
77
+ * Checks whether given string is regexp string
78
+ * @param string The string to check
79
+ * @returns boolean
80
+ */
81
+ declare function isRegExp(string: string): boolean;
82
+
83
+ export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, createReport, isInEditorEnv, isInGitHooksOrLintStaged, isRegExp, toRegExp };
package/dist/index.js CHANGED
@@ -50,6 +50,17 @@ function isInGitHooksOrLintStaged() {
50
50
  return !!(process.env["GIT_PARAMS"] || process.env["VSCODE_GIT_COMMAND"] || process.env["npm_lifecycle_script"]?.startsWith("lint-staged"));
51
51
  }
52
52
 
53
+ // src/regexp.ts
54
+ var RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
55
+ function toRegExp(string) {
56
+ const [, pattern, flags = "u"] = RE_REGEXP_STR.exec(string) ?? [];
57
+ if (pattern) return new RegExp(pattern, flags);
58
+ return { test: (s) => s === string };
59
+ }
60
+ function isRegExp(string) {
61
+ return Boolean(RE_REGEXP_STR.test(string));
62
+ }
63
+
53
64
  exports.REACT_BUILD_IN_HOOKS = REACT_BUILD_IN_HOOKS;
54
65
  exports.RE_CAMEL_CASE = RE_CAMEL_CASE;
55
66
  exports.RE_CONSTANT_CASE = RE_CONSTANT_CASE;
@@ -60,3 +71,5 @@ exports.RE_SNAKE_CASE = RE_SNAKE_CASE;
60
71
  exports.createReport = createReport;
61
72
  exports.isInEditorEnv = isInEditorEnv;
62
73
  exports.isInGitHooksOrLintStaged = isInGitHooksOrLintStaged;
74
+ exports.isRegExp = isRegExp;
75
+ exports.toRegExp = toRegExp;
package/dist/index.mjs CHANGED
@@ -48,4 +48,15 @@ function isInGitHooksOrLintStaged() {
48
48
  return !!(process.env["GIT_PARAMS"] || process.env["VSCODE_GIT_COMMAND"] || process.env["npm_lifecycle_script"]?.startsWith("lint-staged"));
49
49
  }
50
50
 
51
- export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, createReport, isInEditorEnv, isInGitHooksOrLintStaged };
51
+ // src/regexp.ts
52
+ var RE_REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
53
+ function toRegExp(string) {
54
+ const [, pattern, flags = "u"] = RE_REGEXP_STR.exec(string) ?? [];
55
+ if (pattern) return new RegExp(pattern, flags);
56
+ return { test: (s) => s === string };
57
+ }
58
+ function isRegExp(string) {
59
+ return Boolean(RE_REGEXP_STR.test(string));
60
+ }
61
+
62
+ export { REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, createReport, isInEditorEnv, isInGitHooksOrLintStaged, isRegExp, toRegExp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/kit",
3
- "version": "1.38.0-next.9",
3
+ "version": "1.38.1-next.0",
4
4
  "description": "ESLint React's Plugin Kit for building plugins and rules.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -35,8 +35,9 @@
35
35
  "./package.json"
36
36
  ],
37
37
  "dependencies": {
38
+ "@typescript-eslint/utils": "^8.28.0",
38
39
  "ts-pattern": "^5.6.2",
39
- "@eslint-react/eff": "1.38.0-next.9"
40
+ "@eslint-react/eff": "1.38.1-next.0"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@tsconfig/node22": "^22.0.1",
@@ -44,9 +45,6 @@
44
45
  "type-fest": "^4.38.0",
45
46
  "@local/configs": "0.0.0"
46
47
  },
47
- "peerDependencies": {
48
- "@typescript-eslint/utils": "^8.27.0"
49
- },
50
48
  "engines": {
51
49
  "bun": ">=1.0.15",
52
50
  "node": ">=18.18.0"