diff --git a/packages/playground/.eslintrc.cjs b/packages/playground/.eslintrc.cjs index 39c76ef..d280748 100644 --- a/packages/playground/.eslintrc.cjs +++ b/packages/playground/.eslintrc.cjs @@ -87,6 +87,9 @@ module.exports = { project: "tsconfig.json", }, }, + "import/no-unresolved": { + ignore: ['^mml:'] + }, "import/internal-regex": "^~", react: { version: "18.2", diff --git a/packages/playground/package.json b/packages/playground/package.json index c33788c..a7f2fa0 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -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", diff --git a/packages/playground/src/duck/index.tsx b/packages/playground/src/duck/index.tsx index 44679f0..f13ac51 100644 --- a/packages/playground/src/duck/index.tsx +++ b/packages/playground/src/duck/index.tsx @@ -1,3 +1,4 @@ +import React from "react"; import { flushSync } from "react-dom"; import { createRoot } from "react-dom/client"; @@ -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(); diff --git a/packages/playground/src/examples/index.tsx b/packages/playground/src/examples/index.tsx index 2a8dec8..0a7801a 100644 --- a/packages/playground/src/examples/index.tsx +++ b/packages/playground/src/examples/index.tsx @@ -1,3 +1,4 @@ +/*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"; @@ -5,11 +6,4 @@ 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 }; diff --git a/packages/playground/src/playground/index.tsx b/packages/playground/src/playground/index.tsx index 60abad2..0af2de5 100644 --- a/packages/playground/src/playground/index.tsx +++ b/packages/playground/src/playground/index.tsx @@ -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, @@ -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 = [ @@ -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(); diff --git a/packages/playground/src/types/html.d.ts b/packages/playground/src/types/html.d.ts index d5c69d9..9cb8fb9 100644 --- a/packages/playground/src/types/html.d.ts +++ b/packages/playground/src/types/html.d.ts @@ -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; }