Skip to content

Instantly share code, notes, and snippets.

@4sskick
Created October 8, 2021 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 4sskick/3ac14d268efed9ab31c3ac9b622b16d0 to your computer and use it in GitHub Desktop.
Save 4sskick/3ac14d268efed9ab31c3ac9b622b16d0 to your computer and use it in GitHub Desktop.
in vscode I already formetter beautify to format whenever I saved change on files. But while I work with react native, plugin Beautify can't handle to format the code. I don't know why.
I decide to install another plugin formatter, called 'prettier'. To install it foollow the command:
- type ctr+shift+P it gonna open bar tab on the fly to execute some commands
- type `install extension` and Enter
- look for Prettier - Code formatter then install. Wait till finished
- you need to setup to make pretiier work for default formatter whenever you code
- open setting, by navigate cursor on `file -> preferences -> settings` look for `edit in settings.json` on tab extensions
- change into `"editor.defaultFormatter": "esbenp.prettier-vscode"` also `"editor.formatOnSave": true,` and `"prettier.eslintIntegration": true,`
- restart vscode by type `ctrl+shift+P` type `reload windows`
@4sskick
Copy link
Author

4sskick commented Oct 8, 2021

when something doesn't feel right, follow this config

{
  "editor.defaultFormatter": null,
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

then continue to reload window

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