avoid usage of to*Case + add project lint rule

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-10-02 14:01:50 +02:00
parent 9697e91074
commit ca0559444c
25 changed files with 101 additions and 33 deletions
+2
View File
@@ -41,8 +41,10 @@ const useStyles = makeStyles({
const getIconText = (title: string) =>
title.split(' ').length === 1
? // If there's only one word, keep the first two characters
// eslint-disable-next-line no-restricted-syntax
title[0].toUpperCase() + title[1].toLowerCase()
: // If there's more than one word, take the first character of the first two words
// eslint-disable-next-line no-restricted-syntax
title
.replace(/\B\W/g, '')
.split(' ')