mrm-task-typescript is an Mrm task designed to automate the initial setup and configuration of TypeScript within a JavaScript project. It currently stands at version 4.1.22. As part of the Mrm monorepo, its releases are often coordinated with other Mrm tasks, typically seeing version bumps (sometimes 'bump only') to ensure compatibility across the Mrm ecosystem. This task distinguishes itself by providing a declarative and automated way to standardize TypeScript configuration across multiple projects or within an organization, reducing manual setup errors and ensuring best practices are applied consistently. It handles the creation of `tsconfig.json`, integrates a type-checking script into `package.json`, and installs necessary TypeScript-related dependencies, streamlining the developer workflow for adopting TypeScript.
npm install mrm-task-typescriptVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create a new project, initialize npm, and apply the `mrm typescript` task to configure TypeScript, including `tsconfig.json` and a type-checking script.
Upgrade Node.js to a compatible version (e.g., using `nvm install 18` or `nvm use 18`).
Back up critical configuration files before running Mrm. After the task, manually merge or adjust configurations as necessary.
Use `npx mrm typescript` or ensure `mrm` is installed globally (`npm install -g mrm`) and its bin directory is in your system's PATH.
Always navigate to your project's root directory before executing `npx mrm typescript`.
After running the task, check `package.json` for installed TypeScript dependencies and resolve any version conflicts manually if needed. You may need to run `npm install` again.
Use `npx mrm typescript` or install Mrm globally with `npm install -g mrm`.
Ensure you have write permissions in the project directory. On some systems, you might need to run your terminal with elevated privileges (e.g., `sudo npx mrm typescript` on Linux/macOS or 'Run as Administrator' on Windows).
After running `npx mrm typescript`, ensure you run `npm install` (or `yarn install`) to install all project dependencies, including TypeScript.
Verify your `package.json` for the presence of a `scripts.typecheck` entry. If missing, re-run `npx mrm typescript` or manually add `"typecheck": "tsc --noEmit"` to your `scripts`.