{"id":13682742,"url":"https://github.com/prettier/stylelint-prettier","last_synced_at":"2025-05-14T02:08:39.301Z","repository":{"id":33078738,"uuid":"139522331","full_name":"prettier/stylelint-prettier","owner":"prettier","description":"Stylelint plugin for Prettier formatting","archived":false,"fork":false,"pushed_at":"2025-03-01T08:27:40.000Z","size":664,"stargazers_count":370,"open_issues_count":3,"forks_count":21,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T04:33:56.230Z","etag":null,"topics":["prettier","stylelint","stylelint-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettier.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"prettier","open_collective":"prettier","thanks_dev":"u/gh/prettier","tidelift":"npm/prettier"}},"created_at":"2018-07-03T03:12:28.000Z","updated_at":"2025-04-20T08:26:36.000Z","dependencies_parsed_at":"2023-01-14T23:16:47.250Z","dependency_job_id":"9b5f175f-312e-4f9f-93ce-b1071e78c2d0","html_url":"https://github.com/prettier/stylelint-prettier","commit_stats":{"total_commits":136,"total_committers":12,"mean_commits":"11.333333333333334","dds":"0.21323529411764708","last_synced_commit":"b1b25ca7e0e9b6b079e3eda48b42604a6fb0cdde"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fstylelint-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fstylelint-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fstylelint-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettier%2Fstylelint-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettier","download_url":"https://codeload.github.com/prettier/stylelint-prettier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253579288,"owners_count":21930706,"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":["prettier","stylelint","stylelint-plugin"],"created_at":"2024-08-02T13:01:52.335Z","updated_at":"2025-05-14T02:08:39.260Z","avatar_url":"https://github.com/prettier.png","language":"JavaScript","funding_links":["https://github.com/sponsors/prettier","https://opencollective.com/prettier","https://thanks.dev/u/gh/prettier","https://tidelift.com/funding/github/npm/prettier"],"categories":["JavaScript"],"sub_categories":[],"readme":"# stylelint-prettier [![Build Status](https://github.com/prettier/stylelint-prettier/workflows/CI/badge.svg?branch=main)](https://github.com/prettier/stylelint-prettier/actions?query=workflow%3ACI+branch%3Amain)\n\nRuns [Prettier](https://github.com/prettier/prettier) as a [Stylelint](https://stylelint.io/) rule and reports differences as individual Stylelint issues.\n\n## Sample\n\nGiven the input file `style.css`:\n\n\u003c!-- prettier-ignore --\u003e\n```css\n.insert {\n  display: block\n}\n\n.alter:after {color: red; content: 'example'}\n\n.delete {\n  display: block;;\n}\n\n```\n\nRunning `./node_modules/.bin/stylelint style.css` shall output:\n\n```\nstyle.css\n 2:17  ✖  Insert \";\"                                          prettier/prettier\n 5:15  ✖  Replace \"color:·red;·content:·'example'\" with       prettier/prettier\n          \"⏎··color:·red;⏎··content:·\"example\";⏎\"\n 8:17  ✖  Delete \";\"                                          prettier/prettier\n```\n\n## Installation\n\n```sh\nnpm install --save-dev stylelint-prettier prettier\n```\n\n**_`stylelint-prettier` does not install Prettier or Stylelint for you._** _You must install these yourself._\n\nThen, in your `.stylelintrc`:\n\n```json\n{\n  \"plugins\": [\"stylelint-prettier\"],\n  \"rules\": {\n    \"prettier/prettier\": true\n  }\n}\n```\n\nAlternatively you can extend from the `stylelint-prettier/recommended` config,\nwhich does the same thing:\n\n```json\n{\n  \"extends\": [\"stylelint-prettier/recommended\"]\n}\n```\n\n## Disabling rules that may conflict with Prettier\n\nAs of Stylelint v15, [Stylelint deprecated all stylistic rules that conflict\nwith prettier](https://stylelint.io/migration-guide/to-15/#deprecated-stylistic-rules), and [removed these rules](https://stylelint.io/migration-guide/to-16/#removed-deprecated-stylistic-rules) in Stylelint v16.\nIf you are using Stylelint v15 or above and are not using any of these deprecated rules then you do not need to do anything extra; this section does not apply to you.\n\nIf you are using Stylelint's stylistic rules, then many of them shall conflict with Prettier. This plugin works best if you disable all other Stylelint rules relating to stylistic opinions. If another active Stylelint rule disagrees with `prettier` about how code should be formatted, it will be impossible to avoid lint errors. You should use [stylelint-config-prettier](https://github.com/prettier/stylelint-config-prettier) to disable all stylistic Stylelint rules.\n\nTo integrate this plugin with `stylelint-config-prettier`:\n\n1. In addition to the above installation instructions, install `stylelint-config-prettier`:\n\n   ```sh\n   npm install --save-dev stylelint-config-prettier\n   ```\n\n2. Then add `stylelint-config-prettier` to the list of extended configs in your `.stylelintrc` that you added in the prior section. `stylelint-config-prettier` should go last in the array so that it will override other configs:\n\n   ```json\n   {\n     \"extends\": [\n       \"stylelint-prettier/recommended\",\n       \"stylelint-config-prettier\"\n     ]\n   }\n   ```\n\nYou can then set Prettier's own options inside a `.prettierrc` file.\n\n## Options\n\n_stylelint-prettier will honor your `.prettierrc` file by default_. You only\nneed this section if you wish to override those settings.\n\n\u003e Note: While it is possible to pass options to Prettier via your Stylelint configuration file, it is not recommended because editor extensions such as `prettier-atom` and `prettier-vscode` **will** read [`.prettierrc`](https://prettier.io/docs/en/configuration.html), but **won't** read settings from Stylelint, which can lead to an inconsistent experience.\n\nObjects are passed directly to Prettier as [options](https://prettier.io/docs/en/options.html). Example:\n\n```json\n{\n  \"rules\": {\n    \"prettier/prettier\": [true, {\"singleQuote\": true, \"tabWidth\": 4}]\n  }\n}\n```\n\nNB: This option will merge and override any config set with `.prettierrc` files (for Prettier \u003c 1.7.0, config files are ignored)\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/prettier/stylelint-prettier/blob/main/.github/CONTRIBUTING.md)\n\n## Inspiration\n\nThe layout for this codebase and base configuration of prettier was taken from \u003chttps://github.com/prettier/eslint-plugin-prettier\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettier%2Fstylelint-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettier%2Fstylelint-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettier%2Fstylelint-prettier/lists"}