ESLint plugin to avoid invalid HTML and svg elements
npm install eslint-plugin-react-html-svg-invalidYou'll first need to install ESLint:
```
$ npm i eslint --save-dev
Next, install npm i eslint-plugin-react-html-svg-invalid:
``
$ npm install eslint-plugin-html-svg-invalid --save-dev
Note: If you installed ESLint globally (using the -g flag) then you must also install npm i eslint-plugin-react-html-svg-invalid globally.
Add react-html-svg-invalid to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
`json`
{
"plugins": ["react-html-svg-invalid"]
}
Then configure the rules you want to use under the rules section.
`json`
{
"rules": {
"react-html-svg-invalid/html-svg-invalid": 2
}
}
You can change rule from 2 to 1 which is warning or you can disable with zero.
This rule aims to dissallow invalid html and svg elements in react app.
Examples for incorrect code for this rule:
`jsx`
class Component extends React.Component {
render() {
}
}
class Component extends React.Component {
render() {
}
}
class Component extends React.Component {
render() {
}
}
Examples for correct code for this rule:
`jsx``
class Component extends React.Component {
render() {
Hello world!!;
}
}
class Component extends React.Component {
render() {
Hello world!!
;
}
}
class Component extends React.Component {
render() {
}
}