Skip to content
This repository was archived by the owner on May 4, 2020. It is now read-only.

Commit 284072b

Browse files
committed
chore(eslint-plugin-formatjs): add test for tag placeholder case
1 parent 8481b55 commit 284072b

File tree

3 files changed

+40
-84
lines changed

3 files changed

+40
-84
lines changed

package-lock.json

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package-lock.json

Lines changed: 0 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/eslint-plugin-formatjs/tests/index.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,15 @@ _({
407407
defaultMessage: '{count, plural, one {#} other {# more}}',
408408
description: 'asd'
409409
})
410+
`,
411+
`
412+
intl.formatMessage({
413+
defaultMessage: '{count, plural, one {<a>#</a>} other {# more}}',
414+
description: 'asd'
415+
}, {
416+
count: 1,
417+
a: (...chunks) => <a>{chunks}</a>
418+
})
410419
`,
411420
dynamicMessage,
412421
noMatch,
@@ -463,6 +472,21 @@ _({
463472
},
464473
],
465474
},
475+
{
476+
code: `
477+
intl.formatMessage({
478+
defaultMessage: '{count, plural, one {<a>#</a>} other {# more}}',
479+
description: 'asd'
480+
}, {
481+
count: 1,
482+
})
483+
`,
484+
errors: [
485+
{
486+
message: 'Missing value for placeholder "a"',
487+
},
488+
],
489+
},
466490
],
467491
});
468492

0 commit comments

Comments
 (0)