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

Prevent the "import/no-duplicates" warning for the externalization process #1844

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

eason9487
Copy link
Member

Changes proposed in this Pull Request:

Quotes from @ecgan's #1834 (comment):

Three of the external-components files have eslint warnings that say "node_modules/@wordpress/components/build-module/index.js' imported multiple times. eslint import/no-duplicates", because we have imports from both @wordpress/components and extracted/@wordpress/components. See screenshot below:

image

This PR changes to use the "no-duplicate-imports" rule to prevent the warnings.

Screenshots:

It can still find the basic duplicated imports:

image

Detailed test instructions:

  1. npm run lint:js
  2. Check if there are no "import/no-duplicates" warnings.

Additional details:

"no-duplicate-imports" doesn't do the actual file path resolving, so something like import Foo from '. /foo' and import Foo from '. /foo.js' are not recognized as duplicates.

However, such rules are for code clearer purposes only, and these undetected duplicates should not cause errors.

Changelog entry

@eason9487 eason9487 requested a review from a team January 9, 2023 03:11
@eason9487 eason9487 self-assigned this Jan 9, 2023
@github-actions github-actions bot added the changelog: dev Developer-facing only change. label Jan 9, 2023
Base automatically changed from feature/extract-button-component to develop January 9, 2023 10:01
Copy link
Contributor

@puntope puntope left a comment

Choose a reason for hiding this comment

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

Thanks @eason9487

When I run the lint I cannot see anymore the warnings.

@eason9487 eason9487 merged commit e7ab691 into develop Jan 10, 2023
@eason9487 eason9487 deleted the dev/prevent-no-duplicates-warnings branch January 10, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: dev Developer-facing only change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants