Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deej-io committed Aug 1, 2024
1 parent 0360270 commit 4ac6b52
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
4 changes: 4 additions & 0 deletions packages/playground/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ module.exports = {
project: "tsconfig.json",
},
},
"import/ignore": ['mml:.*'],
"import/no-unresolved": {
ignore: ['mml:']
},
"import/internal-regex": "^~",
react: {
version: "18.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"build": "tsx ./build.ts --build",
"iterate": "tsx --watch=./build.ts ./build.ts --watch",
"type-check": "tsc --noEmit",
"lint": "eslint \"./src/**/*.{js,jsx,ts,tsx}\" --max-warnings 0",
"lint:fix": "eslint \"./src/**/*.{js,jsx,ts,tsx}\" --fix"
"lint": "eslint -c ./.eslintrc.cjs \"./src/**/*.{js,jsx,ts,tsx}\" --max-warnings 0",
"lint:fix": "eslint -c ./.eslintrc.cjs \"./src/**/*.{js,jsx,ts,tsx}\" --fix"
},
"dependencies": {
"@types/react": "18.3.2",
Expand Down
4 changes: 3 additions & 1 deletion packages/playground/src/duck/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from "react";
import { flushSync } from "react-dom";
import { createRoot } from "react-dom/client";

Expand All @@ -9,7 +10,8 @@ function Duck() {
);
}

const container = document.getElementById("root") ?? document.body.appendChild(document.createElement("div"));
const container =
document.getElementById("root") ?? document.body.appendChild(document.createElement("div"));
const root = createRoot(container);
flushSync(() => {
root.render(<Duck />);
Expand Down
10 changes: 2 additions & 8 deletions packages/playground/src/examples/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/*eslint import/no-unresolved: [2, { ignore: ['^mml:'] }]*/
import collisionEvents from "mml:./collision-events.html";
import dice from "mml:./dice.html";
import movingPlatform from "mml:./moving-platform.html";
import positionProbe from "mml:./position-probe.html";
import videoPlayer from "mml:./videoplayer.html";
import weather from "mml:./weather.html";

export {
collisionEvents,
dice,
movingPlatform,
positionProbe,
videoPlayer,
weather,
};
export { collisionEvents, dice, movingPlatform, positionProbe, videoPlayer, weather };
16 changes: 13 additions & 3 deletions packages/playground/src/playground/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*eslint import/no-unresolved: [2, { ignore: ['^mml:'] }]*/
import duck from "mml:../duck/index.tsx";
import React from "react";
import { flushSync } from "react-dom";
import { createRoot } from "react-dom/client";
import duck from "mml:../duck/index.tsx";
import { dice, videoPlayer, weather, movingPlatform, collisionEvents, positionProbe } from "../examples";

import {
INTERACTIVE_SLOT_COUNT_X,
Expand All @@ -10,6 +11,14 @@ import {
SLOT_WIDTH,
SPACE_BETWEEN_SLOTS,
} from "../constants";
import {
collisionEvents,
dice,
movingPlatform,
positionProbe,
videoPlayer,
weather,
} from "../examples";
import { Slot } from "../Slot";

const DEMO_SLOTS = [
Expand Down Expand Up @@ -97,7 +106,8 @@ function App() {
);
}

const container = document.getElementById("root") ?? document.body.appendChild(document.createElement("div"));
const container =
document.getElementById("root") ?? document.body.appendChild(document.createElement("div"));
const root = createRoot(container);
flushSync(() => {
root.render(<App />);
Expand Down
12 changes: 6 additions & 6 deletions packages/playground/src/types/html.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare module '*.html' {
const url: string;
export default value;
declare module "*.html" {
const url: string;
export default value;
}

declare module 'mml:*' {
const url: string;
export default value;
declare module "mml:*" {
const url: string;
export default value;
}

0 comments on commit 4ac6b52

Please sign in to comment.