Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: lint issues
  • Loading branch information
MylesBorins committed Apr 17, 2020
commit c55afbaebb980400df546cf8a67bdf6d8a9ee2df
16 changes: 8 additions & 8 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@ E('ERR_INVALID_PACKAGE_CONFIG', (path, message, hasMessage = true) => {
}, Error);
E('ERR_INVALID_PACKAGE_TARGET',
(pkgPath, key, subpath, target, base = undefined) => {
const relError = typeof target === 'string'
&& target.length && !target.startsWith('./');
const relError = typeof target === 'string' &&
target.length && !target.startsWith('./');
if (key === null) {
if (subpath !== '') {
return `Invalid "exports" target ${JSONStringify(target)} defined ` +
Expand All @@ -1114,18 +1114,18 @@ E('ERR_INVALID_PACKAGE_TARGET',
} else {
return `Invalid "exports" main target ${target} defined in the ` +
`package config ${pkgPath} imported from ${base}.${relError ?
Comment thread
MylesBorins marked this conversation as resolved.
Outdated
' - targets must start with "./"' : ''}`;
' - targets must start with "./"' : ''}`;
Comment thread
MylesBorins marked this conversation as resolved.
Outdated
}
} else if (key === '.') {
return `Invalid "exports" main target ${JSONStringify(target)} defined ` +
`in the package config ${pkgPath}${sep}package.json${relError ?
Comment thread
guybedford marked this conversation as resolved.
' - targets must start with "./"' : ''}`;
' - targets must start with "./"' : ''}`;
Comment thread
MylesBorins marked this conversation as resolved.
Outdated
} else if (typeof target === 'string' && target !== '' &&
!target.startsWith('./')) {
Comment thread
MylesBorins marked this conversation as resolved.
Outdated
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
`package config ${pkgPath}${sep}package.json. ` +
'- targets must start with `./`';
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
`package config ${pkgPath}${sep}package.json. ` +
'- targets must start with `./`';
Comment thread
MylesBorins marked this conversation as resolved.
Outdated
} else {
return `Invalid "exports" target ${JSONStringify(target)} defined for '${
StringPrototypeSlice(key, 0, -subpath.length || key.length)}' in the ` +
Expand Down