prettier / plugin-php

Prettier PHP Plugin
https://loilo.github.io/prettier-php-playground/
MIT License
1.74k stars 128 forks source link

does not respect prettier printWidth in overrides since v0.22.0 #2341

Closed apasov closed 6 months ago

apasov commented 7 months ago

I have the following prettier config:

    "prettier": {
        "printWidth": 280,
        "semi": false,
        "singleQuote": true,
        "phpVersion": "8.2",
        "plugins": [
            "@prettier/plugin-php"
        ],
        "overrides": [
            {
                "files": [
                    "*.php"
                ],
                "options": {
                    "printWidth": 150,
                    "singleQuote": false
                }
            }
        ]
    },

Since v0.22.0 this plugin stopped respecting printWidth settings in overrides options and uses 280 instead. While singleQuote is respected correctly as it is set in overrides.

cseufert commented 6 months ago

Can you provide some example code, before and after formatting?

apasov commented 6 months ago

It was my mistake. The plugin just started treating printWidth differently since v0.22.0 It does respect options set in overrides.