Skip to content

Commit

Permalink
Delete eslint comments 🗑️
Browse files Browse the repository at this point in the history
  • Loading branch information
onesine committed Mar 7, 2023
1 parent 67f93f5 commit cae0f30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/components/GroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const GroupItem: React.FC<GroupItemProps> = ({ item, primaryColor }) => {
) : (
<div
className={
classNames && classNames.listGroupLabel
classNames?.listGroupLabel
? classNames.listGroupLabel
: "pr-2 py-2 cursor-default select-none truncate font-bold text-gray-700"
}
Expand Down
12 changes: 3 additions & 9 deletions src/components/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,21 @@ const Item: React.FC<ItemProps> = ({ item, primaryColor }) => {

const textHoverColor = useMemo(() => {
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return THEME_DATA.textHover[primaryColor];
return THEME_DATA.textHover[primaryColor as keyof typeof THEME_DATA.textHover];
}
return THEME_DATA.textHover[DEFAULT_THEME];
}, [primaryColor]);

const bgColor = useMemo(() => {
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return THEME_DATA.bg[primaryColor];
return THEME_DATA.bg[primaryColor as keyof typeof THEME_DATA.bg];
}
return THEME_DATA.bg[DEFAULT_THEME];
}, [primaryColor]);

const bgHoverColor = useMemo(() => {
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return THEME_DATA.bgHover[primaryColor];
return THEME_DATA.bgHover[primaryColor as keyof typeof THEME_DATA.bgHover];
}
return THEME_DATA.bgHover[DEFAULT_THEME];
}, [primaryColor]);
Expand Down
8 changes: 2 additions & 6 deletions src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,12 @@ const Select: React.FC<SelectProps> = ({
const getSelectClass = useCallback(() => {
let ringColor = THEME_DATA.ring[DEFAULT_THEME];
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
ringColor = THEME_DATA.ring[primaryColor];
ringColor = THEME_DATA.ring[primaryColor as keyof typeof THEME_DATA.ring];
}

let borderFocus = THEME_DATA.borderFocus[DEFAULT_THEME];
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
borderFocus = THEME_DATA.borderFocus[primaryColor];
borderFocus = THEME_DATA.borderFocus[primaryColor as keyof typeof THEME_DATA.borderFocus];
}
const baseClass =
"flex text-sm text-gray-500 border border-gray-300 rounded shadow-sm transition-all duration-300 focus:outline-none";
Expand Down
4 changes: 1 addition & 3 deletions src/components/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ interface Props {
const Spinner: React.FC<Props> = ({ primaryColor = DEFAULT_THEME }) => {
const spinnerColor = useMemo(() => {
if (COLORS.includes(primaryColor)) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return THEME_DATA.text[primaryColor];
return THEME_DATA.text[primaryColor as keyof typeof THEME_DATA.text];
}
return THEME_DATA.text[DEFAULT_THEME];
}, [primaryColor]);
Expand Down

0 comments on commit cae0f30

Please # to comment.