Skip to content

Commit 6e93955

Browse files
committed
fix remaining linter error for SuggestionMention, tell TypeScript how to handle JSX syntax via the react-jsx compiler option
1 parent 7f13e33 commit 6e93955

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/pages/home/report/ReportActionCompose/SuggestionMention.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import localeCompare from '@libs/LocaleCompare';
1818
import {areEmailsFromSamePrivateDomain} from '@libs/LoginUtils';
1919
import {getDisplayNameOrDefault} from '@libs/PersonalDetailsUtils';
2020
import getPolicyEmployeeAccountIDs from '@libs/PolicyEmployeeListUtils';
21-
import {canReportBeMentionedWithinPolicy} from '@libs/ReportUtils';
21+
import {canReportBeMentionedWithinPolicy, doesReportBelongToWorkspace, getDisplayNameForParticipant, isGroupChat, isReportParticipant} from '@libs/ReportUtils';
2222
import {trimLeadingSpace} from '@libs/SuggestionUtils';
2323
import {isValidRoomName} from '@libs/ValidationUtils';
2424
import {searchInServer} from '@userActions/Report';
@@ -58,7 +58,7 @@ type SuggestionPersonalDetailsList = Record<
5858
>;
5959

6060
function getDisplayName(details: PersonalDetails) {
61-
const displayNameFromAccountID = ReportUtils.getDisplayNameForParticipant({accountID: details.accountID});
61+
const displayNameFromAccountID = getDisplayNameForParticipant({accountID: details.accountID});
6262
if (!displayNameFromAccountID) {
6363
return details.login?.length ? details.login : '';
6464
}
@@ -102,7 +102,7 @@ function SuggestionMention(
102102
// Smaller weight means higher order in suggestion list
103103
const getPersonalDetailsWeight = useCallback(
104104
(detail: PersonalDetails, policyEmployeeAccountIDs: number[]): number => {
105-
if (ReportUtils.isReportParticipant(detail.accountID, currentReport)) {
105+
if (isReportParticipant(detail.accountID, currentReport)) {
106106
return 0;
107107
}
108108
if (policyEmployeeAccountIDs.includes(detail.accountID)) {
@@ -114,7 +114,7 @@ function SuggestionMention(
114114
);
115115
const weightedPersonalDetails: PersonalDetailsList | SuggestionPersonalDetailsList | undefined = useMemo(() => {
116116
const policyEmployeeAccountIDs = getPolicyEmployeeAccountIDs(policyID);
117-
if (!ReportUtils.isGroupChat(currentReport) && !ReportUtils.doesReportBelongToWorkspace(currentReport, policyEmployeeAccountIDs, policyID)) {
117+
if (!isGroupChat(currentReport) && !doesReportBelongToWorkspace(currentReport, policyEmployeeAccountIDs, policyID)) {
118118
return personalDetails;
119119
}
120120
return lodashMapValues(personalDetails, (detail) =>

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"@styles/*": ["./src/styles/*"],
2323
"@src/*": ["./src/*"],
2424
"@userActions/*": ["./src/libs/actions/*"]
25-
}
25+
},
26+
"jsx": "react-jsx"
2627
},
2728
"include": ["src", "desktop", "web", "website", "docs", "assets", "config", "tests", "jest", "__mocks__", ".github/**/*", ".storybook/**/*", "scripts"],
2829
"exclude": ["**/node_modules/*", "**/dist/*", ".github/actions/**/index.js", "**/docs/*"]

0 commit comments

Comments
 (0)