mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #596] [MERGED] Feature: Add prettier/pretty-quick formatting w/ Husky pre-commit #2735
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#2735
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/596
Author: @dihmeetree
Created: 2/24/2020
Status: ✅ Merged
Merged: 2/25/2020
Merged by: @jamesgeorge007
Base:
master← Head:feature/prettier-formatting📝 Commits (10+)
b0f5ab9Add prettier/husky config1543c99Fix prettier function777e629Initial prettier formatted files241abd3Final prettier formatted file97f5ffcRemove the ts,tsx from prettier functionb8b2dfdChange yarn to npm run7dc702cMerge branch 'master' into feature/prettier-formattingc2befaeIgnore build.js file (Prettier)19c9c54Revert "Ignore build.js file (Prettier)"c635d21Fix package-lock.json file📊 Changes
86 files changed (+3533 additions, -3546 deletions)
View changed files
➕
.huskyrc(+5 -0)➕
.prettierignore(+7 -0)➕
.prettierrc(+6 -0)📝
assets/js/curlparser.js(+95 -99)📝
assets/js/oauth.js(+72 -83)📝
assets/js/pwa.js(+21 -26)📝
build.js(+22 -26)📝
components/ace-editor.vue(+26 -28)📝
components/autocomplete.vue(+46 -48)📝
components/collections/addCollection.vue(+16 -18)📝
components/collections/addFolder.vue(+11 -11)📝
components/collections/collection.vue(+15 -23)📝
components/collections/editCollection.vue(+15 -15)📝
components/collections/editFolder.vue(+12 -17)📝
components/collections/editRequest.vue(+29 -50)📝
components/collections/folder.vue(+14 -14)📝
components/collections/importExportCollections.vue(+99 -137)📝
components/collections/index.vue(+54 -56)📝
components/collections/request.vue(+9 -13)📝
components/collections/saveRequestAs.vue(+55 -91)...and 66 more files
📄 Description
Husky (https://github.com/typicode/husky) allows us to run commands before initial commits to the repo are made/PR's are pushed. In this scenario, husky runs
yarn prettierto format all of the files within the repo before being staged. This is done in the.huskyrcfile like so (this can be moved to thepackage.jsonfile if we want):I've used an opinionated Prettier config
.prettierrcwhich look's like the following (this can be moved to thepackage.jsonfile if we want):The command that is added to the
package.jsonis the following:"prettier": "prettier --write **/*.{html,js,json,vue}"This tells Prettier what files can be formatted.
The reason for this PR is to clean up the code quality and formatting within the repo, to one that's consistent (updated by Prettier).
Note: This does not affect how new code must be written or formatted. You can code/format in any way you would like, and Prettier will format it right before changes are committed to the repo/PR is made.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.