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
Rule Change: no-restricted-exports
to accept Regex patterns
#18360
Comments
Hi @chrisvltn, thanks for the issue. I think this is a good idea to add regex for @eslint/eslint-team, should we consider this? |
@Tanujkanti4441 great idea. A rule to allow only certain named exports would also fit well to solve the problem :) |
I don't feel strongly either way, but if we do make this change, I think we should match how regexes are defined in |
+1 in general to this request and keeping consistent with equivalent rules. Especially when there's already mirroring in the rule name: e.g. For specifically mirroring |
I don't see much similarity between these two rules, despite the similar names.
We could add an option |
I suppose that does go along with the existing Marking as accepted. @chrisvltn would you like to submit a pull request? |
Sure 👍 thanks for the quick discussion. I'll find some time soon to open a PR |
What rule do you want to change?
no-restricted-exports
What change do you want to make?
Generate more warnings
How do you think the change should be implemented?
Other
Example code
What does the rule currently do for this code?
The rule currently accepts only hardcoded strings as restrictions
What will the rule do after it's changed?
The rule will accept also regex patterns as name restrictions
Participation
Additional comments
Remix framework recommends not exporting anything other than their main route functions in route files, otherwise HMR won't work. Sadly, there is no way to enforce that with ESLint currently.
The text was updated successfully, but these errors were encountered: