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

fix: do not allow importing dev deps from lib/bin #67

Merged
merged 2 commits into from
May 9, 2023

Conversation

tjenkinson
Copy link
Contributor

References

Refs npm/template-oss#316
Needed by npm/node-semver#559

@tjenkinson tjenkinson marked this pull request as ready for review May 6, 2023 19:19
@tjenkinson tjenkinson requested a review from a team as a code owner May 6, 2023 19:19
@wraithgar
Copy link
Member

Now we're talking. Tested this in a local branch

$ npm run lint

> ssri@10.0.2 lint
> eslint "**/*.js"


/Users/wraithgar/Development/npm/ssri/branches/main/lib/index.js
  3:13  error  'tap' should be listed in the project's dependencies, not devDependencies  import/no-extraneous-dependencies

✖ 1 problem (1 error, 0 warnings)

@wraithgar
Copy link
Member

Gonna give @lukekarrys a few days to weigh in since he's done more work on these rules than I have.

@lukekarrys
Copy link
Contributor

This is great, thank you @tjenkinson!

@wraithgar wraithgar merged commit 653976f into npm:main May 9, 2023
@wraithgar
Copy link
Member

Need to do some housekeeping on this repo before we can publish.

The irony is we'll have to work around this rule in node-semver since it has an exception to having its code in ./lib.

This was still the right choice because we really want to centrally manage this opinion across our 80+ repos, not just piecemeal it.

@github-actions github-actions bot mentioned this pull request May 9, 2023
@tjenkinson
Copy link
Contributor Author

The irony is we'll have to work around this rule in node-semver since it has an exception to having its code in ./lib.

Is there a reason it’s an exception? If not wondering if it could be updated to move things into a lib dir, instead of having a custom config?

@tjenkinson
Copy link
Contributor Author

Ah nevermind I see the readme advertises importing directly from the other dirs

@wraithgar
Copy link
Member

we opted not to change node-semver cause it was deemed a disruptive semver major change.

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