@knighted/module 1.4.0-rc.1 → 1.4.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/format.cjs +3 -2
- package/dist/format.js +3 -2
- package/package.json +1 -1
package/dist/cjs/format.cjs
CHANGED
|
@@ -232,8 +232,9 @@ const dualPackageHazardDiagnostics = async params => {
|
|
|
232
232
|
const origin = usage.imports[0] ?? usage.requires[0];
|
|
233
233
|
const diagFile = origin?.filePath ?? filePath;
|
|
234
234
|
if (hasImport && hasRequire) {
|
|
235
|
-
const
|
|
236
|
-
const
|
|
235
|
+
const uniq = items => [...new Set(items)];
|
|
236
|
+
const importSpecs = uniq(usage.imports.map(u => u.subpath ? `${pkg}/${u.subpath}` : pkg));
|
|
237
|
+
const requireSpecs = uniq(usage.requires.map(u => u.subpath ? `${pkg}/${u.subpath}` : pkg));
|
|
237
238
|
diags.push({
|
|
238
239
|
level: hazardLevel,
|
|
239
240
|
code: 'dual-package-mixed-specifiers',
|
package/dist/format.js
CHANGED
|
@@ -224,8 +224,9 @@ const dualPackageHazardDiagnostics = async params => {
|
|
|
224
224
|
const origin = usage.imports[0] ?? usage.requires[0];
|
|
225
225
|
const diagFile = origin?.filePath ?? filePath;
|
|
226
226
|
if (hasImport && hasRequire) {
|
|
227
|
-
const
|
|
228
|
-
const
|
|
227
|
+
const uniq = items => [...new Set(items)];
|
|
228
|
+
const importSpecs = uniq(usage.imports.map(u => u.subpath ? `${pkg}/${u.subpath}` : pkg));
|
|
229
|
+
const requireSpecs = uniq(usage.requires.map(u => u.subpath ? `${pkg}/${u.subpath}` : pkg));
|
|
229
230
|
diags.push({
|
|
230
231
|
level: hazardLevel,
|
|
231
232
|
code: 'dual-package-mixed-specifiers',
|