Running rules multiple times with different options #14688
Unanswered
thomasparsons
asked this question in
General
Replies: 2 comments 5 replies
-
This isn’t possible. Each rule can have exactly one configuration. |
Beta Was this translation helpful? Give feedback.
4 replies
-
One workaround is to make a plugin that re-exports rules from another plugin (or plugins), and that plugin could export the same rule multiple times under different names. An example of a plugin that exports rules from other plugins: https://github.com/mysticatea/eslint-plugin |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been looking for this and struggled to find an answer
I imagine the answer right now is no, as I assume it's mighty complicated, but I do have a business case for needing to run the same rule multiple times with different options
We currently use
react/forbid-elements
to stop engineers from using HTML elements that we have internal components for, like so:What I need to be able to do is add this rule again like so:
as some should error and some should warn
How could I go about doing this?
Beta Was this translation helpful? Give feedback.
All reactions