Skip to content

Commit

Permalink
Add comment and make lint/tsc better
Browse files Browse the repository at this point in the history
  • Loading branch information
NickGerleman committed Nov 1, 2023
1 parent 084cac9 commit 06f0c59
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 12 deletions.
15 changes: 12 additions & 3 deletions javascript/just.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,14 @@ function tryFindExecutable(name, failureMessage) {

function emcmakeGenerateTask() {
return () => {
const ninja = tryFindExecutable('ninja', 'Warning: Install Ninja (e.g. "brew install ninja") for faster builds');
const emcmake = findExecutable('emcmake', 'Error: Please install the emscripten SDK: https://emscripten.org/docs/getting_started/');
const ninja = tryFindExecutable(
'ninja',
'Warning: Install Ninja (e.g. "brew install ninja") for faster builds',
);
const emcmake = findExecutable(
'emcmake',
'Error: Please install the emscripten SDK: https://emscripten.org/docs/getting_started/',
);

const args = [
'cmake',
Expand All @@ -174,7 +180,10 @@ function emcmakeGenerateTask() {

function cmakeBuildTask(opts) {
return () => {
const cmake = findExecutable('cmake', 'Error: Please install CMake (e.g. "brew install cmake")');
const cmake = findExecutable(
'cmake',
'Error: Please install CMake (e.g. "brew install cmake")',
);
const args = [
'--build',
'build',
Expand Down
2 changes: 1 addition & 1 deletion javascript/tests/generated/YGStaticPositionTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// @generated by gentest/gentest.rb from gentest/fixtures/YGStaticPositionTest.html

import {Yoga} from "../tools/globals";
import Yoga from 'yoga-layout';
import {
Align,
Direction,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
"lint:fix": "eslint . --fix",
"tsc": "yarn workspaces run tsc"
},
"workspaces": [
"javascript",
Expand Down
1 change: 1 addition & 0 deletions website-next/src/components/Playground/EditValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Props<T> = {
placeholder?: string;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default (props: Props<any>) => {
if (YogaEnumSelect.availableProperties.indexOf(props.property) > -1) {
// @ts-ignore
Expand Down
2 changes: 2 additions & 0 deletions website-next/src/components/Playground/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import styles from './Editor.module.css';

type Props = {
node: LayoutRecordType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onChangeLayout: (key: string, value: any) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onChangeSetting: (key: string, value: any) => void;
direction: Direction;
selectedNodeIsRoot: boolean;
Expand Down
5 changes: 5 additions & 0 deletions website-next/src/components/Playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ type Props = {
persist?: boolean;
renderSidebar?: (
layoutDefinition: LayoutRecordType,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
onChange: () => any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) => any;
};

Expand Down Expand Up @@ -127,6 +129,7 @@ export default class Playground extends Component<Props, State> {
}
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
onChangeLayout = (key: string, value: any) => {
const {selectedNodePath} = this.state;
if (selectedNodePath) {
Expand Down Expand Up @@ -159,7 +162,9 @@ export default class Playground extends Component<Props, State> {
};

modifyAtPath(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
path: Array<any>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any,
selectedNodePath: Array<number> = this.state.selectedNodePath,
) {
Expand Down
1 change: 1 addition & 0 deletions website-next/src/components/Playground/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import clsx from 'clsx';

type Props = {
width?: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
children: any;
};

Expand Down
23 changes: 16 additions & 7 deletions website-next/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,26 @@ const LazyPlayground = React.lazy(
() => import('../components/Playground/Playground'),
);

// Docusaurus SSR does not correctly support top-level await
// 1. https://github.com/facebook/docusaurus/issues/7238
// 2. https://github.com/facebook/docusaurus/issues/9468
function BrowserOnlyPlayground() {
return (
<BrowserOnly fallback={null}>
{() => (
<Suspense fallback={null}>
<LazyPlayground className={styles.playground} />
</Suspense>
)}
</BrowserOnly>
);
}

function PlaygroundSection() {
return (
<main className={styles.playgroundSection}>
<div className="container">
<BrowserOnly fallback={null}>
{() => (
<Suspense fallback={null}>
<LazyPlayground className={styles.playground} />
</Suspense>
)}
</BrowserOnly>
<BrowserOnlyPlayground />
</div>
</main>
);
Expand Down

0 comments on commit 06f0c59

Please sign in to comment.