{"id":13524157,"url":"https://github.com/dfinity/prettier-plugin-motoko","last_synced_at":"2025-09-02T16:56:47.046Z","repository":{"id":57749141,"uuid":"523524925","full_name":"dfinity/prettier-plugin-motoko","owner":"dfinity","description":"A code formatter for the Motoko smart contract language.","archived":false,"fork":false,"pushed_at":"2025-06-03T11:50:46.000Z","size":1084,"stargazers_count":28,"open_issues_count":8,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-18T01:41:48.082Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfinity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-10T23:25:39.000Z","updated_at":"2025-06-22T19:54:10.000Z","dependencies_parsed_at":"2022-08-27T00:10:27.859Z","dependency_job_id":"83402b1f-4ce8-4b3d-9f2a-d7a2d255fcec","html_url":"https://github.com/dfinity/prettier-plugin-motoko","commit_stats":{"total_commits":170,"total_committers":2,"mean_commits":85.0,"dds":0.00588235294117645,"last_synced_commit":"ab0050e04aa643c578b8cf1afc2efd271ce82e8a"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"purl":"pkg:github/dfinity/prettier-plugin-motoko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fprettier-plugin-motoko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fprettier-plugin-motoko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fprettier-plugin-motoko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fprettier-plugin-motoko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfinity","download_url":"https://codeload.github.com/dfinity/prettier-plugin-motoko/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfinity%2Fprettier-plugin-motoko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273317765,"owners_count":25084037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:07.585Z","updated_at":"2025-09-02T16:56:47.020Z","avatar_url":"https://github.com/dfinity.png","language":"TypeScript","readme":"# Motoko Formatter \u0026middot; [![npm version](https://img.shields.io/npm/v/prettier-plugin-motoko.svg?logo=npm)](https://www.npmjs.com/package/prettier-plugin-motoko) [![GitHub license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/dfinity/prettier-plugin-motoko/issues)\n\n\u003e ### A [Prettier](https://prettier.io/) plugin for the [Motoko](https://internetcomputer.org/docs/current/developer-docs/build/cdks/motoko-dfinity/motoko/) programming language.\n\n---\n\n## Setup\n\nAfter making sure [Node.js](https://nodejs.org/en/download/) is installed on your local machine, run the following command in your Motoko project directory:\n\n```sh\nnpm install --save-dev prettier prettier-plugin-motoko\n```\n\n## Command-line usage\n\nFormat your Motoko files using the [Prettier CLI](https://prettier.io/docs/en/cli.html):\n\n```sh\nnpx prettier --write --plugin=prettier-plugin-motoko **/*.mo\n```\n\nCheck if your Motoko files are correctly formatted:\n\n```sh\nnpx prettier --check --plugin=prettier-plugin-motoko **/*.mo\n```\n\nAlternatively, check out [`mo-fmt`](https://www.npmjs.com/package/mo-fmt) for a standalone Motoko formatter CLI:\n\n```\nmo-fmt **/*\nmo-fmt -c **/*\n```\n\n## VS Code support\n\n- Works out of the box with the [Motoko extension](https://marketplace.visualstudio.com/items?itemName=dfinity-foundation.vscode-motoko).\n- Compatible with the the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).\n\n## Customization\n\nConfigure the formatter by creating a `.prettierrc` file in your project directory ([full documentation](https://prettier.io/docs/en/configuration.html)).\n\nAdd the following line to your config file:\n\n```json\n{\n    \"plugins\": [\"prettier-plugin-motoko\"],\n}\n```\n\n### Example `.prettierrc` configuration with default values:\n\n```json\n{\n    \"plugins\": [\"prettier-plugin-motoko\"],\n    \"bracketSpacing\": true,\n    \"printWidth\": 80,\n    \"semi\": true,\n    \"tabWidth\": 2,\n    \"trailingComma\": \"es5\",\n    \"useTabs\": false\n}\n```\n\n## Multiple languages\n\nPrettier will apply the same configuration to Motoko, JavaScript, CSS, HTML, and any other supported languages. \n\nYou can specifically configure Motoko files using a [configuration override](https://prettier.io/docs/en/configuration.html#configuration-overrides) in your `.prettierrc` file:\n\n```json\n{\n    \"overrides\": [{\n        \"files\": \"*.mo\",\n        \"options\": {\n            \"bracketSpacing\": true\n        }\n    }]\n}\n```\n\n## Ignoring code\n\nSkip formatting a statement using a `prettier-ignore` comment:\n\n```motoko\n// prettier-ignore\nfunc ignored\u003cA\u003e(a:A){a};\n\nfunc formatted\u003cB\u003e(b : B) { b };\n```\n\n## Contributing\n\nFeel free to [submit a GitHub issue](https://github.com/dfinity/prettier-plugin-motoko/issues/new) to report a bug or suggest a feature. \n\nIf you're interested in becoming an open-source contributor, be sure to check out the [open issues](https://github.com/dfinity/prettier-plugin-motoko/issues) in case anything catches your eye. \n","funding_links":[],"categories":["Motoko"],"sub_categories":["Monitoring"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fprettier-plugin-motoko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfinity%2Fprettier-plugin-motoko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfinity%2Fprettier-plugin-motoko/lists"}