eslint-plugin-m6web-i18n
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -6,3 +6,3 @@ 'use strict'; | ||
if (config.ignoreFiles && new RegExp(config.ignoreFiles).test(context.getFilename())) { | ||
if (!config || config.ignoreFiles && new RegExp(config.ignoreFiles).test(context.getFilename())) { | ||
return {}; | ||
@@ -9,0 +9,0 @@ } |
@@ -11,2 +11,7 @@ 'use strict'; | ||
var config = context.settings.i18n; | ||
if (!config || config.ignoreFiles && new RegExp(config.ignoreFiles).test(context.getFilename())) { | ||
return {}; | ||
} | ||
if (config && config[langsKey]) { | ||
@@ -23,9 +28,6 @@ langConfig = config[langsKey].map(function (_ref) { | ||
if (config.ignoreFiles && new RegExp(config.ignoreFiles).test(context.getFilename())) { | ||
return {}; | ||
} | ||
return { | ||
CallExpression: function CallExpression(node) { | ||
var funcName = node.callee.type === 'MemberExpression' && node.callee.property.name || node.callee.name; | ||
if (funcName !== config.functionName || !node.arguments || !node.arguments.length) { | ||
@@ -40,2 +42,3 @@ return; | ||
var key = (0, _utils.getKeyValue)(keyNode); | ||
if (!key) { | ||
@@ -62,4 +65,8 @@ return; | ||
}, []); | ||
if (missingKeys.length) { | ||
context.report({ node: node, message: '[' + missingKeys + '] keys are missing for key \'' + key + '\' in \'' + name + '\' language' }); | ||
context.report({ | ||
node: node, | ||
message: '[' + missingKeys + '] keys are missing for key \'' + key + '\' in \'' + name + '\' language' | ||
}); | ||
} | ||
@@ -66,0 +73,0 @@ }); |
{ | ||
"name": "eslint-plugin-m6web-i18n", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "eslint plugin for generic i18n", | ||
@@ -10,3 +10,3 @@ "author": "M6web", | ||
"type": "git", | ||
"url": "https://github.m6web.fr/m6web/site-6play-v4.git" | ||
"url": "https://github.com/M6Web/eslint-plugin-m6web-i18n.git" | ||
}, | ||
@@ -13,0 +13,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
43704
197