Skip to content

Commit 4f3c2e3

Browse files
authored
pref: replace picomatch.makeRe with RE.toRegExp for pattern matching (#1055)
1 parent 4465d77 commit 4f3c2e3

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

packages/shared/docs/interfaces/CustomComponentNormalized.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,18 @@
2828

2929
### re
3030

31-
> **re**: [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp)
31+
> **re**: `object`
32+
33+
#### test()
34+
35+
> **test**(`s`): `boolean`
36+
37+
##### Parameters
38+
39+
###### s
40+
41+
`string`
42+
43+
##### Returns
44+
45+
`boolean`

packages/shared/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,14 @@
4646
"@eslint-react/kit": "workspace:*",
4747
"@typescript-eslint/utils": "^8.29.1",
4848
"@zod/mini": "^4.0.0-beta.0",
49-
"picomatch": "^4.0.2",
49+
"fast-equals": "^5.2.2",
50+
"micro-memoize": "^4.1.3",
5051
"ts-pattern": "^5.7.0"
5152
},
5253
"devDependencies": {
5354
"@local/configs": "workspace:*",
5455
"@tsconfig/node22": "^22.0.1",
5556
"@types/picomatch": "^4.0.0",
56-
"fast-equals": "^5.2.2",
57-
"micro-memoize": "^4.1.3",
5857
"tsup": "^8.4.0",
5958
"type-fest": "^4.39.1"
6059
},

packages/shared/src/settings.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { SharedConfigurationSettings } from "@typescript-eslint/utils/ts-es
33
import type { PartialDeep } from "type-fest";
44
import type { CustomHooks, ESLintReactSettings } from "./schemas";
55
import { identity } from "@eslint-react/eff";
6+
import { RE } from "@eslint-react/kit";
67
import * as z from "@zod/mini";
78
import { shallowEqual } from "fast-equals";
89
import memoize from "micro-memoize";
9-
import pm from "picomatch";
1010

1111
import { match, P } from "ts-pattern";
1212
import { getReactVersion } from "./get-react-version";
@@ -16,7 +16,7 @@ export interface CustomComponentNormalized {
1616
name: string;
1717
as: string;
1818
attributes: CustomComponentPropNormalized[];
19-
re: RegExp;
19+
re: { test(s: string): boolean };
2020
// selector?: string | _;
2121
}
2222

@@ -99,7 +99,7 @@ export const toNormalizedSettings = memoize(
9999
name,
100100
as,
101101
})),
102-
re: pm.makeRe(name, { fastpaths: true }),
102+
re: RE.toRegExp(name),
103103
})),
104104
additionalHooks,
105105
importSource,

pnpm-lock.yaml

Lines changed: 6 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)