Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Commit ae42b86

Browse files
author
Sander Vispoel
committed
Fix lint errors & improve some type declarations
1 parent 25908e1 commit ae42b86

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/components/common/interaction/Link.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const Link: React.FC<LinkProps> = ({
1111
}) => {
1212
const formattedAriaLabel = _.capitalize(ariaLabel);
1313

14-
let linkProps: React.AnchorHTMLAttributes<{}> = {
14+
let linkProps: React.AnchorHTMLAttributes<Element> = {
1515
className: className || '',
1616
};
1717

@@ -73,7 +73,7 @@ export const Link: React.FC<LinkProps> = ({
7373
);
7474
};
7575

76-
type BaseProps = React.AnchorHTMLAttributes<{}> & {
76+
type BaseProps = React.AnchorHTMLAttributes<Element> & {
7777
children: React.ReactNode;
7878
className?: string;
7979
ariaLabel?: string;

src/components/pages/data.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { PrimeHeader, PrimeContent } from 'modules/Home/styled';
1414
* The second parameter is for typing URL queries
1515
*/
1616
const Data: i.NextPageReduxComponent<DataProps, DataQueries> = ({ data, query }) => {
17+
// This line here is to test Redux functionality
18+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1719
const dataLoading = useSelector((state) => state.data.loading);
1820

1921
return (

src/types/declarations.d.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@ declare const __TEST__: boolean;
77

88
// extend window object
99
interface Window {
10-
__REDUX_DEVTOOLS_EXTENSION__: Function;
10+
__REDUX_DEVTOOLS_EXTENSION__: () => () => void;
1111
__NEXT_REDUX_STORE__: any;
1212
}
1313

14-
declare interface NodeModule {
15-
hot: {
16-
accept(path?: string, callback?: () => void): void;
17-
};
18-
}
1914

2015
// We have to declare how files other than .ts(x) or .js(x) are handled by our codebase because
2116
// Typescript does not know we are handling these files with Webpack.
2217
declare module '*.json' {
23-
const value: object;
18+
type Json = string | number | boolean | { [key: string]: Json } | Json[] | null;
19+
const value: Json;
2420
export default value;
2521
}
2622

2723
// Image files
2824
declare module '*.svg' {
29-
const value: React.ReactComponentElement;
25+
const value: React.ComponentType<React.SVGProps<SVGSVGElement>>;
3026
export = value;
3127
}
3228
declare module '*.gif' {
@@ -46,7 +42,7 @@ declare module '*.png' {
4642
export = value;
4743
}
4844

49-
// Image files external import
45+
// Image files external import are always strings
5046
declare module '*.svg?external' {
5147
const value: string;
5248
export = value;

0 commit comments

Comments
 (0)