Skip to content

Commit b11c942

Browse files
authored
tsconfig: enable some stricter type checking options (#3500)
1 parent ffc2ba2 commit b11c942

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+114
-106
lines changed

website/src/actions/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function downloadUrl(blob: Blob, filename: string) {
2323
export const SUPPORTS_DOWNLOAD = 'download' in document.createElement('a');
2424

2525
export function downloadAsIcal(semester: Semester) {
26-
return (dispatch: Dispatch, getState: GetState) => {
26+
return (_dispatch: Dispatch, getState: GetState) => {
2727
Promise.all([
2828
retryImport(() => import(/* webpackChunkName: "export" */ 'ical-generator')),
2929
retryImport(() => import(/* webpackChunkName: "export" */ 'utils/ical')),

website/src/bootstrapping/matomo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function setCustomDimensions(dimensions: { [id: number]: string }) {
6868
}
6969

7070
export function trackPageView(history: History) {
71-
history.listen((location, action) => {
71+
history.listen((_location, action) => {
7272
if (action === 'PUSH') {
7373
// Wait a bit for the page title to update
7474
setTimeout(() => {

website/src/entry/export/TimetableOnly.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ type State = {
2121
};
2222

2323
export default class TimetableOnly extends Component<Props, State> {
24-
state = {
24+
override state = {
2525
semester: 1,
2626
timetable: {},
2727
colors: {},
2828
};
2929

30-
render() {
30+
override render() {
3131
const { store } = this.props;
3232
const theme = store.getState().theme.id;
3333

website/src/reducers/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const exportData: ExportData = {
4141
jest.mock(
4242
'storage/persistReducer',
4343
<T>() =>
44-
(key: string, reducer: T) =>
44+
(_key: string, reducer: T) =>
4545
reducer,
4646
);
4747

website/src/reducers/timetables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const persistConfig = {
4343
stateReconciler: (
4444
inbound: TimetablesState,
4545
original: TimetablesState,
46-
reduced: TimetablesState,
46+
_reduced: TimetablesState,
4747
{ debug }: PersistConfig<TimetablesState>,
4848
): TimetablesState => {
4949
if (inbound.academicYear === original.academicYear) {

website/src/serverless/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const createRouteHandler =
4949

5050
export const defaultFallback =
5151
(methodHandlers: MethodHandlers) =>
52-
async (req: Request, res: Response): Promise<void> => {
52+
async (_req: Request, res: Response): Promise<void> => {
5353
const allowedMethods = Object.entries(methodHandlers).reduce((acc, [method, handler]) => {
5454
if (handler !== undefined) {
5555
if (acc === '') return method;
@@ -66,7 +66,7 @@ export const defaultFallback =
6666
export const defaultRescue =
6767
(enableLogging: boolean) =>
6868
(err: Error) =>
69-
async (req: Request, res: Response): Promise<void> => {
69+
async (_req: Request, res: Response): Promise<void> => {
7070
if (enableLogging) {
7171
// eslint-disable-next-line no-console
7272
console.error(err);

website/src/utils/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { each, size } from 'lodash';
33

44
export function captureException(error: Error, extra: { [key: string]: unknown } = {}) {
55
Sentry.withScope((scope) => {
6-
each(extra, (data, key) => {
6+
each(extra, (_data, key) => {
77
scope.setExtra(key, extra[key]);
88
});
99

website/src/utils/ical.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function calculateStartEnd(date: Date, startTime: StartTime, endTime: EndTime) {
8383

8484
export function calculateNumericWeek(
8585
lesson: RawLesson,
86-
semester: Semester,
86+
_semester: Semester,
8787
weeks: NumericWeeks,
8888
firstDayOfSchool: Date,
8989
): EventOption {
@@ -108,7 +108,7 @@ export function calculateNumericWeek(
108108

109109
export function calculateWeekRange(
110110
lesson: RawLesson,
111-
semester: Semester,
111+
_semester: Semester,
112112
weekRange: WeekRange,
113113
): EventOption {
114114
const rangeStart = parseDate(weekRange.start);

website/src/views/components/Online.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ export class OnlineComponent extends React.Component<Props> {
1414
isLive: true,
1515
};
1616

17-
shouldComponentUpdate(nextProps: Props) {
17+
override shouldComponentUpdate(nextProps: Props) {
1818
// Do not rerender if the component is not live and the only thing
1919
// that has changed is the online status
2020
return nextProps.isLive || nextProps.children !== this.props.children;
2121
}
2222

23-
render() {
23+
override render() {
2424
const { children, isOnline } = this.props;
2525

2626
if (typeof children === 'function') {

website/src/views/components/SearchBox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default class SearchBox extends React.PureComponent<Props, State> {
9292
);
9393
}
9494

95-
render() {
95+
override render() {
9696
const { value, placeholder, isLoading } = this.props;
9797
return (
9898
<div

0 commit comments

Comments
 (0)