mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 12:35:13 +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) {
|
function collectMembers(node) {
|
||||||
if (!node) return [];
|
if (!node) return [];
|
||||||
if (node.type !== 'MemberExpression') return [];
|
if (node.type !== 'MemberExpression') return [];
|
||||||
|
// this is something like `foo[bar]`
|
||||||
|
if (node.computed) return [];
|
||||||
return [ node.property.name, ...collectMembers(node.parent) ];
|
return [ node.property.name, ...collectMembers(node.parent) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,6 @@ ruleTester.run(
|
||||||
{
|
{
|
||||||
valid: [
|
valid: [
|
||||||
testCase('i18n.ts.foo.bar'),
|
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.ts.top'),
|
||||||
testCase('i18n.tsx.foo.baz({x:1})'),
|
testCase('i18n.tsx.foo.baz({x:1})'),
|
||||||
testCase('whatever.i18n.ts.blah.blah'),
|
testCase('whatever.i18n.ts.blah.blah'),
|
||||||
|
@ -32,6 +30,9 @@ ruleTester.run(
|
||||||
testCase('whatever(i18n.ts.foo.bar)'),
|
testCase('whatever(i18n.ts.foo.bar)'),
|
||||||
testCaseVue('<template><p>{{ i18n.ts.foo.bar }}</p></template>'),
|
testCaseVue('<template><p>{{ i18n.ts.foo.bar }}</p></template>'),
|
||||||
testCaseVue('<template><I18n :src="i18n.ts.foo.baz"/></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: [
|
invalid: [
|
||||||
testCase('i18n.ts.not', 1),
|
testCase('i18n.ts.not', 1),
|
||||||
|
|
Loading…
Reference in a new issue