Skip to content

Format On Save not working on VSCODE (Windows 10) #1640

Description

@jbersamin-vitech

I tried to search on close/open issues but no avail.

What is wrong with my settings? Please help. Thanks

Prettier 2.2.1

PHP Plugin 0.16.1

package.json

    "devDependencies": {
        "@prettier/plugin-php": "^0.16.1",
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "prettier": "^2.2.1"
    }

.prettierrc.json:

{
    "useTabs": true,
    "overrides": [
        {
            "files": ["*.p"],
            "options": {
                "parser": "php",
                "phpVersion": "7.4",
                "braceStyle": "1tbs",
                "embeddedLanguageFormatting": "off",
                "singleQuote": true
            }
        }
    ]
}

My VS Code Settings:

    "editor.formatOnSave": false,
    "[php]": {
        "editor.formatOnSave": true,
        "editor.formatOnPaste": true
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode",

Expected behavior:

Activity

  1. nicoder commented on Feb 5, 2021

    @nicoder
    Contributor

    hi @jbersamin-vitech ,

    (I don't know much about this but) this line of your .prettierrc.json stood out to me:

    "files": ["*.p"],

    should it be *.php ?

    (or maybe your php files have a .p extension)

  2. jbersamin-vitech commented on Feb 10, 2021

    @jbersamin-vitech
    Author

    @nicoder I tried to change it to .php and still not working. If I could just see any errors in the output inside the VSCODE. I could have fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions