[no-named-as-default] Add ignorePaths option #3131
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding Ignore Paths Option to
no-named-as-default
RuleSummary
This PR introduces an
ignorePaths
option to theno-named-as-default
ESLint rule.The purpose of this enhancement is to provide flexibility in cases where certain packages, like
styled-components
, require importing a named export as a default export. These imports are valid but may be incorrectly flagged by the current rule.Use Case
For example, the following import is valid in the context of
styled-components
, but it may be flagged by theno-named-as-default
rule:With the new ignorePaths option, you can specify patterns to exclude such packages or paths from this rule's validation.
Changes
Added ignorePaths configuration to the no-named-as-default rule.
Updated rule documentation to reflect the new option and its usage.
Configuration Example
To use this new option, include it in your ESLint configuration file: