eslint-plugin-moka
Advanced tools
Comparing version
@@ -5,2 +5,6 @@ Changelog | ||
## 0.0.4 | ||
- Optimize rule "lingui-mark" | ||
## 0.0.3 | ||
@@ -7,0 +11,0 @@ |
@@ -72,2 +72,3 @@ module.exports = { | ||
case 'tooltip': | ||
case 'title': | ||
return true; | ||
@@ -93,2 +94,10 @@ default: | ||
const isEqualOperator = (node) => { | ||
if (!node) { | ||
return false; | ||
} | ||
return node.operator === '===' || node.operator === '=='; | ||
}; | ||
//---------------------------------------------------------------------- | ||
@@ -142,2 +151,8 @@ // Public | ||
if (node.parent.type === 'BinaryExpression' && isEqualOperator(node.parent)) { | ||
// if (status === '你好') | ||
// 这种是不需要翻译的 | ||
return true; | ||
} | ||
context.report({ | ||
@@ -144,0 +159,0 @@ node, |
{ | ||
"name": "eslint-plugin-moka", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Eslint Plugin of Moka", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -71,2 +71,5 @@ 'use strict'; | ||
}, | ||
{ | ||
code: "if (status === '你好') { success = true; }", | ||
}, | ||
], | ||
@@ -106,2 +109,8 @@ | ||
{ | ||
code: '<Modal title="你好"></Modal>', | ||
errors: [{ | ||
message: ERR_MSG, | ||
}], | ||
}, | ||
{ | ||
code: "httpErrors.BadRequestError('你好')", | ||
@@ -108,0 +117,0 @@ errors: [{ |
20817
3.02%629
3.45%