diff --git a/lib/find-plugins.js b/lib/find-plugins.js index 87b61de..baffd7a 100644 --- a/lib/find-plugins.js +++ b/lib/find-plugins.js @@ -161,7 +161,7 @@ function filterPath (path, filter) { return filter(path) } -const typescriptPattern = /\.(ts|mts|cts)$/iu +const typescriptPattern = /\.(?:ts|mts|cts)$/iu function getScriptType (fname, packageType) { return { language: typescriptPattern.test(fname) ? 'typescript' : 'javascript', @@ -169,8 +169,8 @@ function getScriptType (fname, packageType) { } } -const modulePattern = /\.(mjs|mts)$/iu -const commonjsPattern = /\.(cjs|cts)$/iu +const modulePattern = /\.(?:mjs|mts)$/iu +const commonjsPattern = /\.(?:cjs|cts)$/iu function determineModuleType (fname, defaultType) { if (modulePattern.test(fname)) { return 'module'