Closed kirandash closed 1 year ago
The goal of this task is to make sure all the js files are formatted properly.
Install husky and prettier. And activate pre-commit hook.
Please use the following prettier settings:
{ "arrowParens": "avoid", "bracketSameLine": false, "bracketSpacing": true, "embeddedLanguageFormatting": "auto", "endOfLine": "lf", "htmlWhitespaceSensitivity": "css", "insertPragma": false, "jsxSingleQuote": false, "printWidth": 80, "proseWrap": "always", "quoteProps": "as-needed", "requirePragma": false, "semi": false, "singleAttributePerLine": false, "singleQuote": true, "tabWidth": 2, "trailingComma": "all", "useTabs": true }
Create a "prettier" script to run on all .js files ex: "prettier": "prettier \"**/*.+(js)\"",
.js
"prettier": "prettier \"**/*.+(js)\"",
Create a "check-format" script ex: "check-format": "npm run prettier -- --list-different",
Add "check-format" script to pre-commit file ex: npm run check-format
npm run check-format
Add a "format" script to help us format all files at once ex: "format": "npm run prettier -- --write"
"format": "npm run prettier -- --write"
If you need any clarification or help on how to implement this, please leave your comment here or on our discord server
I can do it
@MehmetTerc Thanks a lot for your contribution 🎉
The goal of this task is to make sure all the js files are formatted properly.
Install husky and prettier. And activate pre-commit hook.
Please use the following prettier settings:
Create a "prettier" script to run on all
.js
files ex:"prettier": "prettier \"**/*.+(js)\"",
Create a "check-format" script ex: "check-format": "npm run prettier -- --list-different",
Add "check-format" script to pre-commit file ex:
npm run check-format
Add a "format" script to help us format all files at once ex:
"format": "npm run prettier -- --write"
If you need any clarification or help on how to implement this, please leave your comment here or on our discord server