eslint-plugin-kolibri
Advanced tools
Comparing version 0.13.0-dev.8 to 0.13.0-dev.9
@@ -9,7 +9,5 @@ /** | ||
const get = require('lodash/get'); | ||
const utils = require('../utils'); | ||
const constants = require('../constants'); | ||
const { GROUP_$TRS } = constants; | ||
const $TR_FUNCTION = '$tr'; | ||
@@ -45,7 +43,12 @@ | ||
}, | ||
eslintPluginVueUtils.executeOnVue(context, obj => { | ||
definitionNodes = Array.from( | ||
eslintPluginVueUtils.iterateProperties(obj, new Set([GROUP_$TRS])) | ||
); | ||
{ | ||
ObjectExpression(node) { | ||
if (get(node, 'parent.key.name') === '$trs') { | ||
node.properties.forEach(prop => { | ||
definitionNodes.push({ name: prop.key.name }); | ||
}); | ||
} | ||
}, | ||
}, | ||
eslintPluginVueUtils.executeOnVue(context, () => { | ||
if (!hasTemplate) { | ||
@@ -52,0 +55,0 @@ utils.reportUseOfUndefinedTranslation(context, definitionNodes, usedStringNodes); |
@@ -50,7 +50,9 @@ /** | ||
ObjectExpression(node) { | ||
node.properties.forEach(prop => { | ||
if (get(prop, ['value', 'value'])) { | ||
usedStrings.push(prop.value.value); | ||
} | ||
}); | ||
if (get(node, 'parent.key.name') !== '$trs') { | ||
node.properties.forEach(prop => { | ||
if (get(prop, ['value', 'value'])) { | ||
usedStrings.push(prop.value.value); | ||
} | ||
}); | ||
} | ||
}, | ||
@@ -57,0 +59,0 @@ }, |
{ | ||
"name": "eslint-plugin-kolibri", | ||
"version": "0.13.0-dev.8", | ||
"version": "0.13.0-dev.9", | ||
"description": "Custom rules.", | ||
@@ -5,0 +5,0 @@ "author": "Learning Equality", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
91140
3854
1