ESLint plugin for simple-i18n-text.
Install with npm:
npm install eslint-plugin-simple-i18n-text
Need to enable "jsx" to ESLint option
{
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
}
}
Add "simple-i18n-text" to your .eslintrc
{
"plugins": [
"simple-i18n-text"
],
"rules":{
"simple-i18n-text/require-translation-ja":
}
}
Disallow to string literal in JSXElement.
NG:
// NG
<p>NG</p>
OK:
<p>{"OK"}</p>
<p>{t("OK")}</p>
<p>{pt("OK")}</p>
日本語のみを対象にした no-raw-value
のルール。
Check raw string literal in JSXElement, but allow non-japanese characters.
NG:
// NG
<p>日本語はダメ</p>
OK:
<p>OK</p>
<p>123</p>
<p>!?</p>
<p>▼</p>
<p>{"OK"}</p>
<p>{t("OK")}</p>
<p>{pt("OK")}</p>
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu