馃摑 Disallow bin files that npm ignores.
Users can safely disable this rule if using npm v10 and later.
We can publish CLI commands by npm. It uses bin field of package.json.
{
"name": "command-name",
"bin": "bin/index.js"
}At this time, if npm ignores the file, your package will fail to install.
If npm ignores the files in bin field, this rule warns the files.
- If
filesfield does not includes the files inbinfield. - If
.npmignorefile includes the files inbinfield.
{
"rules": {
"n/no-unpublished-bin": [
"error",
{
"convertPath": null
}
]
}
}This can be configured in the rule options or as a shared setting settings.convertPath. Please see the shared settings documentation for more information.