VSCode
Search for global node_modules folder (GLOBAL_NODE_MODULES)
node_modules folder (GLOBAL_NODE_MODULES)Use the
npm config get prefixcommand to find the path to themhyexecutable file.The global
node_modulesfolder should be around there somewhere. It varies between different systems, maybe it is right next to it, maybe inside alibdirectory next to it or the upper levels.Inside the global
node_modulesfolder, you'll findmhy/node_modules. The path to that directory is what we will need.
Generating config files
# Generating all possible config files mhy can provide
mhy config
# Use -o to overwrite existing files
mhy config -o
# Generate specific config files
mhy config prettier typescript webpack -ioAlias resolution and node_modules resolution
node_modules resolutionGenerate a tsconfig.json file in your root folder mhy config typescript -io. VSCode will handle it for you, even if you have a JavaScript project.
Prettier (for automatic formatting on save; recommended)
Generate prettier config mhy config prettier -io and install Prettier - Code formatter plugin.
Unfortunately you'll need to create watcher for each
File Typeyou want the IDE to watch. By default it was creating it only for JavaScript. Most probably you want to addjsx, ts, tsxwatcher also. Do this with copying the watcher and change theFile Type.
ESLint
ONLY in case you don't have
.eslintrcfile yet:mhy config eslint -iGo to
File > Preferences > Settings > Extensions > ESLintEnableClick on
Edit in settings.jsonGrab
mhy's nodemodules path and add the following key into _VSCodesettings.json:"eslint.nodePath": ".../mhy-node_modules-path",Save it.
Last updated
Was this helpful?