Skip to content
This repository was archived by the owner on Apr 17, 2024. It is now read-only.

Commit 9190c85

Browse files
authored
add pre commit hook (#11)
* add pre commit hook * ignore scripts in docker file
1 parent c07ae72 commit 9190c85

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
.git/
44
.idea/
55
.github/
6+
.husky/
7+
coverage/
68
dist/
79
e2e/
810
node_modules/

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run lint

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ RUN chown node:node /home/node/app
66
WORKDIR /home/node/app
77

88
COPY --chown=node ./package*.json ./
9-
ARG INSTALL_ARGS="--production --no-fund --no-audit"
9+
ARG INSTALL_ARGS="--production --no-fund --no-audit --ignore-scripts"
1010
RUN npm clean-install $INSTALL_ARGS
1111

1212
FROM base as build
13-
ARG INSTALL_DEV_ARGS="--no-fund --no-audit"
13+
ARG INSTALL_DEV_ARGS="--no-fund --no-audit --ignore-scripts"
1414
RUN npm install $INSTALL_DEV_ARGS
1515
COPY --chown=node ./ ./
1616
RUN npm run build:ssr

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"name": "bss-web",
33
"version": "0.0.0",
4-
"workspaces": ["e2e"],
4+
"workspaces": [
5+
"e2e"
6+
],
57
"scripts": {
68
"ng": "ng",
79
"start": "ng serve",
@@ -12,7 +14,8 @@
1214
"serve:ssr": "node dist/bss-web/server/main.js",
1315
"build:ssr": "ng build && ng run bss-web:server",
1416
"prerender": "ng run bss-web:prerender",
15-
"lint": "ng lint"
17+
"lint": "ng lint",
18+
"prepare": "husky install"
1619
},
1720
"private": true,
1821
"dependencies": {
@@ -49,6 +52,7 @@
4952
"eslint": "^8.5.0",
5053
"eslint-config-prettier": "^8.3.0",
5154
"eslint-plugin-prettier": "^4.0.0",
55+
"husky": "^7.0.4",
5256
"jasmine-core": "~3.10.1",
5357
"karma": "~6.3.9",
5458
"karma-chrome-launcher": "~3.1.0",

0 commit comments

Comments
 (0)