Skip to content

Commit

Permalink
fix: Improve lint stage (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
sh977218 authored Dec 15, 2023
1 parent 7bad3e2 commit 24b8011
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Code Coverage"
],
"scripts": {
"preinstall": "node scripts/preinstall.js",
"postinstall": "npx husky install",
"ng": "ng",
"start": "ng s",
Expand Down Expand Up @@ -81,7 +82,9 @@
"v8-to-istanbul": "^9.1.0"
},
"lint-staged": {
"*.{js,ts,css,scss,html,md}": "prettier --write"
"*.{js,ts,css,scss,html,md}": [
"prettier --write"
]
},
"engines": {
"node": "20.x.x",
Expand Down
27 changes: 27 additions & 0 deletions scripts/preinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
if (
process.env.npm_execpath.indexOf("npm") === -1 &&
process.env.npm_execpath.indexOf("yarn") === -1
) {
throw new Error(`
###################################################
# #
# Please use Yarn > 1.3 to install dependencies #
# #
# 1. Install yarn (https://yarnpkg.com/) #
# 2. Run 'yarn' #
# #
###################################################
OR
###################################################
# #
# Please use NPM to install dependencies #
# #
# 1. Install npm (https://npmjs.com/) #
# 2. Run 'npm install' #
# #
###################################################
`);
}

0 comments on commit 24b8011

Please sign in to comment.