eslint-plugin-i18next
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -5,2 +5,16 @@ # Changelog | ||
## [2.2.0](https://github.com/edvardchen/eslint-plugin-i18next/compare/v2.1.1...v2.2.0) (2019-07-24) | ||
### Bug Fixes | ||
* enhance ExportNamedDeclaration ([29e9f29](https://github.com/edvardchen/eslint-plugin-i18next/commit/29e9f29)) | ||
### Features | ||
* allow string comparison ([a78d150](https://github.com/edvardchen/eslint-plugin-i18next/commit/a78d150)) | ||
### [2.1.1](https://github.com/edvardchen/eslint-plugin-i18next/compare/v2.1.0...v2.1.1) (2019-07-24) | ||
@@ -7,0 +21,0 @@ |
@@ -123,3 +123,3 @@ /** | ||
'ExportNamedDeclaration Literal'(node) { | ||
'ExportNamedDeclaration > Literal'(node) { | ||
// allow export { named } from 'mod' | ||
@@ -185,2 +185,13 @@ visited.add(node); | ||
'BinaryExpression > Literal'(node) { | ||
const { | ||
parent: { operator } | ||
} = node; | ||
// allow name === 'Android' | ||
if (operator !== '+') { | ||
visited.add(node); | ||
} | ||
}, | ||
'CallExpression Literal'(node) { | ||
@@ -187,0 +198,0 @@ const parent = getNearestAncestor(node, 'CallExpression'); |
{ | ||
"name": "eslint-plugin-i18next", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "ESLint plugin for i18n", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -180,2 +180,11 @@ # eslint-plugin-i18next | ||
#### Comparison | ||
String comparison is fine. | ||
```typescript | ||
// correct | ||
name === 'Android' || name === 'iOS'; | ||
``` | ||
### Options | ||
@@ -182,0 +191,0 @@ |
@@ -33,2 +33,3 @@ /** | ||
{ code: 'import("hello")' }, | ||
{ code: "name === 'Android' || name === 'iOS'" }, | ||
{ code: 'import name from "hello";' }, | ||
@@ -61,2 +62,4 @@ { code: 'export * from "hello_export_all";' }, | ||
invalid: [ | ||
{ code: 'a + "b"', errors }, | ||
{ code: 'export const a = "hello_string";', errors }, | ||
{ code: 'const a = "foo";', errors }, | ||
@@ -63,0 +66,0 @@ { code: 'const a = call("Ffo");', errors }, |
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
29403
465
214