Skip to content

Conversation

@Windvis
Copy link

@Windvis Windvis commented Oct 18, 2022

Private packages are never published so the no-unpublished-import and no-unpublished-require rules don't need to run.

More information: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private

This fixes the original issue from the eslint-plugin-node repo: mysticatea#77

It seems a lot of tests fail because their test fixture setups contain package.json files with private: true set. I think that is just an issue with those textures and private: true should be removed there? I removed "private": true where needed.

Copy link

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@aladdin-add
Copy link

can you update the failing tests to match the new behaviour?

@Windvis
Copy link
Author

Windvis commented Oct 27, 2022

Yup, will do ASAP!

Private packages are never published so the `no-unpublished-import` and `no-unpublished-require` rules don't need to run.

This also removes `"private": true` from most fixtures that would fail due to the rules no longer running.

More information about private packages: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private
@Windvis Windvis force-pushed the fix/disable-no-unpublished-rules-in-private-packages branch from e21f938 to 7670a10 Compare October 27, 2022 10:24
@aladdin-add aladdin-add changed the title Disable the no-unpublished-x rules in private packages feat: Disable the no-unpublished-x rules in private packages Oct 27, 2022
@aladdin-add aladdin-add requested a review from a team October 27, 2022 10:53
@aladdin-add aladdin-add merged commit 5ccd0c5 into eslint-community:master Oct 31, 2022
@Windvis Windvis deleted the fix/disable-no-unpublished-rules-in-private-packages branch October 31, 2022 08:48
@IchordeDionysos
Copy link

Feedback on this change:
Not all projects are packages in a typical sense, and some projects are services deployed to a server or built as a website.

For those projects, you may want to set "private": true to prevent it from being published on NPM (as it's also described on the referenced link https://docs.npmjs.com/cli/v8/configuring-npm/package-json#private).

And I'd challenge that all use-cases that are "private packages" don't need to care about this rule being in effect. I'd even argue that the majority of cases should clearly separate dependencies (used in the project's source code) and devDependencies (used in tests and build tools).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants