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

feat: add rule no-import-node-modules-by-path #219

Merged
merged 1 commit into from Aug 1, 2023

Conversation

zanminkian
Copy link
Contributor

Description

Prevent some codes like import xx from './node_modules/xxx'

Linked Issues

Additional context

@antfu
Copy link
Owner

antfu commented Jul 16, 2023

Emmm, under what circumstances would ppl do that? 👀

@zanminkian
Copy link
Contributor Author

zanminkian commented Jul 16, 2023

  • People who is new to JS.
  • Some npm packages have exports fields in package.json to restrict user to use private files. Some user will import the package by relative path. This behavior is dangerous and not recommended.
  • Some IDEs or editors automatically complete the importation in wrong way(rare but existing).

@antfu antfu merged commit cf1240c into antfu:main Aug 1, 2023
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.

None yet

2 participants