Skip to content

Latest commit

 

History

History
109 lines (77 loc) · 1.97 KB

README.md

File metadata and controls

109 lines (77 loc) · 1.97 KB

eslint-plugin-simple-i18n-text Build Status

ESLint plugin for simple-i18n-text.

Install

Install with npm:

npm install eslint-plugin-simple-i18n-text

Usage

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": 
  }
}

Rules

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>

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu