-1

Whenever i enter click save my '.js ' file undergoes an indentation change . I have disabled beautify and prettier . Any other suggestion ? Here's the error that occured

asked Jun 8, 2020 at 14:00
5
  • Disable format on save ? Commented Jun 8, 2020 at 14:02
  • how do i do that ? Commented Jun 8, 2020 at 14:03
  • CTRL SHIFT P -> >Preferences: Open User Settings -> Editor: Format on Save Commented Jun 8, 2020 at 14:04
  • not working brother ? Commented Jun 8, 2020 at 14:08
  • 1
    Does this answer your question? How to exclude files from "format on save" in VSCode? Commented Jun 8, 2020 at 14:09

2 Answers 2

1

It's definetly because of some Formatter being applied on codeActionsOnSave.

I see you got a notification in the bottom right from VS Code, often this informs you when linters collide.

Also check your settings.json of VS Code, found under Preferences> Settings> top right corner icon. It might be that there are some linters specified for specific files and also the codeActionsOnSave.

Alternatively you can create a .vscode folder in your root folder containing a settings.json that sets workspace specific rules that overwrite your VS Code settings for that workspace. E.g.

{
 "editor.formatOnSave": false,
}
answered Jun 8, 2020 at 14:08
Sign up to request clarification or add additional context in comments.

Comments

0

Check if you have installed any "Linters" on VS code. Here is the link if you want to know what are these: https://code.visualstudio.com/docs/languages/javascript#_linters

or Probably it is the formatting issue:

The javascript.format.* settings configure the built-in formatter. Or, if the built-in formatter is getting in the way, set "javascript.format.enable" to false to disable it. Link: https://code.visualstudio.com/docs/languages/javascript#_formatting

answered Jun 8, 2020 at 14:30

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.