From 0e6f9c3fa5da7915146ac39486cc2f931a5575cc Mon Sep 17 00:00:00 2001 From: Benjamin Leonard Date: Wed, 4 Oct 2023 15:00:16 +0100 Subject: [PATCH] Typefixes --- components/src/utils.ts | 4 +++- package.json | 3 ++- tsconfig.json | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/src/utils.ts b/components/src/utils.ts index 29cbce9..0304897 100644 --- a/components/src/utils.ts +++ b/components/src/utils.ts @@ -5,6 +5,8 @@ * * Copyright Oxide Computer Company */ +import cn from 'classnames' +import { createElement } from 'react' const titleCase = (text: string): string => { return text.replace( @@ -20,7 +22,7 @@ const make = // only one argument here means string interpolations are not allowed (strings: TemplateStringsArray) => { const Comp = ({ className, children, ...rest }: JSX.IntrinsicElements[T]) => - React.createElement(tag, { className: cn(strings[0], className), ...rest }, children) + createElement(tag, { className: cn(strings[0], className), ...rest }, children) Comp.displayName = `classed.${tag}` return Comp } diff --git a/package.json b/package.json index 68948d8..077d8a7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "build:components": "tsup --dts", "release": "auto shipit", "lint": "eslint --ext .js,.ts,.tsx,.json .", - "fmt": "prettier --cache --write . && npm run lint -- --fix" + "fmt": "prettier --cache --write . && npm run lint -- --fix", + "tsc": "tsc" }, "author": "Oxide Computer Company ", "license": "MPL 2.0", diff --git a/tsconfig.json b/tsconfig.json index 031bcb7..2e92d60 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,8 @@ "paths": { "~/*": ["./components/*"], "@/*": ["./*"] - } + }, + "allowImportingTsExtensions": true }, "include": ["components/**/*.ts", "components/**/*.tsx"], "references": [{ "path": "./tsconfig.node.json" }]