Visual Studio Code Formatting fail on save

前端 未结 11 1505
悲哀的现实
悲哀的现实 2021-01-08 00:21

I\'ve started learning React Native.

I\'m using Visual Studio Code as my editor.

I\'ve set up the boiler plate and started the app. But whenever I change a .

11条回答
  •  误落风尘
    2021-01-08 01:02

    You should search for "format" in settings.json. You'll find a whole lot of TypeScript/JavaScript formatting tweaks in there, but the one that stands out to me is:

      // Defines space handling after opening and before closing non empty brackets.
      "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false
    

    Alternative, you're not a fan of formatting at all, you can turn it off entirely:

      // Enable/disable default JavaScript formatter.
      "javascript.format.enable": true,
    

    However, a lot of my formatting options come from language server extensions, so if you're using one for React Native specifically, be sure to check the attributes in settings.json, or the docs to see if there are any attributes you can add.

提交回复
热议问题