some rules for babel-plugin-react-directives.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-react-directives:
$ npm install eslint-plugin-react-directives --save-dev
Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-react-directives globally.
There are two ways to configure it via .eslintrc:
{
"plugins": [
"react-directives"
],
"rules": {
"no-undef": "off",
"react-directives/no-undef": "error"
}
}or use the recommended rules:
{
"extends": [
"plugin:react-directives/recommended"
],
"rules": {
"no-undef": "off"
}
}If you have configured some options in babel-plugin-react-directives, add settings section to .eslintrc file.
{
"settings": {
"react-directives": {
"prefix": "x"
}
}
}- react-directives/no-undef Disallow Undeclared Variables.
This plugin exports a recommended configuration.
To enable this configuration use the extends property in your .eslintrc config file:
{
"extends": [
"plugin:react-directives/recommended"
]
}The rules enabled in this configuration are: