Commit a8bcbc96 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Update project typecheck configuration

Update project typecheck configuration so that typechecking may be
additionally applied to the `dev-server` area of the project. This helps
for typechecking usage of components in the "UI Playground" app.

* Add `tsconfig.json` for `dev-server` area of project
* Add "project references" at root level
  See https://www.typescriptlang.org/docs/handbook/project-references.html
* Update `package.json` `typecheck` script
parent 793d289c
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"lib": ["es2018", "dom"],
"jsx": "react-jsx",
"jsxImportSource": "preact",
"module": "commonjs",
"noEmit": true,
"strict": true,
"noImplicitAny": false,
"target": "ES2020"
},
"include": ["ui-playground/**/*.js"]
}
......@@ -91,7 +91,7 @@ export function PatternExamples({ children, title }) {
<table className="PatternExamples">
{title && (
<tr>
<th colSpan="3">
<th colSpan={3}>
<h3>{title}</h3>
</th>
</tr>
......
......@@ -54,7 +54,7 @@ export default function PlaygroundApp() {
<a
className="PlaygroundApp__nav-link"
key={c.route}
href={c.route}
href={/** @type string */ (c.route)}
onClick={e => navigate(e, c.route)}
>
{c.title}
......
......@@ -15,7 +15,7 @@ export default function MenuPatterns() {
<p>A simple Menu usage example</p>
<PatternExamples>
<PatternExample details="Menu">
<Menu label="Edit">
<Menu title="Example Menu" label="Edit">
<MenuItem label="Zoom in" />
<MenuItem label="Zoom out" />
<MenuItem label="Undo" />
......
......@@ -7,4 +7,4 @@ import sidebarIcons from '../../src/sidebar/icons';
registerIcons(sidebarIcons);
const container = document.querySelector('#app');
render(<PlaygroundApp />, container);
render(<PlaygroundApp />, /** @type Element */ (container));
......@@ -127,7 +127,7 @@
"checkformatting": "prettier --check '**/*.{js,scss}'",
"format": "prettier --list-different --write '**/*.{js,scss}'",
"test": "gulp test",
"typecheck": "tsc --build src/tsconfig.json",
"typecheck": "tsc --build tsconfig.json",
"report-coverage": "codecov -f coverage/coverage-final.json",
"version": "make clean build"
}
......
{
"references": [{ "path": "src/" }, { "path": "dev-server/" }],
"files": []
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment