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

Closed
jaydenseric opened this issue Jul 5, 2018 · 2 comments
Closed

Comments

@jaydenseric
Copy link

In this situation…

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

package.json:

{
  "files": [
    "lib",
    "!test.js"
  ],
  "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.

@XhmikosR
Copy link

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.

https://travis-ci.org/css/csso-cli/jobs/472377577#L465

@mysticatea: any chance we could get this fixed?

@pke
Copy link

pke commented Oct 31, 2019

Even with the fix I am still getting this error when requiring the most recent "tap" version "tap": "14.8.2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants