Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-i18next

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-i18next - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

14

CHANGELOG.md

@@ -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 @@

13

lib/rules/no-literal-string.js

@@ -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');

2

package.json
{
"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 },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc