{"id":14978239,"url":"https://github.com/ben12/eslint-plugin-dprint","last_synced_at":"2026-01-04T03:21:13.230Z","repository":{"id":196251119,"uuid":"695609593","full_name":"ben12/eslint-plugin-dprint","owner":"ben12","description":"An ESLint plugin that fixes code with dprint","archived":false,"fork":true,"pushed_at":"2024-06-09T01:05:37.000Z","size":4375,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-29T09:12:37.040Z","etag":null,"topics":["dprint","eslint","eslint-plugin","eslint-rules","formatter","typescript"],"latest_commit_sha":null,"homepage":"https://eslint-plugin-dprint.ben12.eu/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"rmobis/eslint-plugin-dprint","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben12.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":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-23T17:31:23.000Z","updated_at":"2024-06-09T01:05:40.000Z","dependencies_parsed_at":"2023-09-30T11:39:16.223Z","dependency_job_id":null,"html_url":"https://github.com/ben12/eslint-plugin-dprint","commit_stats":null,"previous_names":["ben12/eslint-plugin-dprint"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben12%2Feslint-plugin-dprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben12%2Feslint-plugin-dprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben12%2Feslint-plugin-dprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben12%2Feslint-plugin-dprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben12","download_url":"https://codeload.github.com/ben12/eslint-plugin-dprint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875693,"owners_count":16554702,"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","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":["dprint","eslint","eslint-plugin","eslint-rules","formatter","typescript"],"created_at":"2024-09-24T13:57:07.343Z","updated_at":"2025-10-02T13:31:15.170Z","avatar_url":"https://github.com/ben12.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-dprint\n\n[![GitHub](https://img.shields.io/github/license/ben12/eslint-plugin-dprint)](https://github.com/ben12/eslint-plugin-dprint/blob/master/LICENSE)\n[![npm version](https://img.shields.io/npm/v/@ben_12/eslint-plugin-dprint.svg)](https://www.npmjs.com/package/@ben_12/eslint-plugin-dprint)\n[![Downloads/month](https://img.shields.io/npm/dm/@ben_12/eslint-plugin-dprint.svg)](http://www.npmtrends.com/@ben_12/eslint-plugin-dprint)\\\n[![node-current](https://img.shields.io/node/v/%40ben_12%2Feslint-plugin-dprint)](https://nodejs.org)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/eslint)](https://www.npmjs.com/package/eslint)\n![npm bundle size](https://img.shields.io/bundlephobia/min/%40ben_12%2Feslint-plugin-dprint)\\\n[![Build Status](https://github.com/ben12/eslint-plugin-dprint/workflows/CI/badge.svg)](https://github.com/ben12/eslint-plugin-dprint/actions)\n[![codecov](https://codecov.io/gh/ben12/eslint-plugin-dprint/branch/master/graph/badge.svg)](https://codecov.io/gh/ben12/eslint-plugin-dprint)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ben12_eslint-plugin-dprint\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=ben12_eslint-plugin-dprint)\n[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=ben12_eslint-plugin-dprint\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=ben12_eslint-plugin-dprint)\n[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=ben12_eslint-plugin-dprint\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=ben12_eslint-plugin-dprint)\n\n\u003e This is an updated fork of mysticatea/eslint-plugin-dprint. Some things are still being adjusted.\n\nThe plugin that runs [dprint] to format code in ESLint.\n\n## 💿 Installation\n\nUse [npm] or a compatible tool.\n\n```sh\n$ npm install -D eslint @ben_12/eslint-plugin-dprint\n```\n\nThen install [dprint] plugin for the language to format.\n\n```sh\n$ npm install -D @dprint/dockerfile\n$ npm install -D @dprint/json\n$ npm install -D @dprint/markdown\n$ npm install -D @dprint/toml\n$ npm install -D @dprint/typescript\n$ npm install -D dprint-plugin-malva\n$ npm install -D dprint-plugin-markup\n$ npm install -D dprint-plugin-yaml\n$ npm install -D dprint-plugin-graphql\n```\n\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/%40dprint%2Fdockerfile)](https://dprint.dev/plugins/dockerfile/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/%40dprint%2Fjson)](https://dprint.dev/plugins/json/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/%40dprint%2Fmarkdown)](https://dprint.dev/plugins/markdown/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/%40dprint%2Ftoml)](https://dprint.dev/plugins/toml/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/%40dprint%2Ftypescript)](https://dprint.dev/plugins/typescript/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/dprint-plugin-malva)](https://dprint.dev/plugins/malva/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/dprint-plugin-markup)](https://dprint.dev/plugins/markup_fmt/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/dprint-plugin-yaml)](https://dprint.dev/plugins/pretty_yaml/)\n[![npm peer dependency version (scoped)](https://img.shields.io/npm/dependency-version/%40ben_12%2Feslint-plugin-dprint/peer/dprint-plugin-graphql)](https://dprint.dev/plugins/pretty_graphql/)\n\n## 📖 Usage\n\nWrite your ESLint configuration. For example with typescript code:\n\nFrom eslint v9 (flat configuration)\n\n```mjs\nimport tsPlugin from \"@typescript-eslint/eslint-plugin\";\nimport tsParser from \"@typescript-eslint/parser\";\nimport dprint from \"@ben_12/eslint-plugin-dprint\";\n\nmodule.exports = {\n  files: [\"**/*.ts\", \"**/*.js\"],\n\n  languageOptions: {\n      parser: tsParser\n  },\n\n  plugins: {\n      \"@typescript-eslint\": tsPlugin,\n      \"@ben_12/dprint\": dprint,\n  },\n\n  rules: {\n    ...tsPlugin.configs[\"eslint-recommended\"].rules,\n    ...tsPlugin.configs[\"recommended\"].rules,\n    ...tsPlugin.configs[\"strict\"].rules,\n    ...dprint.configs[\"typescript-recommended\"].rules\n    \"@ben_12/dprint/typescript\": [\n      \"error\",\n      {\n        // Use dprint JSON configuration file (default: \"dprint.json\")\n        // It may be created using `dprint init` command\n        // See also https://dprint.dev/config/\n        configFile: \"dprint.json\",\n        config: {\n          // The TypeScript configuration of dprint\n          // See also https://dprint.dev/plugins/typescript/config/\n        },\n      },\n    ],\n  },\n};\n```\n\nFor old eslint (eslintrc configuration)\n\n```js\nmodule.exports = {\n  extends: [\"eslint:recommended\", \"plugin:@typescript-eslint/recommended\", \"plugin:@ben_12/dprint/typescript-recommended\"],\n  rules: {\n    \"@ben_12/dprint/typescript\": [\n      \"error\",\n      {\n        // Use dprint JSON configuration file (default: \"dprint.json\")\n        // It may be created using `dprint init` command\n        // See also https://dprint.dev/config/\n        configFile: \"dprint.json\",\n        config: {\n          // The TypeScript configuration of dprint\n          // See also https://dprint.dev/plugins/typescript/config/\n        },\n      },\n    ],\n  },\n};\n```\n\nThen run ESLint with `--fix`!\n\nFor unparsed eslint file like markdown or dockerfile, you can use [@ben_12/eslint-simple-parser](https://www.npmjs.com/package/@ben_12/eslint-simple-parser) as parser.\n\n```mjs\nimport dprint from \"@ben_12/eslint-plugin-dprint\"\nimport simpleParser from \"@ben_12/eslint-simple-parser\"\n\nexport default [{\n    files: [\"**/*.md\"],\n    plugins: {\n        \"@ben_12/dprint\": dprint,\n    },\n    languageOptions: {\n        parser: simpleParser,\n    },\n    rules: dprint.configs[\"markdown-recommended\"].rules,\n}]\n```\n\n### Available Rules\n\n| Rule                        | Description                                        |\n| :-------------------------- | :------------------------------------------------- |\n| [@ben_12/dprint/dockerfile] | Format dockerfile code with [@dprint/dockerfile].  |\n| [@ben_12/dprint/json]       | Format json code with [@dprint/json].              |\n| [@ben_12/dprint/markdown]   | Format markdown code with [@dprint/markdown].      |\n| [@ben_12/dprint/toml]       | Format toml code with [@dprint/toml].              |\n| [@ben_12/dprint/typescript] | Format typescript code with [@dprint/typescript].  |\n| [@ben_12/dprint/malva]      | Format css/scss/less/sass code with [malva].       |\n| [@ben_12/dprint/markup]     | Format HTML/Vue/Svelte/... code with [markup_fmt]. |\n| [@ben_12/dprint/yaml]       | Format YAML code with [pretty_yaml].               |\n| [@ben_12/dprint/graphql]    | Format GraphQL code with [pretty_graphql].         |\n\n### Available Configs\n\n| Config                                                    | Description                                                                                                                  |\n| :-------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------- |\n| [plugin:@ben_12/dprint/disable-typescript-conflict-rules] | Disable rules where are conflicted with the [@ben_12/dprint/typescript] rule.                                                |\n| [plugin:@ben_12/dprint/dockerfile-recommended]            | Enable the [@ben_12/dprint/dockerfile] rule.                                                                                 |\n| [plugin:@ben_12/dprint/json-recommended]                  | Enable the [@ben_12/dprint/json] rule.                                                                                       |\n| [plugin:@ben_12/dprint/markdown-recommended]              | Enable the [@ben_12/dprint/markdown] rule.                                                                                   |\n| [plugin:@ben_12/dprint/toml-recommended]                  | Enable the [@ben_12/dprint/toml] rule.                                                                                       |\n| [plugin:@ben_12/dprint/typescript-recommended]            | Enable the [@ben_12/dprint/typescript] rule along with the [plugin:@ben_12/dprint/disable-typescript-conflict-rules] preset. |\n| [plugin:@ben_12/dprint/malva-recommended]                 | Enable the [@ben_12/dprint/malva] rule.                                                                                      |\n| [plugin:@ben_12/dprint/markup-recommended]                | Enable the [@ben_12/dprint/markup] rule.                                                                                     |\n| [plugin:@ben_12/dprint/yaml-recommended]                  | Enable the [@ben_12/dprint/yaml] rule.                                                                                       |\n| [plugin:@ben_12/dprint/graphql-recommended]               | Enable the [@ben_12/dprint/graphql] rule.                                                                                    |\n\n- Put the [plugin:@ben_12/dprint/recommended] or [plugin:@ben_12/dprint/disable-conflict-rules] config into the last of your `extends` list in order to ensure disabling conflict rules where came from other base configurations.\n\n## 📰 Changelog\n\nSee [GitHub Releases](https://github.com/ben12/eslint-plugin-dprint/releases).\n\n## ❤️ Contributing\n\nWelcome contributing!\n\nPlease use GitHub's Issues/PRs.\n\n### Development Tools\n\n- `npm test` ... Run tests. It generates code coverage into `coverage` directory.\n- `npm run watch` ... Run tests when files are edited.\n- `npm version \u003cpatch|minor|major\u003e` ... Bump a new version.\n\n[dprint]: https://github.com/dprint/dprint\n[@dprint/dockerfile]: https://github.com/dprint/dprint-plugin-dockerfile\n[@dprint/json]: https://github.com/dprint/dprint-plugin-json\n[@dprint/markdown]: https://github.com/dprint/dprint-plugin-markdown\n[@dprint/toml]: https://github.com/dprint/dprint-plugin-toml\n[@dprint/typescript]: https://github.com/dprint/dprint-plugin-typescript\n[malva]: https://github.com/g-plane/malva\n[markup_fmt]: https://github.com/g-plane/markup_fmt\n[pretty_yaml]: https://github.com/g-plane/pretty_yaml\n[pretty_graphql]: https://github.com/g-plane/pretty_graphql\n[npm]: https://www.npmjs.com/\n[@ben_12/dprint/dockerfile]: docs/rules/dprint-dockerfile.md\n[@ben_12/dprint/json]: docs/rules/dprint-json.md\n[@ben_12/dprint/markdown]: docs/rules/dprint-markdown.md\n[@ben_12/dprint/toml]: docs/rules/dprint-toml.md\n[@ben_12/dprint/typescript]: docs/rules/dprint-typescript.md\n[@ben_12/dprint/malva]: docs/rules/dprint-malva.md\n[@ben_12/dprint/markup]: docs/rules/dprint-markup.md\n[@ben_12/dprint/yaml]: docs/rules/dprint-yaml.md\n[@ben_12/dprint/graphql]: docs/rules/dprint-graphql.md\n[plugin:@ben_12/dprint/disable-typescript-conflict-rules]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/disable-typescript-conflict-rules.ts\n[plugin:@ben_12/dprint/dockerfile-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L3\n[plugin:@ben_12/dprint/json-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L10\n[plugin:@ben_12/dprint/markdown-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L17\n[plugin:@ben_12/dprint/toml-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L24\n[plugin:@ben_12/dprint/typescript-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L31\n[plugin:@ben_12/dprint/malva-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L39\n[plugin:@ben_12/dprint/markup-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L46\n[plugin:@ben_12/dprint/yaml-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L53\n[plugin:@ben_12/dprint/graphql-recommended]: https://github.com/ben12/eslint-plugin-dprint/blob/master/lib/configs/recommended.ts#L60\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben12%2Feslint-plugin-dprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben12%2Feslint-plugin-dprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben12%2Feslint-plugin-dprint/lists"}