Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature: no duplicates require#2931

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Pandemic1617 wants to merge4 commits intoimport-js:main
base:main
Choose a base branch
Loading
fromPandemic1617:feature/no_duplicates_require

Conversation

Pandemic1617
Copy link
Contributor

implements detection of duplicaterequire imports

resolves#2925

Note that auto fix isn't implemented

Copy link
Member

@ljharbljharb left a comment

Choose a reason for hiding this comment

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

Can we add some tests with a function that's called "require" but isn't the global one?

@ljharbljharb marked this pull request as draftDecember 1, 2023 16:51
@Pandemic1617
Copy link
ContributorAuthor

Can we add some tests with a function that's called "require" but isn't the global one?

constrequire=(x)=>{};consta=require("./a.js");

This require would be detected as the global require even though it isn't.

This is indeed a limitation of my implementation but I thought it would be acceptable since the following rules also have the same limitation:

  • no-dynamic-require
  • no-amd
  • max-dependencies
  • no-self-import
  • no-relative-packages

@ljharb
Copy link
Member

Hmm - are there no rules thatdont have the limitation?

@Pandemic1617
Copy link
ContributorAuthor

I am not aware of any and even themoduleVisitor util has that limitation

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

@ljharbljharbljharb requested changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Disallow duplicate require
2 participants
@Pandemic1617@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp