File tree 5 files changed +932
-1255
lines changed
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 11
11
"license" : " ISC" ,
12
12
"packageManager" :
" [email protected] " ,
13
13
"engines" : {
14
- "node" : " ^12.20 || ^14.18.0 || >=16.0.0"
14
+ "node" : " ^12.20.0 || ^14.18.0 || >=16.0.0"
15
15
},
16
16
"main" : " lib/index.cjs" ,
17
17
"module" : " lib/index.js" ,
71
71
"synckit" : " ^0.7.1"
72
72
},
73
73
"devDependencies" : {
74
- "@1stg/lib-config" : " ^7.1 .0" ,
74
+ "@1stg/lib-config" : " ^7.2 .0" ,
75
75
"@changesets/changelog-github" : " ^0.4.5" ,
76
76
"@changesets/cli" : " ^2.23.0" ,
77
77
"@mozilla/glean" : " ^1.0.0" ,
83
83
"@types/unist" : " ^2.0.6" ,
84
84
"dummy.js" : " link:dummy.js" ,
85
85
"react" : " ^18.2.0" ,
86
- "standard-version" : " ^9.5.0" ,
87
86
"type-coverage" : " ^2.21.2" ,
88
87
"typescript" : " ^4.7.4"
89
88
},
Original file line number Diff line number Diff line change 1
1
{
2
- "extends": "@1stg",
3
- "rules": {
4
- "regexp/no-unused-capturing-group": "off"
5
- }
2
+ "extends": "@1stg"
6
3
}
Original file line number Diff line number Diff line change @@ -231,14 +231,14 @@ function removeQuerystring(id: string) {
231
231
return id
232
232
}
233
233
234
+ const JS_EXT_PATTERN = / \. (?: [ c m ] j s | j s x ? ) $ /
235
+ const RELATIVE_PATH_PATTERN = / ^ \. { 1 , 2 } (?: \/ .* ) ? $ /
236
+
234
237
/** Remove .js or .jsx extension from module id. */
235
238
function removeJsExtension ( id : string ) {
236
- return id . replace ( / \. ( [ c m ] j s | j s x ? ) $ / , '' )
239
+ return id . replace ( JS_EXT_PATTERN , '' )
237
240
}
238
241
239
- const JS_EXT_PATTERN = / \. ( [ c m ] j s | j s x ? ) $ /
240
- const RELATIVE_PATH_PATTERN = / ^ \. { 1 , 2 } ( \/ .* ) ? $ /
241
-
242
242
const isFile = ( path ?: string | undefined ) : path is string => {
243
243
try {
244
244
return ! ! path && fs . statSync ( path ) . isFile ( )
You can’t perform that action at this time.
0 commit comments