This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
import-name rule should support regex pattern matching #853
Labels
Status: In Discussion
Please continue discussing the proposed change before sending a pull request.
Type: Rule Feature
Adding a feature to an existing rule.
Rule Suggestion
Is your rule for a general problem or is it specific to your development style?
I think it is only for my development style, but it could be useful for the general problem too.
What does your suggested rule do?
Currently,
import-name
only supports static name matching, such as:underscore
to_
, etc. But, I actually found that theimport-name
rule also supports regex matching while the documentation (README.md) doesn't tell it so.List several examples where your rule could be used
I have many container components with
(\w+)Container.tsx
pattern, such asRebookModalButtonContainer.tsx
, etc. I thought thatimport-name
rule could accept regex pattern, so I add the rule below.path/to/someFile.tsx
tslint.json
And the warning for import script above is gone away. But, this is my question for this issue.
import-name
rule officially support regex pattern for current version?Additional context
Currently, I only want to know if
import-name
rule supports regex pattern matching, which is very helpful for handling the same import-name pattern instead of manually register it one by one. If it doesn't support it, maybe I can help to fix this issue if possible. 😄The text was updated successfully, but these errors were encountered: