chore: fix lint warnings (#385)
This commit is contained in:
@@ -172,7 +172,14 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
'@typescript-eslint/no-explicit-any': 'error',
|
'@typescript-eslint/no-explicit-any': 'error',
|
||||||
'@typescript-eslint/no-unused-vars': 'warn',
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
argsIgnorePattern: '^_',
|
||||||
|
varsIgnorePattern: '^_',
|
||||||
|
caughtErrorsIgnorePattern: '^_',
|
||||||
|
},
|
||||||
|
],
|
||||||
'@typescript-eslint/naming-convention': 'off',
|
'@typescript-eslint/naming-convention': 'off',
|
||||||
'@typescript-eslint/space-before-function-paren': 'off',
|
'@typescript-eslint/space-before-function-paren': 'off',
|
||||||
'@typescript-eslint/ban-ts-comment': 'off',
|
'@typescript-eslint/ban-ts-comment': 'off',
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ chrome.runtime.onInstalled.addListener(details => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// migration/login logic
|
// migration/login logic
|
||||||
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo, tab) => {
|
chrome.tabs.onUpdated.addListener(async (tabId, changeInfo) => {
|
||||||
// console.log(changeInfo);
|
// console.log(changeInfo);
|
||||||
if (changeInfo.url === 'https://utdirect.utexas.edu/apps/registrar/course_schedule/utrp_login/') {
|
if (changeInfo.url === 'https://utdirect.utexas.edu/apps/registrar/course_schedule/utrp_login/') {
|
||||||
function openPopupAction() {
|
function openPopupAction() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import CancelledIcon from '~icons/material-symbols/warning';
|
|||||||
export function StatusIcon(props: SVGProps<SVGSVGElement> & { status: StatusType }): JSX.Element | null {
|
export function StatusIcon(props: SVGProps<SVGSVGElement> & { status: StatusType }): JSX.Element | null {
|
||||||
const { status, ...rest } = props;
|
const { status, ...rest } = props;
|
||||||
|
|
||||||
switch (props.status) {
|
switch (status) {
|
||||||
case Status.WAITLISTED:
|
case Status.WAITLISTED:
|
||||||
return <WaitlistIcon {...rest} />;
|
return <WaitlistIcon {...rest} />;
|
||||||
case Status.CLOSED:
|
case Status.CLOSED:
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export default function PopupMain(): JSX.Element {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [activeSchedule, schedules] = useSchedules();
|
const [activeSchedule, schedules] = useSchedules();
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
// const [isRefreshing, setIsRefreshing] = useState(false);
|
||||||
const [funny, setFunny] = useState<string>('');
|
const [funny, setFunny] = useState<string>('');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function makeGridRow(row: number, cols: number): JSX.Element {
|
|||||||
*/
|
*/
|
||||||
export default function CalendarGrid({
|
export default function CalendarGrid({
|
||||||
courseCells,
|
courseCells,
|
||||||
saturdayClass, // TODO: implement/move away from props
|
saturdayClass: _saturdayClass, // TODO: implement/move away from props
|
||||||
setCourse,
|
setCourse,
|
||||||
}: React.PropsWithChildren<Props>): JSX.Element {
|
}: React.PropsWithChildren<Props>): JSX.Element {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export function Chip({ variant, label }: React.PropsWithChildren<Props>): JSX.El
|
|||||||
default:
|
default:
|
||||||
labelMap = {};
|
labelMap = {};
|
||||||
}
|
}
|
||||||
const longName = Object.entries(labelMap).find(([full, short]) => short === label)?.[0] ?? label;
|
const longName = Object.entries(labelMap).find(([_full, short]) => short === label)?.[0] ?? label;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Text
|
<Text
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ type Props = TextProps<'a'> & {
|
|||||||
* A reusable Text component with props that build on top of the design system for the extension
|
* A reusable Text component with props that build on top of the design system for the extension
|
||||||
*/
|
*/
|
||||||
export default function Link(props: PropsWithChildren<Props>): JSX.Element {
|
export default function Link(props: PropsWithChildren<Props>): JSX.Element {
|
||||||
let { className, href, ...passedProps } = props;
|
const { className, href, ...passedProps } = props;
|
||||||
|
|
||||||
if (href && !props.onClick) {
|
if (href && !props.onClick) {
|
||||||
passedProps.onClick = e => {
|
passedProps.onClick = e => {
|
||||||
@@ -37,7 +37,7 @@ export default function Link(props: PropsWithChildren<Props>): JSX.Element {
|
|||||||
'underline cursor-pointer': !isDisabled,
|
'underline cursor-pointer': !isDisabled,
|
||||||
'cursor-not-allowed color-ut-gray': isDisabled,
|
'cursor-not-allowed color-ut-gray': isDisabled,
|
||||||
},
|
},
|
||||||
props.className
|
className
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -79,11 +79,11 @@ const useDevMode = (targetCount: number): [boolean, () => void] => {
|
|||||||
* @returns The Settings component.
|
* @returns The Settings component.
|
||||||
*/
|
*/
|
||||||
export default function Settings(): JSX.Element {
|
export default function Settings(): JSX.Element {
|
||||||
const [enableCourseStatusChips, setEnableCourseStatusChips] = useState<boolean>(false);
|
const [_enableCourseStatusChips, setEnableCourseStatusChips] = useState<boolean>(false);
|
||||||
const [showTimeLocation, setShowTimeLocation] = useState<boolean>(false);
|
const [_showTimeLocation, setShowTimeLocation] = useState<boolean>(false);
|
||||||
const [highlightConflicts, setHighlightConflicts] = useState<boolean>(false);
|
const [highlightConflicts, setHighlightConflicts] = useState<boolean>(false);
|
||||||
const [loadAllCourses, setLoadAllCourses] = useState<boolean>(false);
|
const [loadAllCourses, setLoadAllCourses] = useState<boolean>(false);
|
||||||
const [enableDataRefreshing, setEnableDataRefreshing] = useState<boolean>(false);
|
const [_enableDataRefreshing, setEnableDataRefreshing] = useState<boolean>(false);
|
||||||
|
|
||||||
const showMigrationDialog = useMigrationDialog();
|
const showMigrationDialog = useMigrationDialog();
|
||||||
|
|
||||||
@@ -216,6 +216,7 @@ export default function Settings(): JSX.Element {
|
|||||||
try {
|
try {
|
||||||
response = await fetch(link);
|
response = await fetch(link);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// eslint-disable-next-line no-alert
|
||||||
alert(`Failed to fetch url '${link}'`);
|
alert(`Failed to fetch url '${link}'`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ const TableDataSelector = {
|
|||||||
CORE_CURRICULUM: 'td[data-th="Core"] ul li',
|
CORE_CURRICULUM: 'td[data-th="Core"] ul li',
|
||||||
} as const satisfies Record<string, string>;
|
} as const satisfies Record<string, string>;
|
||||||
|
|
||||||
type TableDataSelectorType = (typeof TableDataSelector)[keyof typeof TableDataSelector];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The selectors that we use to scrape the course details page for an individual course (https://utdirect.utexas.edu/apps/registrar/course_schedule/20239/52700/)
|
* The selectors that we use to scrape the course details page for an individual course (https://utdirect.utexas.edu/apps/registrar/course_schedule/20239/52700/)
|
||||||
*/
|
*/
|
||||||
@@ -32,8 +30,6 @@ const DetailsSelector = {
|
|||||||
COURSE_DESCRIPTION: '#details p',
|
COURSE_DESCRIPTION: '#details p',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
type DetailsSelectorType = (typeof DetailsSelector)[keyof typeof DetailsSelector];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that allows us to scrape information from UT's course catalog to create our internal representation of a course
|
* A class that allows us to scrape information from UT's course catalog to create our internal representation of a course
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user