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

no-unpublished-require mistakenly assumes readme.* is published even if in subdirectory #73

Closed
platinumazure opened this issue Mar 26, 2017 · 2 comments · Fixed by singapore/lint-condo#246

Comments

@platinumazure
Copy link
Contributor

platinumazure commented Mar 26, 2017

I'm trying to consume eslint-plugin-node in my eslint-plugin-qunit. Unfortunately, I'm getting a false positive in rule node/no-unpublished-require because it mistakenly assumes a tests/readme.js file is going to be published by npm, and thus I am getting warned for some devDependencies being imported by the file. In reality, that file is not published (it is not among the files in package.json and npm's exceptions only apply to the package's top-level directory).

I think this can be fixed here by doing one of the following:

  • Pass the full relative path (from the package root directory) to the NEVER_IGNORED regex
  • Adding a check that the file is in the package root before using the regex

I'm happy to submit a PR if needed; just please let me know which approach you prefer. Of course, I won't complain if you find time to fix this yourself 😄

Thanks for reading and thanks for such a kickass plugin!

EDIT: I wrote a PR using the first approach. Let me know if I should switch approaches.

@mysticatea
Copy link
Owner

Thank you for this report and PR!

I confirmed it.
I greatly appreciate.

@platinumazure
Copy link
Contributor Author

Thank you for merging my PR and cutting a release! Greatly appreciate the fast turnaround. 😄

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.

2 participants