File tree Expand file tree Collapse file tree 5 files changed +932
-1255
lines changed Expand file tree Collapse file tree 5 files changed +932
-1255
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " eslint-import-resolver-typescript " : patch
3+ ---
4+
5+ refactor: use non-capturing groups for perf
Original file line number Diff line number Diff line change 1111 "license" : " ISC" ,
1212 "packageManager" : " yarn@1.22.19" ,
1313 "engines" : {
14- "node" : " ^12.20 || ^14.18.0 || >=16.0.0"
14+ "node" : " ^12.20.0 || ^14.18.0 || >=16.0.0"
1515 },
1616 "main" : " lib/index.cjs" ,
1717 "module" : " lib/index.js" ,
7171 "synckit" : " ^0.7.1"
7272 },
7373 "devDependencies" : {
74- "@1stg/lib-config" : " ^7.1 .0" ,
74+ "@1stg/lib-config" : " ^7.2 .0" ,
7575 "@changesets/changelog-github" : " ^0.4.5" ,
7676 "@changesets/cli" : " ^2.23.0" ,
7777 "@mozilla/glean" : " ^1.0.0" ,
8383 "@types/unist" : " ^2.0.6" ,
8484 "dummy.js" : " link:dummy.js" ,
8585 "react" : " ^18.2.0" ,
86- "standard-version" : " ^9.5.0" ,
8786 "type-coverage" : " ^2.21.2" ,
8887 "typescript" : " ^4.7.4"
8988 },
Original file line number Diff line number Diff line change 11{
2- "extends": "@1stg",
3- "rules": {
4- "regexp/no-unused-capturing-group": "off"
5- }
2+ "extends": "@1stg"
63}
Original file line number Diff line number Diff line change @@ -231,14 +231,14 @@ function removeQuerystring(id: string) {
231231 return id
232232}
233233
234+ const JS_EXT_PATTERN = / \. (?: [ c m ] j s | j s x ? ) $ /
235+ const RELATIVE_PATH_PATTERN = / ^ \. { 1 , 2 } (?: \/ .* ) ? $ /
236+
234237/** Remove .js or .jsx extension from module id. */
235238function removeJsExtension ( id : string ) {
236- return id . replace ( / \. ( [ c m ] j s | j s x ? ) $ / , '' )
239+ return id . replace ( JS_EXT_PATTERN , '' )
237240}
238241
239- const JS_EXT_PATTERN = / \. ( [ c m ] j s | j s x ? ) $ /
240- const RELATIVE_PATH_PATTERN = / ^ \. { 1 , 2 } ( \/ .* ) ? $ /
241-
242242const isFile = ( path ?: string | undefined ) : path is string => {
243243 try {
244244 return ! ! path && fs . statSync ( path ) . isFile ( )
You can’t perform that action at this time.
0 commit comments