eslint-plugin-i18next
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -6,4 +6,8 @@ const conventional = require('@commitlint/config-conventional'); | ||
rules: { | ||
'type-enum': [2, 'always', [...conventional.rules['type-enum'][2], 'dev']] | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[...conventional.rules['type-enum'][2], 'dev', 'deps'] | ||
] | ||
} | ||
}; |
{ | ||
"name": "eslint-plugin-i18next", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "ESLint plugin for i18n", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -46,12 +46,43 @@ # eslint-plugin-i18next | ||
Literay strings that are not constant string (all characters are `UPPERCASE`) are typically mistakes. For example: | ||
All literal strings in html template are typically mistakes. For JSX example: | ||
```HTML | ||
<div>foo</div> | ||
``` | ||
They should be translated by [i18next translation api](https://www.i18next.com/): | ||
```HTML | ||
<div>{i18next.t('foo')}</div> | ||
``` | ||
Same for [Vue template](https://vuejs.org/v2/guide/syntax.html): | ||
```vue | ||
<!-- incorrect --> | ||
<template> | ||
foo | ||
</template> | ||
<!-- correct --> | ||
<template> | ||
{{ i18next.t('foo') }} | ||
</template> | ||
``` | ||
For plain javascript, literal strings that are not constant string (all characters are `UPPERCASE`) are disallowed: | ||
```js | ||
// incorrect | ||
const foo = 'foo'; | ||
// correct | ||
const foo = i18next.t('foo'); | ||
``` | ||
They are frowned upon in favor of internationalization: | ||
It is all right to use `UPPERCASE` string in javascript: | ||
```js | ||
const foo = i18next.t('foo'); // wrapped by i18n translation function | ||
// correct | ||
const foo = 'FOO'; | ||
``` | ||
@@ -58,0 +89,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14837
9
249
180