@devdiary/eslint-plugin-i18n
v1.1.0
Published
Detect and autofix strings which require externalization in Vanilla JS files.
Downloads
4
Maintainers
Readme
eslint-plugin-i18n
Detect and autofix strings which require externalization in Vanilla JS files.
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install @devdiary/eslint-plugin-i18n
:
$ npm install @devdiary/eslint-plugin-i18n --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install @devdiary/eslint-plugin-i18n
globally.
Usage
Add @devdiary/eslint-plugin-i18n
to the plugins section of your .eslintrc
configuration file. You can omit the @devdiary/eslint-plugin-
prefix:
JSON:
{
"plugins": ["@devdiary/i18n"]
}
YAML:
plugins:
- @devdiary/i18n
Then configure the rules you want to use under the rules section.
JSON:
{
"rules": {
"@devdiary/i18n/no-non-i18n-strings": "error"
}
}
YAML:
rules:
"@devdiary/i18n/no-non-i18n-strings": error
VueJS (.vue files)
@devdiary/eslint-plugin-i18n
can also detect strings requiring externalization for code within the <script></script>
tags of a .vue file.
Editor support
- Visual studio Code + Vetur: add
.vue
to your linting configuration - Atom + linter-eslint: add
text.html.vue
to your list of scopes
Supported Rules
Contribution guidelines
Please refer to devdiary-ce's CONTRIBUTING.md for details on our guidelines.