+1
-1
| { | ||
| "name": "publint", | ||
| "version": "0.3.14", | ||
| "version": "0.3.15", | ||
| "description": "Lint packaging errors", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+18
-10
@@ -812,10 +812,12 @@ import { | ||
| if (isGlob && !exportsFiles.length) { | ||
| messages.push({ | ||
| code: isImports | ||
| ? 'IMPORTS_GLOB_NO_MATCHED_FILES' | ||
| : 'EXPORTS_GLOB_NO_MATCHED_FILES', | ||
| args: {}, | ||
| path: currentPath, | ||
| type: 'warning', | ||
| }) | ||
| if (!isImports) { | ||
| messages.push({ | ||
| code: 'EXPORTS_GLOB_NO_MATCHED_FILES', | ||
| args: {}, | ||
| path: currentPath, | ||
| type: 'warning', | ||
| }) | ||
| } | ||
| // NOTE: We do not report `IMPORTS_GLOB_NO_MATCHED_FILES` as it's possible | ||
| // for libraries to not use this subpath import if e.g. it was bundled. | ||
| return | ||
@@ -866,3 +868,6 @@ } | ||
| if (isAbsolutePath(filePath) && !isFilePathRawTs(filePath)) { | ||
| pq.push(async () => await readFile(filePath, currentPath)) | ||
| // If crawling subpath imports, files may be bundled so it doesn't exist anymore, | ||
| // so we pass `undefined` to prevent error reporting. | ||
| const readFilePkgPath = isImports ? undefined : currentPath | ||
| pq.push(async () => await readFile(filePath, readFilePkgPath)) | ||
| } | ||
@@ -872,4 +877,7 @@ continue | ||
| pq.push(async () => { | ||
| // If crawling subpath imports, files may be bundled so it doesn't exist anymore, | ||
| // so we pass `undefined` to prevent error reporting. | ||
| const readFilePkgPath = isImports ? undefined : currentPath | ||
| // could fail if in !isGlob | ||
| const fileContent = await readFile(filePath, currentPath) | ||
| const fileContent = await readFile(filePath, readFilePkgPath) | ||
| if (fileContent === false) return | ||
@@ -876,0 +884,0 @@ if (!isFileContentLintable(fileContent)) return |
@@ -41,3 +41,4 @@ import { lintableFileExtensions } from './constants.js' | ||
| /exports\.__esModule\s*=\s*true|Object\.defineProperty\s*\(\s*exports\s*,\s*["']__esModule["']\s*,\s*\{\s*value\s*:\s*true\s*\}/ | ||
| const EXPORTS_DEFAULT_PATTERN_RE = /exports\.default\s*=\s*([^\s]{7}.)/g | ||
| const EXPORTS_DEFAULT_PATTERN_RE = | ||
| /exports(?:\.default|\["default"\]|\['default'\])\s*=\s*([^\s]{7}.)/g | ||
| /** | ||
@@ -44,0 +45,0 @@ * @param {string} code |
108129
0.61%2872
0.31%