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

demo getting require cycles working#2706

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
srsudar wants to merge1 commit intoimport-js:main
base:main
Choose a base branch
Loading
fromsrsudar:require-cycles

Conversation

srsudar
Copy link

This is a potential solution for the issue describedhere.

I haven't tested this extensively, but it finds require cycles in this project:

https://github.com/simonbuchan/eslint-import-cycle-example

It seems to have been going wrong in two places:

  1. theunambiguous() test, which is a regex I'm not really following
  2. it wasn't processing requires as imports (though it never got to this step thanks to 1).

@srsudar
Copy link
Author

x-posting my own comment with more details from the issue. This now detects cycles, like so, as well as how I got it working locally.

eslint-import-cycle-example [main*?] $ npm run lint> eslint-import-cycle@1.0.0 lint> eslint ./eslint-import-cycle-example/import-a.js  1:1  error  Dependency cycle detected  import/no-cycle/eslint-import-cycle-example/import-b.js  1:1  error  Dependency cycle detected  import/no-cycle/eslint-import-cycle-example/require-a.js  1:11  error  Dependency cycle detected  import/no-cycle/eslint-import-cycle-example/require-b.js  1:11  error  Dependency cycle detected  import/no-cycle✖ 4 problems (4 errors, 0 warnings)

And as an aside, for anybody else, I got this working pretty cleanly for local development via:

eslint-plugin-import $ npm run buildeslint-plugin-import $ npm linkeslint-import-cycle-example $ npm link eslint-plugin-importeslint-import-cycle-example $ npm run lint

@ljharbljharb marked this pull request as draftApril 13, 2023 21:31
@ljharb
Copy link
Member

This will need some test cases to be able to land.

@srsudar
Copy link
Author

If I fix this up, is it something you'd be interested in merging? It seems like this might break a lot of projects, if I'm correct thatrequire() cycles aren't being reported correctly as circular deps.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@srsudar@ljharb

[8]ページ先頭

©2009-2025 Movatter.jp