Skip to content

Commit

Permalink
Add no check for all files referencing theme
Browse files Browse the repository at this point in the history
This is very poor as a solution. But typescript builds are not respecting the typeRootsArray in tsconfig and hence leading to Property 'theme' does not exist on type 'IProps & { children?: ReactNode; } & DefaultTheme' error
  • Loading branch information
Agney committed Mar 14, 2021
1 parent ac02b7c commit 8a3d9ac
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 31 deletions.
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "A simple playground for HTML, CSS and JavaScript supporting module imports.",
"private": false,
"scripts": {
"start": "microbundle watch",
"build": "microbundle",
"start": "microbundle watch --jsx React.createElement",
"build": "microbundle --jsx React.createElement",
"test": "jest",
"prepublishOnly": "yarn build",
"release": "np"
Expand Down
9 changes: 5 additions & 4 deletions playground/src/Draggable/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// @ts-nocheck
import React, { FC, ReactNode, useRef, forwardRef } from "react";
import { styled } from "goober";

import useDrag from "./useDrag";
import { useTheme } from "../utils/ThemeProvider";

const Container = styled('div', forwardRef)`
const Container = styled("div", forwardRef)`
display: flex;
align-items: stretch;
`;

const Divider = styled('div', forwardRef)`
width: ${props => props.theme.divider.width}px;
const Divider = styled("div", forwardRef)`
width: ${(props) => props.theme.divider.width}px;
cursor: col-resize;
background-color: ${props => props.theme.divider.background};
background-color: ${(props) => props.theme.divider.background};
`;

interface IProps {
Expand Down
1 change: 1 addition & 0 deletions playground/src/Editor/EditorSetup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import React, { FC, Fragment } from "react";
import SimpleEditor from "react-simple-code-editor";
import Highlight, { defaultProps } from "prism-react-renderer";
Expand Down
3 changes: 2 additions & 1 deletion playground/src/Playground.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import React, { FC, useState, createElement } from "react";
import { useId } from "@reach/auto-id";
import { styled, setup, DefaultTheme } from "goober";
Expand All @@ -7,7 +8,7 @@ import "@reach/tabs/styles.css";
import Editor from "./Editor";
import Result from "./Result";
import { ISnippet, IEditorTabs, IResultTabs } from "./types";
import { ThemeProvider, useTheme } from './utils/ThemeProvider';
import { ThemeProvider, useTheme } from "./utils/ThemeProvider";
import { ColorMode } from "./utils/theme";
import media from "./utils/media";
import Draggable from "./Draggable";
Expand Down
5 changes: 3 additions & 2 deletions playground/src/Result/Console.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @ts-nocheck
import React, { FC } from "react";
import { styled } from "goober";
import Inspector from "@agney/react-inspector";

const Container = styled('div')`
background-color: ${props => props.theme.console.background};
const Container = styled("div")`
background-color: ${(props) => props.theme.console.background};
height: 100%;
li {
Expand Down
7 changes: 4 additions & 3 deletions playground/src/Result/ErrorDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @ts-nocheck
import React, { FC } from "react";
import { styled } from "goober";

const Container = styled('div')`
background-color: ${props => props.theme.error.background};
color: ${props => props.theme.error.color};
const Container = styled("div")`
background-color: ${(props) => props.theme.error.background};
color: ${(props) => props.theme.error.color};
padding: 0.2em 0.5em;
position: absolute;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "goober";

import { theme } from "../src/utils/theme";
import { theme } from "../utils/theme";

declare module "goober" {
type OurTheme = typeof theme;
Expand Down
8 changes: 5 additions & 3 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"esModuleInterop": true,
"jsx": "react",
"lib": ["es2017", "dom"],
"noEmitOnError": true,
"strict": false,
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "Node",
"typeRoots": ["./node_modules/@types", "../node_modules/@types", "./types"]
"typeRoots": [
"./node_modules/@types",
"../node_modules/@types",
"./src/types"
]
}
}
1 change: 0 additions & 1 deletion playground/types/babel-plugin-unpkg.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion playground/types/babel-standalone.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions playground/types/iframe.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion playground/types/react-inspector.d.ts

This file was deleted.

0 comments on commit 8a3d9ac

Please sign in to comment.