this is the base configuration of Prettier is used in the Projects made by BrainyLab Development.
# npm
npm i --save-dev @brainylab/prettier-config
#yarn
yarn add -D @brainylab/prettier-config
#pnpm
pnpm add -D @brainylab/prettier-config
#bun
bun add -d @brainylab/prettier-config
create file .eslintrc.json in main project folder, add the lines below in the file.
-
Remove existing config file, example
.prettierrc
. -
Add code to:
// package.json
"prettier": "@brainylab/prettier-config",
// .prettierrc.js
module.exports = {
...require('@brainylab/prettier-config'),
};
// prettier.config.js
import prettierConfig from '@brainylab/prettier-config';
export default {
...prettierConfig,
};
and configure VS Code add:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Install
Prettier Plugin on VSCode:
MIT