Skip to content

Commit

Permalink
fix: typescript on website
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-mesnil committed Oct 19, 2023
1 parent 240d306 commit e6eae93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"lint:css": "stylelint 'packages/**/styles.ts'",
"lint:js": "eslint packages scripts --max-warnings 0",
"lint:mdx": "prettier --parser mdx --write '**/docs/index.mdx'",
"lint:ts": "tsc --noEmit",
"lint:ts": "tsc --noEmit && cd website && tsc --noEmit",
"lint": "yarn lint:js && yarn lint:css && yarn lint:ts && yarn lint:mdx",
"migrate": "node ./scripts/upgrade-v5.js",
"postinstall": "husky install",
Expand Down
11 changes: 4 additions & 7 deletions website/build-app/components/Props/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ type PropertyProps = {
}

const removeQuote = (str?: string) => str?.toString()?.replace(/'/g, '')

const isArray = Array.isArray

const reactTypes = ['ElementType<any>']

const Type = ({ type }: { type: Property[1]['type'] }) => {
if (!type) {
return null
}
const getType = (type: Property[1]['type']) => {
if (!type) return null

const { name, raw, value } = type

if (raw && reactTypes.includes(raw)) {
Expand Down Expand Up @@ -111,7 +108,7 @@ export const Property = ({ item, parentName }: PropertyProps) => {
{required && <span>Required</span>}
</Flex>
{defaultLabel && <div>{defaultLabel}</div>}
<Type type={type} />
{getType(type)}
{description && <div>{description}</div>}
</Box>
)
Expand Down

0 comments on commit e6eae93

Please sign in to comment.