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

Commit

Permalink
Fix lint errors & improve some type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander Vispoel committed Jun 12, 2020
1 parent 25908e1 commit ae42b86
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/components/common/interaction/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const Link: React.FC<LinkProps> = ({
}) => {
const formattedAriaLabel = _.capitalize(ariaLabel);

let linkProps: React.AnchorHTMLAttributes<{}> = {
let linkProps: React.AnchorHTMLAttributes<Element> = {
className: className || '',
};

Expand Down Expand Up @@ -73,7 +73,7 @@ export const Link: React.FC<LinkProps> = ({
);
};

type BaseProps = React.AnchorHTMLAttributes<{}> & {
type BaseProps = React.AnchorHTMLAttributes<Element> & {
children: React.ReactNode;
className?: string;
ariaLabel?: string;
Expand Down
2 changes: 2 additions & 0 deletions src/components/pages/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { PrimeHeader, PrimeContent } from 'modules/Home/styled';
* The second parameter is for typing URL queries
*/
const Data: i.NextPageReduxComponent<DataProps, DataQueries> = ({ data, query }) => {
// This line here is to test Redux functionality
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const dataLoading = useSelector((state) => state.data.loading);

return (
Expand Down
14 changes: 5 additions & 9 deletions src/types/declarations.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@ declare const __TEST__: boolean;

// extend window object
interface Window {
__REDUX_DEVTOOLS_EXTENSION__: Function;
__REDUX_DEVTOOLS_EXTENSION__: () => () => void;
__NEXT_REDUX_STORE__: any;
}

declare interface NodeModule {
hot: {
accept(path?: string, callback?: () => void): void;
};
}

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

// Image files
declare module '*.svg' {
const value: React.ReactComponentElement;
const value: React.ComponentType<React.SVGProps<SVGSVGElement>>;
export = value;
}
declare module '*.gif' {
Expand All @@ -46,7 +42,7 @@ declare module '*.png' {
export = value;
}

// Image files external import
// Image files external import are always strings
declare module '*.svg?external' {
const value: string;
export = value;
Expand Down

0 comments on commit ae42b86

Please sign in to comment.