Add array-type TypeScript ESLint rule

This commit is contained in:
Evan Hahn 2021-07-08 16:55:48 -05:00 committed by GitHub
parent 7efa4f1a8a
commit da27a6ac64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 7 deletions

View file

@ -66,7 +66,7 @@ export class Linkify extends React.Component<Props> {
const chunkData: Array<{
chunk: string;
matchData: LinkifyIt.Match[];
matchData: ReadonlyArray<LinkifyIt.Match>;
}> = splitByEmoji(text).map(({ type, value: chunk }) => {
if (type === 'text') {
return { chunk, matchData: linkify.match(chunk) || [] };