Try it here.
A simple demonstration to wrap @monaco-editor/react into an online TypeScript editor component with IntelliSense support and script execution functionality. The React app is created/built by Vite and deployed to GitHub Pages using Github Actions.
When the "Strict Mode" is enabled, the Monaco editor would apply the following TypeScript rules for the IntelliSense:
allowUnreachableCode:falseallowUnusedLabels:falseexactOptionalPropertyTypes:truenoFallthroughCasesInSwitch:truenoImplicitAny:truenoImplicitOverride:truenoImplicitReturns:truenoImplicitThis:truenoPropertyAccessFromIndexSignature:truenoUncheckedIndexedAccess:truenoUnusedLocals:truenoUnusedParameters:truestrict:truestrictBindCallApply:truestrictBuiltinIteratorReturn:truestrictFunctionTypes:truestrictNullChecks:truestrictPropertyInitialization:true
checkJs is set to true and target/module are set to ESNext.
If you want to add declaration files (.d.ts), see the comment in /src/component/MonacoEditor.tsx.
Install dependencies.
Start the dev server.
Build a production at ./dist.
Serve and view the built production.
Commit changes.