Skip to content

younho9/prettier-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@younho9/prettier-config

Shared prettier config that personally prefer

Install

$ npm install --save-dev prettier @younho9/prettier-config

Usage

Add prettier key to your package.json

	"keywords": ["prettier"],
+	"prettier": "@younho9/prettier-config",
	"license": "MIT",
	"main": "index.js"

npm scripts

// package.json
{
	"scripts": {
		"format": "prettier --write . --ignore-path ./node_modules/@younho9/prettier-config/.prettierignore"
	}
}

lint-staged

// package.json
{
	"lint-staged": {
		"*": [
			"prettier --write --ignore-path ./node_modules/@younho9/prettier-config/.prettierignore"
		]
	}
}

format on save (VSCode)

// .vscode/settings.json
{
	"editor.defaultFormatter": "esbenp.prettier-vscode",
	"editor.formatOnSave": true,
	"prettier.ignorePath": "./node_modules/@younho9/prettier-config/.prettierignore"
}

License

MIT