mirror of
https://codeberg.org/yeentown/barkey
synced 2024-12-22 18:50:00 +00:00
ignore more weirdness
This commit is contained in:
parent
b0bc24f01b
commit
d466e05eda
2 changed files with 5 additions and 2 deletions
|
@ -12,6 +12,8 @@
|
|||
function collectMembers(node) {
|
||||
if (!node) return [];
|
||||
if (node.type !== 'MemberExpression') return [];
|
||||
// this is something like `foo[bar]`
|
||||
if (node.computed) return [];
|
||||
return [ node.property.name, ...collectMembers(node.parent) ];
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,6 @@ ruleTester.run(
|
|||
{
|
||||
valid: [
|
||||
testCase('i18n.ts.foo.bar'),
|
||||
// we don't detect the problem here, but should still accept it
|
||||
testCase('i18n.ts.foo["something"]'),
|
||||
testCase('i18n.ts.top'),
|
||||
testCase('i18n.tsx.foo.baz({x:1})'),
|
||||
testCase('whatever.i18n.ts.blah.blah'),
|
||||
|
@ -32,6 +30,9 @@ ruleTester.run(
|
|||
testCase('whatever(i18n.ts.foo.bar)'),
|
||||
testCaseVue('<template><p>{{ i18n.ts.foo.bar }}</p></template>'),
|
||||
testCaseVue('<template><I18n :src="i18n.ts.foo.baz"/></template>'),
|
||||
// we don't detect the problem here, but should still accept it
|
||||
testCase('i18n.ts.foo["something"]'),
|
||||
testCase('i18n.ts.foo[something]'),
|
||||
],
|
||||
invalid: [
|
||||
testCase('i18n.ts.not', 1),
|
||||
|
|
Loading…
Reference in a new issue