roberto-butti / some-drops-of-javascript

This book collects some useful, unknown, underrated JavaScript functions discovered and learned while using JavaScript daily.
https://drops-of-javascript.hi-folks.dev/
Other
151 stars 46 forks source link

#1 Issue Fixed : Added Prettier as Dev Dependency #2

Closed dushyantpant5 closed 1 year ago

dushyantpant5 commented 1 year ago

-> Added Prettier package as devDependencies -> Use npx prettier ./examples/ --write ornpm prettier ./examples/ --write -> Formatted existing files inside /examples

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
some-drops-of-javascript ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 24, 2023 7:02am
mahesha1150 commented 1 year ago

For npx prettier ./examples/ --write to work, prettier dependency should be added under devDependencies as below: Please check

"devDependencies": { "bun-types": "^1.0.3", "prettier": "^3.0.3" },

roberto-butti commented 1 year ago

For npx prettier ./examples/ --write to work, prettier dependency should be added under devDependencies as below: Please check

"devDependencies": { "bun-types": "^1.0.3", "prettier": "^3.0.3" },

Usually, i include prettier as devdependencies (this is why i created the issue, including the info for installing prettier as devdependency). But I see in the scripts section prettier is launched via npx, so it is not needed as a dependency.

roberto-butti commented 1 year ago

-> Added Prettier package as devDependencies -> Use npx prettier ./examples/ --write ornpm prettier ./examples/ --write -> Formatted existing files inside /examples

Thank you for this PR @dushyantpant5 . I have a question for you, what do you think if, for the .prettierrc file, we can set some default values like:

 {
   "trailingComma": "es5",
   "tabWidth": 4,
   "semi": false,
   "singleQuote": true
 }
dushyantpant5 commented 1 year ago

@roberto-butti If you want to add these rules , then I can make the changes. Please let me know. Also if there is any other thing to do.

roberto-butti commented 1 year ago

@roberto-butti If you want to add these rules , then I can make the changes. Please let me know. Also if there is any other thing to do.

Yes please @dushyantpant5 , set the .prettierrc . So, once we have some basic rules, in the future we can perform some fine tuning.

dushyantpant5 commented 1 year ago

@roberto-butti Updated the rules on prettier

roberto-butti commented 1 year ago

@roberto-butti Updated the rules on prettier

Amazing! thank you for the contribution!