diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-01-10 01:43:23 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-01-10 11:09:08 +0100 |
commit | 526dc3ee63d308aef1ba2c75cd7a9cc4c9577a73 (patch) | |
tree | bb0f3c7365b90b007e48b9b9f209aec08138ada5 /package.json | |
parent | build: Add eslint-plugin-security (diff) | |
download | sophie-526dc3ee63d308aef1ba2c75cd7a9cc4c9577a73.tar.gz sophie-526dc3ee63d308aef1ba2c75cd7a9cc4c9577a73.tar.zst sophie-526dc3ee63d308aef1ba2c75cd7a9cc4c9577a73.zip |
build: Add pre-commit hook
Run lint and tests on source files changes.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'package.json')
-rw-r--r-- | package.json | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/package.json b/package.json index d8b27b1..062d358 100644 --- a/package.json +++ b/package.json | |||
@@ -28,14 +28,17 @@ | |||
28 | "watch": "node scripts/watch.js", | 28 | "watch": "node scripts/watch.js", |
29 | "watch:test": "yarn test --watch", | 29 | "watch:test": "yarn test --watch", |
30 | "lint": "yarn types && yarn lint:only", | 30 | "lint": "yarn types && yarn lint:only", |
31 | "lint:only": "cross-env NODE_OPTIONS=\"--max-old-space-size=16384\" eslint . --ext .cjs,.js,.jsx,.ts,.tsx", | ||
32 | "lint:ci": "yarn lint:only --format gitlab", | 31 | "lint:ci": "yarn lint:only --format gitlab", |
32 | "lint:only": "yarn lint:eslint . --ext .cjs,.js,.jsx,.ts,.tsx", | ||
33 | "lint:precommit": "yarn types && yarn lint:eslint --fix", | ||
34 | "lint:eslint": "cross-env NODE_OPTIONS=\"--max-old-space-size=16384\" eslint", | ||
33 | "typecheck": "yarn types && yarn typecheck:ci", | 35 | "typecheck": "yarn types && yarn typecheck:ci", |
34 | "typecheck:ci": "yarn workspaces foreach -vp run typecheck:workspace", | 36 | "typecheck:ci": "yarn workspaces foreach -vp run typecheck:workspace", |
35 | "typecheck:workspace": "yarn g:typecheck", | 37 | "typecheck:workspace": "yarn g:typecheck", |
36 | "g:typecheck": "cd $INIT_CWD && tsc", | 38 | "g:typecheck": "cd $INIT_CWD && tsc", |
37 | "types": "yarn workspaces foreach -vpt run types", | 39 | "types": "yarn workspaces foreach -vpt run types", |
38 | "g:types": "cd $INIT_CWD && tsc -b tsconfig.build.json", | 40 | "g:types": "cd $INIT_CWD && tsc -b tsconfig.build.json", |
41 | "postinstall": "is-ci || simple-git-hooks", | ||
39 | "update-electron-vendors": "node scripts/updateElectronVendors.js", | 42 | "update-electron-vendors": "node scripts/updateElectronVendors.js", |
40 | "main": "yarn workspace @sophie/main", | 43 | "main": "yarn workspace @sophie/main", |
41 | "preload": "yarn workspace @sophie/preload", | 44 | "preload": "yarn workspace @sophie/preload", |
@@ -50,6 +53,7 @@ | |||
50 | ], | 53 | ], |
51 | "devDependencies": { | 54 | "devDependencies": { |
52 | "@electron/fuses": "^1.5.0", | 55 | "@electron/fuses": "^1.5.0", |
56 | "@types/is-ci": "^3", | ||
53 | "@types/jest": "^27.4.0", | 57 | "@types/jest": "^27.4.0", |
54 | "@types/prettier": "^2", | 58 | "@types/prettier": "^2", |
55 | "@typescript-eslint/eslint-plugin": "^5.9.0", | 59 | "@typescript-eslint/eslint-plugin": "^5.9.0", |
@@ -77,9 +81,12 @@ | |||
77 | "eslint-plugin-security": "^1.4.0", | 81 | "eslint-plugin-security": "^1.4.0", |
78 | "eslint-plugin-unicorn": "^40.0.0", | 82 | "eslint-plugin-unicorn": "^40.0.0", |
79 | "git-repo-info": "^2.1.1", | 83 | "git-repo-info": "^2.1.1", |
84 | "is-ci": "^3.0.1", | ||
80 | "jest": "^27.4.7", | 85 | "jest": "^27.4.7", |
86 | "nano-staged": "^0.5.0", | ||
81 | "prettier": "^2.5.1", | 87 | "prettier": "^2.5.1", |
82 | "rimraf": "^3.0.2", | 88 | "rimraf": "^3.0.2", |
89 | "simple-git-hooks": "^2.7.0", | ||
83 | "typescript": "^4.5.4", | 90 | "typescript": "^4.5.4", |
84 | "vite": "^2.7.10" | 91 | "vite": "^2.7.10" |
85 | }, | 92 | }, |