mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
test: fix some type errors in test files (#7486)
This commit is contained in:
parent
624735bd92
commit
e2e40b8f5f
50 changed files with 319 additions and 182 deletions
|
@ -8,12 +8,7 @@
|
|||
import rule from '../no-untranslated-text';
|
||||
import {getCommonValidTests, RuleTester} from './testUtils';
|
||||
|
||||
const errorsJSX = [
|
||||
{messageId: 'translateChildren', type: 'JSXElement'},
|
||||
] as const;
|
||||
const errorsJSXFragment = [
|
||||
{messageId: 'translateChildren', type: 'JSXFragment'},
|
||||
];
|
||||
const errorsJSX = [{messageId: 'translateChildren'}] as const;
|
||||
|
||||
const ruleTester = new RuleTester({
|
||||
parser: '@typescript-eslint/parser',
|
||||
|
@ -110,7 +105,7 @@ ruleTester.run('no-untranslated-text', rule, {
|
|||
},
|
||||
{
|
||||
code: '<>text</>',
|
||||
errors: errorsJSXFragment,
|
||||
errors: errorsJSX,
|
||||
},
|
||||
{
|
||||
code: '<Component>· — ×</Component>',
|
||||
|
|
|
@ -8,12 +8,8 @@
|
|||
import rule from '../string-literal-i18n-messages';
|
||||
import {getCommonValidTests, RuleTester} from './testUtils';
|
||||
|
||||
const errorsJSX = [
|
||||
{messageId: 'translateChildren', type: 'JSXElement'},
|
||||
] as const;
|
||||
const errorsFunc = [
|
||||
{messageId: 'translateArg', type: 'CallExpression'},
|
||||
] as const;
|
||||
const errorsJSX = [{messageId: 'translateChildren'}] as const;
|
||||
const errorsFunc = [{messageId: 'translateArg'}] as const;
|
||||
|
||||
const ruleTester = new RuleTester({
|
||||
parser: '@typescript-eslint/parser',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue