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

Bug: Selective n/no-unpublished-import disabling broke between 17.15.1 and 17.16.1 #421

Open
1 task
jswalden opened this issue Mar 11, 2025 · 0 comments · May be fixed by #423
Open
1 task

Bug: Selective n/no-unpublished-import disabling broke between 17.15.1 and 17.16.1 #421

jswalden opened this issue Mar 11, 2025 · 0 comments · May be fixed by #423
Labels

Comments

@jswalden
Copy link

jswalden commented Mar 11, 2025

Environment

Node version: v22.12.0
npm version: yarn 4.7.0
ESLint version: 9.22.0
eslint-plugin-n version: 17.16.1
Operating System: Linux

On commit jswalden/eslint-plugin-n-no-unpublished-bug@efa9c9d with "eslint-plugin-n": "17.15.1", you can run yarn install && yarn build && yarn lint and not get any n/no-unpublished-import errors in src/bar.test.ts or src/nested/foo.test.ts, despite that the rule is enabled (but selectively disabled for those files).

On the next commit jswalden/eslint-plugin-n-no-unpublished-bug@78b5f56 with "eslint-plugin-n": "17.16.1", you can run yarn install && yarn build && yarn lint and you will get:

jwalden@the-great-waldo-search:~/Code/eslint-plugin-n-no-unpublished-bug$ yarn install && yarn build && yarn lint
➤ YN0000: · Yarn 4.7.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Post-resolution validation
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 523ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 227ms
➤ YN0000: · Done with warnings in 1s 10ms

/home/jwalden/Code/eslint-plugin-n-no-unpublished-bug/src/bar.test.ts
  1:40  error  "@jest/globals" is not published  n/no-unpublished-import

/home/jwalden/Code/eslint-plugin-n-no-unpublished-bug/src/nested/foo.test.ts
  1:40  error  "@jest/globals" is not published  n/no-unpublished-import

✖ 2 problems (2 errors, 0 warnings)


despite that the enabled rule was selectively disabled for these two files.

(The problem is not fixed in 17.16.2.)

What rule do you want to report?

n/no-unpublished-import

Link to Minimal Reproducible Example

https://github.com/jswalden/eslint-plugin-n-no-unpublished-bug

What did you expect to happen?

The same absence of n/no-unpublished-import error as in jswalden/eslint-plugin-n-no-unpublished-bug@efa9c9d using eslint-plugin-node 17.15.1.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

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

Successfully merging a pull request may close this issue.

1 participant