Reputation: 8962
I would like to know how is it possible to create a custom rule, where I can define fobidden html elements in jsx syntax.
For example, I want to be sure that only <Button />
and <Input />
compontents from my ui library are used. If <input>
or <button>
html elements are used in jsx
, eslint should throw an error.
Upvotes: 1
Views: 1519
Reputation: 1988
If you want to create an ESLint rule by yourself (e.g. to learn something new) then this won't be helpful and it's certainly out of scope for a StackOverflow question, but if you need it for practical reasons, there is already a rule that does exactly what you want.
Upvotes: 3