Automattic / wp-prettier

Prettier is an opinionated JavaScript formatter.
https://prettier.github.io/prettier/
MIT License
51 stars 1 forks source link

Causing trouble with stylelint in VSCode #32

Closed shivapoudel closed 3 years ago

shivapoudel commented 3 years ago

It is not respecting .stylelintrc.json config file within VSCode while setting prettier as default formatter.

{
    "extends": "@wordpress/stylelint-config",
    "rules": {
        "at-rule-empty-line-before": null,
        "at-rule-no-unknown": null,
        "comment-empty-line-before": null,
        "font-weight-notation": null,
        "max-line-length": null,
        "no-descending-specificity": null,
        "rule-empty-line-before": null,
        "selector-class-pattern": null,
        "value-keyword-case": null
    }
}

I do also have Stylelint VSCode extension but still prettier is prioritized on save but won't respect stylelint config. Every time I save an SCSS file prettier is the default formatter and it somehow overrides stylint double-quotes because I do have config for prettier like this in .prettierrc.js:

// Import the default config file and expose it in the project root.
// Useful for editor integrations.
module.exports = require( '@wordpress/prettier-config' );

Problem is this: image

CC @ntwb