Socket
Socket
Sign inDemoInstall

publint

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

publint - npm Package Compare versions

Comparing version 0.2.5 to 0.2.6

1

index.d.ts

@@ -109,2 +109,3 @@ export type MessageType = 'suggestion' | 'warning' | 'error'

>
| BaseMessage<'DEPRECATED_FIELD_JSNEXT'>

@@ -111,0 +112,0 @@ export interface Options {

2

package.json
{
"name": "publint",
"version": "0.2.5",
"version": "0.2.6",
"description": "Lint packaging errors",

@@ -5,0 +5,0 @@ "type": "module",

@@ -212,4 +212,4 @@ import {

}
for (const field of knownFields) {
const [fieldValue, fieldPkgPath] = getPublishedField(rootPkg, field)
for (const fieldName of knownFields) {
const [fieldValue, fieldPkgPath] = getPublishedField(rootPkg, fieldName)
if (

@@ -221,3 +221,18 @@ fieldValue != null &&

const fieldPath = vfs.pathJoin(pkgDir, fieldValue)
await readFile(fieldPath, fieldPkgPath, ['.js', '/index.js'])
const hasContent =
(await readFile(fieldPath, fieldPkgPath, ['.js', '/index.js'])) !==
false
if (
hasContent &&
(fieldName === 'jsnext:main' || fieldName === 'jsnext')
) {
messages.push({
code: 'DEPRECATED_FIELD_JSNEXT',
args: {},
path: fieldPkgPath,
// `module` should be used instead, but if it's already specified, downgrade as a suggestion
// as the jsnext fields are likely for compat only.
type: module ? 'suggestion' : 'warning'
})
}
})

@@ -224,0 +239,0 @@ }

@@ -150,2 +150,5 @@ import c from 'picocolors'

return `${c.bold(fp(m.path))} is ${c.bold(pv(m.path))} which also matches ${c.bold(fp(m.args.browserPath))}: "${c.bold(pv(m.args.browserPath))}", which overrides the path when building the library with the "${c.bold(m.args.browserishCondition)}" condition. This is usually unintentional and may cause build issues. Consider using a different file name for ${c.bold(pv(m.path))}.`
case 'DEPRECATED_FIELD_JSNEXT':
// prettier-ignore
return `${c.bold(fp(m.path))} is deprecated. ${c.bold('pkg.module')} should be used instead.`
default:

@@ -152,0 +155,0 @@ return

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc