Fixing linting problem from running yarn rw lint (#537)

✖ 118 problems (65 errors, 53 warnings) currently
This commit was merged in pull request #537.
This commit is contained in:
Kurt Hutten
2021-09-29 17:35:07 +10:00
committed by GitHub
parent 0ce7ce4e76
commit e9ad7180a7
12 changed files with 38 additions and 35 deletions

View File

@@ -19,7 +19,7 @@ export interface UserProfileType {
loading: boolean
error: boolean
onSave: Function
projects: {}[]
projects: any[]
}
export interface FieldType {
@@ -205,14 +205,13 @@ export function fieldReducer(state, action) {
},
}
case 'SET_NEW_VALUE':
const newState = {
return {
...state,
[action.payload.field]: {
...state[action.payload.field],
newValue: action.payload.value,
},
}
return newState
default:
return state
}

View File

@@ -19,10 +19,6 @@ const truncate = (text) => {
return output
}
const jsonTruncate = (obj) => {
return truncate(JSON.stringify(obj, null, 2))
}
const timeTag = (datetime) => {
return (
<time dateTime={datetime} title={datetime}>
@@ -31,10 +27,6 @@ const timeTag = (datetime) => {
)
}
const checkboxInputTag = (checked) => {
return <input type="checkbox" checked={checked} disabled />
}
const UsersList = ({ users }) => {
const [deleteUser] = useMutation(DELETE_USER_MUTATION, {
onCompleted: () => {

View File

@@ -4,8 +4,8 @@
import { RenderArgs, DefaultKernelExport } from './common'
export const render: DefaultKernelExport['render'] = async ({
code,
settings,
code, // eslint-disable-line @typescript-eslint/no-unused-vars
settings, // eslint-disable-line @typescript-eslint/no-unused-vars
}: RenderArgs) => {
// do your magic
return {

View File

@@ -41,7 +41,7 @@ interface CsgObj {
}
function CSGArray2R3fComponent(Csgs: CsgObj[]): React.ReactNode {
return Csgs.map(({ vertices, indices, color, transforms, type }, index) => {
return Csgs.map(({ vertices, indices, color, transforms, type }) => {
const materialDef = materials[type]
if (!materialDef) {
console.error('Can not hangle object type: ' + type, {

View File

@@ -413,7 +413,8 @@ const makeScriptWorker = ({ callback, convertToSolids }) => {
runMain(params)
},
init: (params) => {
let { baseURI, alias = [] } = params
let baseURI = params.baseURI
const alias = params.alias || []
if (!baseURI && typeof document != 'undefined' && document.baseURI) {
baseURI = document.baseURI
}

View File

@@ -24,7 +24,7 @@ function fallbackCopyTextToClipboard(text: string) {
document.body.removeChild(textArea)
}
const clipboardSuccessToast = (text: string) =>
const clipboardSuccessToast = () =>
toast.success(() => (
<div className="overflow-hidden">
<p>link added to clipboard.</p>

View File

@@ -111,7 +111,7 @@ const reducer = (state: State, { type, payload }): State => {
}
case 'updateCode':
return { ...state, code: payload }
case 'resetCustomizer':
case 'resetCustomizer': {
const resetParameters = {}
state.customizerParams.forEach(({ name, initial }) => {
resetParameters[name] = initial
@@ -120,7 +120,8 @@ const reducer = (state: State, { type, payload }): State => {
...state,
currentParameters: resetParameters,
}
case 'healthyRender':
}
case 'healthyRender': {
const currentParameters = {}
const customizerParams: CadhubParams[] = payload.customizerParams || []
@@ -144,6 +145,7 @@ const reducer = (state: State, { type, payload }): State => {
: payload.message,
isLoading: false,
}
}
case 'errorRender':
return {
...state,
@@ -198,7 +200,7 @@ const reducer = (state: State, { type, payload }): State => {
...state,
threeInstance: payload,
}
case 'settingsButtonClicked':
case 'settingsButtonClicked': {
const isReClick =
state.sideTray.length &&
state.sideTray.length === payload.length &&
@@ -229,6 +231,7 @@ const reducer = (state: State, { type, payload }): State => {
...state,
sideTray: payload,
}
}
case 'switchEditorModel':
return {
...state,

View File

@@ -1,11 +1,14 @@
// Extracts YAML frontmatter from Markdown files
// Gotten from this helpful comment on a react-markdown GitHub Issue: https://github.com/remarkjs/react-markdown/issues/164#issuecomment-890497653
export function useMarkdownMetaData(text: string): Array<any> {
const metaData = {} as any
return React.useMemo(() => {
const metaRegExp = RegExp(
/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m
) as any
interface MetaData {
[key: string]: string
}
type MarkdownMetaDataReturn = [RegExpExecArray, MetaData]
export function useMarkdownMetaData(text: string): MarkdownMetaDataReturn {
return React.useMemo<MarkdownMetaDataReturn>(() => {
const metaData: MetaData = {}
const metaRegExp = RegExp(/^---[\r\n](((?!---).|[\r\n])*)[\r\n]---$/m)
// get metadata
const rawMetaData = metaRegExp.exec(text)

View File

@@ -10,7 +10,7 @@ const NewProjectPage = ({ userName }) => {
const { isAuthenticated, currentUser } = useAuth()
useEffect(() => {
!isAuthenticated && navigate(routes.home())
}, [currentUser])
}, [currentUser, isAuthenticated])
return (
<MainLayout>
<Seo

View File

@@ -43,7 +43,12 @@ export default () => (
<section className="">
<h1>
<span className="font-ropa-sans">404 Page Not Found</span>
<div className="text-sm">{location.href} 🤷</div>
<div className="text-sm">
{location.href}{' '}
<span role="img" aria-label="shrug">
🤷
</span>
</div>
</h1>
</section>
</MainLayout>

View File

@@ -25,7 +25,7 @@ const PrivacyPolicyPage = () => {
<P>
This Privacy Policy describes how your personal information is
collected, used, and shared when you visit or use{' '}
<A to="https://cadhub.xyz" /> (the Site).
<A to="https://cadhub.xyz" /> {'(the “Site”)'}.
</P>
<SubHeading>PERSONAL INFORMATION WE COLLECT</SubHeading>
<P>
@@ -36,7 +36,7 @@ const PrivacyPolicyPage = () => {
about the individual web pages that you view, what websites or search
terms referred you to the Site, and information about how you interact
with the Site. We refer to this automatically-collected information as
Device Information.
{'“Device Information.”'}
</P>
<P>We collect Device Information using the following technologies:</P>
<ul className="list-disc pl-4">
@@ -60,8 +60,8 @@ const PrivacyPolicyPage = () => {
Additionally when you make an account or sign in to the app through
the Site, we collect certain information from you, including your
name, email address as well as any information you add to the website,
such as your profile bio, or "parts" you have added. We refer to this
information as Account Information.
such as your profile bio, or {'"Projects"'} you have added. We refer
to this information as Account Information.
</P>
<P>
When we talk about Personal Information in this Privacy Policy, we
@@ -126,9 +126,9 @@ const PrivacyPolicyPage = () => {
</P>
<SubHeading>DATA RETENTION</SubHeading>
<P>
When you place an create a "part" through the Site, we will keep this
record to become part of the public website, you can delete you parts
at anytime.
When you place an create a {'"project"'} through the Site, we will
keep this record to become part of the public website, you can delete
you Projects at anytime.
</P>
<SubHeading>CHANGES</SubHeading>
<P>

View File

@@ -116,7 +116,7 @@ const SubjectAccessRequestPage = () => {
<SubjectAccessRequestsCell />
Here to fulfill a user's right to portability, before running this
please check that the query in
"pages/SubjectAccessRequestPage/SubjectAccessRequestPage.js" is
{'"pages/SubjectAccessRequestPage/SubjectAccessRequestPage.js"'} is
up-to-date.
<Form onSubmit={onSubmit}>
<div