stylelint-prettier icon indicating copy to clipboard operation
stylelint-prettier copied to clipboard

Ignored vue file style block?

Open ModyQyW opened this issue 2 years ago • 2 comments
trafficstars

What version of stylelint, prettier and stylelint-prettier are you using?

  • stylelint: 15.10.2
  • prettier: 3.0.2
  • stylelint-prettier: 4.0.2
  • node: 18.16.0
  • npm: 9.5.1

Please paste any applicable config files that you're using (e.g. .prettierrc or .stylelintrc files)

No prettier config files.

.stylelintrc.json:

{
  "extends": [
    "stylelint-config-html",
    "stylelint-config-recommended",
    "stylelint-config-recommended-vue",
    "stylelint-prettier/recommended"
  ],
  "rules": {
    "at-rule-no-unknown": null
  }
}

What source code are you linting?

<style>
.insert {
  display: block
}

.alter:after {color: red; content: 'example'}

.delete {
  display: block;;
}
</style>

What did you expect to happen?

Output like README.

What actually happened?

Nothing happened.

Repo

https://github.com/ModyQyW/stylelint-prettier-322

npm install
npm run stylelint

If I run npm run prettier, I can see the output is correct. So I think it is caused by stylelint-prettier.

ModyQyW avatar Aug 16 '23 05:08 ModyQyW

This appears to be intentional, see https://github.com/prettier/stylelint-prettier/blob/d9b427f5a9952b469fa41bf3e905a84baa65aa27/stylelint-prettier.js#L78-L98

mattlyons0 avatar Nov 05 '23 20:11 mattlyons0

I totally miss that. Thanks for pointing it out!

However, I think it is depressing. I have to run stylelint and prettier separately. Hope we can improve this. 🫡

ModyQyW avatar Nov 06 '23 10:11 ModyQyW

Since Stylelint has decided to deprecate all the stylistic rules, I think it is better to run Stylelint and Prettier separately.

ModyQyW avatar May 06 '24 09:05 ModyQyW