Eslint plugin for detecting and printing hardcoded text in React JSX templates. Based on https://github.com/yannickcr/eslint-plugin-react jsx-no-literals rule
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-react-printhardcodedtext
:
$ npm install https://github.com/jlgonzalezdev/eslint-plugin-react-printHardcodedText.git --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-react-printhardcodedtext
globally.
Add react-printhardcodedtext
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"react-printhardcodedtext"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"react-printhardcodedtext/rule-name": 2
}
}
no-hardcoded-text