Update property type rule

This commit is contained in:
Gerzon Z 2021-09-17 16:26:10 -04:00
parent 5379109882
commit df480fb8ae
1 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import React from 'react'; import React from 'react';
import { StyleSheet, Text, View } from 'react-native'; import { StyleSheet, Text, View } from 'react-native';
import Touchable from 'react-native-platform-touchable'; import Touchable from 'react-native-platform-touchable';
@ -42,8 +41,8 @@ const styles = StyleSheet.create({
interface IThreadDetails { interface IThreadDetails {
item: { item: {
tcount?: number | string; tcount: number | string;
dcount?: number | string; dcount: number | string;
replies?: any; replies?: any;
id: string; id: string;
}; };
@ -61,16 +60,16 @@ interface IThreadDetails {
const ThreadDetails = ({ item, user, badgeColor, toggleFollowThread, thread, time, style, theme }: IThreadDetails) => { const ThreadDetails = ({ item, user, badgeColor, toggleFollowThread, thread, time, style, theme }: IThreadDetails) => {
let { tcount, dcount } = item; let { tcount, dcount } = item;
if (thread) { if (thread) {
if (tcount! >= 1000) { if (tcount >= 1000) {
tcount = '+999'; tcount = '+999';
} else if (tcount! >= 100) { } else if (tcount >= 100) {
tcount = '+99'; tcount = '+99';
} }
} }
if (dcount! >= 1000) { if (dcount >= 1000) {
dcount = '+999'; dcount = '+999';
} else if (dcount! >= 100) { } else if (dcount >= 100) {
dcount = '+99'; dcount = '+99';
} }