@upthen/prettier-config

1.0.3 • Public • Published

prettier-config

upthen's personal prettier-config

Usages

  1. Install
npm i prettier @upthen/prettier-config@latest
  1. Set prettier

Add prettier config in package.json like the following codes:

{

  ...
  "prettier": "@upthen/prettier-config",
}
  1. Use in terminal

npx prettier --check --write path

npx prettier --check --write .

# or

npx prettier -c -w .

# . is the path of files you want to format.
  1. Use With VsCode Extension: Prettier
  • Install Prettier Extension
  • Add the following config in VsCode settings.json
{
	"editor.formatOnSave": true,
	"editor.defaultFormatter": "esbenp.prettier-vscode",
	"[javascript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	},
	"[typescript]": {
		"editor.defaultFormatter": "esbenp.prettier-vscode"
	}
}
  • If you have some custom setting config in your workspace settings.json, Confirm the prettier config won't be override. You may need to add the following config into it.
// workspace setttings.json
{
	"editor.formatOnSave": true,
	"editor.defaultFormatter": "esbenp.prettier-vscode"
}

[!IMPORTANT] Confirm to add the above config into settings.json, or it may not effects when you enter Ctrl + S or Command + S with VsCode Extension.

Readme

Keywords

Package Sidebar

Install

npm i @upthen/prettier-config

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

2.92 kB

Total Files

5

Last publish

Collaborators

  • cherishtheyouth