Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no format on paste/save on v 1.50.0 #108365

Closed
BernardA opened this issue Oct 9, 2020 · 13 comments
Closed

no format on paste/save on v 1.50.0 #108365

BernardA opened this issue Oct 9, 2020 · 13 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) formatting Source formatter issues info-needed Issue requires more information from poster

Comments

@BernardA
Copy link

BernardA commented Oct 9, 2020

  • VSCode Version: 1.50.0
  • OS Version:Mas 10.15.7

Steps to Reproduce:

  1. save or paste unformatted code

Does this issue occur when all extensions are disabled?: Yes/No Not applicable as the issue is related to extensions ESLint or Prettier

This was working properly prior to latest update. Both ESLint and Prettier are shown as active

Note that is does show the errors as you can see on the enclosed image.

This is eslinrc.json

   {
"env": {
    "browser": true,
    "es2020": true
},
"extends": [
    //"plugin:react/recommended",
    "airbnb",
    // "prettier",
    "plugin:prettier/recommended",
    "prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
    "ecmaFeatures": {
        "jsx": true
    },
    "ecmaVersion": 11,
    "sourceType": "module"
},
"plugins": ["react", "react-hooks", "jsx-a11y", "import", "prettier"],
"rules": {
     ......
    "no-unused-expressions": [
        "error",
        {
            "allowShortCircuit": true
        }
    ],
    "quotes": [
        2,
        "single",
        {
            "avoidEscape": true,
            "allowTemplateLiterals": true
        }
    ]
},
"globals": {
    "React": "writable"
}
}

And prettier.rc

 {
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 4,
"printWidth": 90
}

Screenshot 2020-10-09 at 09 43 38

@pocojang
Copy link

pocojang commented Oct 9, 2020

I get the same issue

@RanSatious
Copy link

got the same issue
resolved by adding "editor.defaultFormatter": "esbenp.prettier-vscode" to settings.json

@dwk-tesseract
Copy link

same problem since updating vscode, RanSatious solution worked for me!

@cyntler
Copy link
Contributor

cyntler commented Oct 9, 2020

got the same issue
resolved by adding "editor.defaultFormatter": "esbenp.prettier-vscode" to settings.json

Thanks! It works fine.

@YoannBuzenet
Copy link

YoannBuzenet commented Oct 9, 2020

Same problem this morning and your solution works, thank you. But some autoformat cases that used to be formatted automatically are now just underlined by eslint. Do I have to update settings in .prettierrc too ? Or somewhere else ?

@ZnK88
Copy link

ZnK88 commented Oct 9, 2020

Bonjour,

Meme soucis sur la 1.50 c'est possible de le fix avec cette manipulation indiquez plus haut
prettier

@nathanshanahan
Copy link

got the same issue
resolved by adding "editor.defaultFormatter": "esbenp.prettier-vscode" to settings.json

This solution only solved the problem temporarily for me, on subsequent reload I'm seeing the failure to format issue resurface even though editor.defaultFormatter is set to esbenp.prettier-vscode.

@pabloluz
Copy link

I was running into the same issue. I can confirm @RanSatious and @ZnK88 solutions together worked like a charm.

@jrieken jrieken added formatting Source formatter issues info-needed Issue requires more information from poster labels Oct 15, 2020
@jrieken
Copy link
Member

jrieken commented Oct 15, 2020

Maybe the same as #108447

@BernardA
Copy link
Author

BernardA commented Oct 19, 2020

adding "editor.defaultFormatter": "esbenp.prettier-vscode" to settings.json seems to have resolved the format on save issue.
Format on paste still does not work though.

Note that in previous versions, "editor.defaultFormatter" was set to null and both format on save and paste worked fine.

Yes, I do have both format on paste and format on save checked on settings.

@nathanshanahan
Copy link

Was having issue with SCSS and JS files formatting but was not having the same luck with PHP files being ignored.

Solution for me was to remove the previous settings I had assigned in settings.json and reset by making the same selections through the newer settings interface.

@jrieken
Copy link
Member

jrieken commented Oct 20, 2020

/duplicate of #108447

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) formatting Source formatter issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

12 participants