Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Init pre commit hook and gitmoji
Browse files Browse the repository at this point in the history
  • Loading branch information
KirianCaumes committed May 30, 2023
1 parent b83253b commit 04afde4
Show file tree
Hide file tree
Showing 11 changed files with 600 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ USER $USERNAME
RUN sudo apt-get clean
RUN sudo apt-get update
RUN sudo apt-get -y install curl
RUN sudo apt-get -y install nano
RUN sudo apt-get -y install git
RUN sudo apt-get update --fix-missing
RUN export EDITOR="/usr/bin/nano"

# install nodejs 18.x
RUN sudo curl -sL https://deb.nodesource.com/setup_18.x | sudo bash -
RUN sudo apt-get install -y nodejs
RUN sudo npm i -g nodemon
RUN sudo npm i -g np
RUN npx playwright install-deps chromium
RUN sudo npm i -g nodemon@2.0.22
RUN sudo npm i -g np@7.7.0
RUN sudo npm i -g gitmoji-cli@7.0.2

WORKDIR /app_discogs-marketplace-api-nodejs
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "discogs-marketplace-api-nodejs",
"dockerComposeFile": "docker-compose.yml",
"postCreateCommand": "bash .devcontainer/init.sh",
"service": "discogs-marketplace-api-nodejs_container",
"workspaceFolder": "/app_discogs-marketplace-api-nodejs",
"customizations": {
Expand Down
4 changes: 4 additions & 0 deletions .devcontainer/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

echo "🏠 Installing packages"
(npm ci && chmod ug+x .husky/*)
6 changes: 6 additions & 0 deletions .gitmojirc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"autoAdd": false,
"emojiFormat": "emoji",
"scopePrompt": true,
"gitmojisUrl": "https://gitmoji.dev/api/gitmojis"
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# gitmoji as a commit hook
exec < /dev/tty
gitmoji --hook $1 $2
8 changes: 8 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* {@link https://github.com/okonet/lint-staged#configuration} Documentation
* @type {import('lint-staged').Config}
*/
module.exports = {
'*.{ts,tsx,js,jsx}': ['prettier --ignore-unknown', 'eslint'],
'*.{html,json,svg,yml,xml}': ['prettier --ignore-unknown'],
}
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ coverage
notes.md
.eslintrc.cjs
.prettierignore
.prettierrc.js
.prettierrc.js
.gitmojirc.json
.lintstagedrc.js
17 changes: 14 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{
"editor.formatOnSave": true,
"[typescriptreact][typescript][javascript][css][scss][html][json]": {
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
"editor.defaultFormatter": "vscode.markdown-language-features"
},
"editor.codeActionsOnSave": {
"source.fixAll": true
Expand All @@ -18,5 +27,7 @@
"path": "/bin/bash",
"icon": "terminal-bash"
}
}
},
"typescript.preferences.importModuleSpecifier": "non-relative",
"javascript.preferences.importModuleSpecifier": "non-relative"
}
Loading

0 comments on commit 04afde4

Please sign in to comment.