test: fix some type errors in test files (#7486)

This commit is contained in:
Joshua Chen 2022-05-25 11:46:10 +08:00 committed by GitHub
parent 624735bd92
commit e2e40b8f5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 319 additions and 182 deletions

View file

@ -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>',

View file

@ -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',