Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node/no-unpublished-require incorrectly thinks file is published #126

jaydenseric opened this issue Jul 5, 2018 · 1 comment


Copy link

commented Jul 5, 2018

In this situation…

├── package.json
├── test.js
└── lib
    └── test.js


  "files": [
  "devDependencies": {
    "tap": "*"

In ./test.js:

// Correctly no node/no-unpublished-require error.
const tap = require('tap')

In ./lib/test.js:

// Incorrectly has node/no-unpublished-require error!
const tap = require('tap')

The node/no-unpublished-require error rule incorrectly thinks that ./lib/test.js is published, causing the error. It does not seem to understand that negated globs apply recursively to files. !test.js prevents the file from being published in the nested files/folders; testable by running npm pack.


This comment has been minimized.

Copy link

commented Dec 26, 2018

I'm also hitting a similar issue, I think it's the same though.

I have a file in bin/foo.js. The files property lists this explicitly and there's no .npmignore file.

@mysticatea: any chance we could get this fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.