-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix failing master lint #3640
Fix failing master lint #3640
Changes from all commits
1697b20
9219246
8408ba8
d80dc83
d9bd09c
bbfa028
1a79ed2
c24136b
4fc49c4
83fda76
e333e71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yarn format-staged && yarn lint-staged |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
"link-check": "repo-link-check -c config/link-check/config.yml", | ||
"link-check-diff": "repo-link-check -c config/link-check/config.yml -d master", | ||
"link-check-dev-server": "repo-link-check -c config/link-check/config.yml -r http://localhost:3000", | ||
"link-check-exclude": "repo-link-check -c config/link-check/config.yml --unused-patterns-only" | ||
"link-check-exclude": "repo-link-check -c config/link-check/config.yml --unused-patterns-only", | ||
"prepare": "husky install" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -111,7 +112,6 @@ | |
"@types/react-instantsearch-dom": "^6.12.3", | ||
"@types/react-popover": "^0.5.3", | ||
"@types/react-slick": "^0.23.8", | ||
"@types/rehype-react": "^6.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticed that we no longer need this package and deleted it. |
||
"@typescript-eslint/eslint-plugin": "^5.26.0", | ||
"@typescript-eslint/parser": "^5.26.0", | ||
"autoprefixer": "^10.4.7", | ||
|
@@ -149,7 +149,7 @@ | |
"gatsby-transformer-remark": "^5.15.0", | ||
"gatsby-transformer-sharp": "^4.15.0", | ||
"hast-util-select": "^5.0.2", | ||
"husky": "^8.0.1", | ||
"husky": "^8.0.0", | ||
"iframe-resizer-react": "^1.1.0", | ||
"jest": "^28.1.0", | ||
"lint-staged": "^12.4.2", | ||
|
@@ -170,11 +170,6 @@ | |
"typescript": "^4.7.2", | ||
"unist-util-remove-position": "^4.0.1" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "yarn format-staged && yarn lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,tsx,json}": [ | ||
"eslint" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React from 'react' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some errors were simple to fix. |
||
import React, { PropsWithChildren } from 'react' | ||
import cn from 'classnames' | ||
|
||
import Link from '@dvcorg/gatsby-theme-iterative/src/components/Link' | ||
|
@@ -14,10 +14,12 @@ export interface IPopupProps { | |
closePopup: () => void | ||
} | ||
|
||
export const BasePopup: React.FC<{ | ||
className?: string | ||
isVisible: boolean | ||
}> = ({ children, isVisible, className }) => ( | ||
export const BasePopup: React.FC< | ||
PropsWithChildren<{ | ||
className?: string | ||
isVisible: boolean | ||
}> | ||
> = ({ children, isVisible, className }) => ( | ||
<div className={cn(styles.popup, isVisible && styles.visible, className)}> | ||
{children} | ||
</div> | ||
|
@@ -58,7 +60,7 @@ export const OtherPopup: React.FC<IPopupProps> = ({ | |
key={i} | ||
onClick={closePopup} | ||
> | ||
{text} | ||
{text as React.ReactNode} | ||
</Link> | ||
) | ||
)} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
.cmlIcon { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure how |
||
background-image: url('../../../../../static/img/cml_icon-color--square_vector.svg'); | ||
background-image: url("../../../../../static/img/cml_icon-color--square_vector.svg"); | ||
} | ||
|
||
.dvcIcon { | ||
background-image: url('../../../../../static/img/dvc_icon-color--square_vector.svg'); | ||
background-image: url("../../../../../static/img/dvc_icon-color--square_vector.svg"); | ||
} | ||
|
||
.studioIcon { | ||
background-image: url('../../../../../static/img/studio_icon-color--square_vector.svg'); | ||
background-image: url("../../../../../static/img/studio_icon-color--square_vector.svg"); | ||
} | ||
|
||
.mlemIcon { | ||
background-image: url('../../../../../static/img/mlem-icon.svg'); | ||
background-image: url("../../../../../static/img/mlem-icon.svg"); | ||
} | ||
|
||
.other { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import React, { useState } from 'react' | ||
import ReactPopover, { PopoverProps } from 'react-popover' | ||
import React, { useState, PropsWithChildren } from 'react' | ||
import ReactPopover from 'react-popover' | ||
|
||
import { isTriggeredFromKB } from '@dvcorg/gatsby-theme-iterative/src/utils/front/keyboard' | ||
|
||
import './styles.module.css' | ||
|
||
type IPopoverProps = { | ||
children: React.ReactNode | ||
} & PopoverProps | ||
interface IPopoverProps { | ||
body: React.ReactNode | ||
enterExitTransitionDurationMs: number | ||
} | ||
|
||
const Popover: React.FC<IPopoverProps> = ({ children, ...restProps }) => { | ||
const Popover: React.FC<PropsWithChildren<IPopoverProps>> = ({ | ||
children, | ||
...restProps | ||
}) => { | ||
const [isOpened, setOpened] = useState(false) | ||
const toggle = (): void => setOpened(prev => !prev) | ||
const onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>): void => { | ||
|
@@ -20,6 +24,7 @@ const Popover: React.FC<IPopoverProps> = ({ children, ...restProps }) => { | |
const close = (): void => setOpened(false) | ||
|
||
return ( | ||
// @ts-expect-error Error is caused by package and out of our control | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't figure out how to clear this error because it seemed to be caused by the fact that
|
||
<ReactPopover isOpen={isOpened} onOuterAction={close} {...restProps}> | ||
<div onClick={toggle} role="button" onKeyDown={onKeyDown} tabIndex={0}> | ||
{children} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,6 @@ | |
"alwaysStrict": true, | ||
"noEmit": true | ||
}, | ||
"include": ["./src/**/*", "./*.js"] | ||
"include": ["./src/**/*", "./*.js"], | ||
"exclude": ["./node_modules/**/*"] | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A good chunk of errors were based around I found this StackOverflow thread but adding
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Husky works different after v8! See husky docs