mirror of
https://github.com/mudita/mudita-center.git
synced 2025-12-23 22:28:03 -05:00
chore: pre commit hook now works for staged files only
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
. "$(dirname "$0")/_/husky.sh"
|
. "$(dirname "$0")/_/husky.sh"
|
||||||
|
|
||||||
npm run lint
|
npm run pre-commit
|
||||||
./node_modules/.bin/lint-staged
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"*.{js,json,css,md,ts,tsx}": ["prettier --write"],
|
|
||||||
"packages/**/*.{js,json,css,md,ts,tsx}": ["prettier --write"],
|
|
||||||
}
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
"productName": "Mudita Center",
|
"productName": "Mudita Center",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"pre-commit": "lint-staged",
|
||||||
"setup": "npm install && npm run bootstrap:local",
|
"setup": "npm install && npm run bootstrap:local",
|
||||||
"bootstrap:local": "lerna bootstrap",
|
"bootstrap:local": "lerna bootstrap",
|
||||||
"bootstrap:ci": "lerna bootstrap --no-ci",
|
"bootstrap:ci": "lerna bootstrap --no-ci",
|
||||||
|
|||||||
9
packages/app/.lintstagedrc
Normal file
9
packages/app/.lintstagedrc
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"*.{js,json,css,md,ts,tsx}": [
|
||||||
|
"prettier --write"
|
||||||
|
],
|
||||||
|
"*.{ts,tsx}": [
|
||||||
|
"npm run lint:css:lint-staged",
|
||||||
|
"npm run lint:js:lint-staged"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -18,8 +18,10 @@
|
|||||||
"dev:start:renderer": "webpack serve --config webpack.config.renderer.js",
|
"dev:start:renderer": "webpack serve --config webpack.config.renderer.js",
|
||||||
"LINT COMMANDS": "=========================================================",
|
"LINT COMMANDS": "=========================================================",
|
||||||
"lint": "npm run lint:js && npm run lint:css",
|
"lint": "npm run lint:js && npm run lint:css",
|
||||||
|
"lint:css:lint-staged": "stylelint",
|
||||||
"lint:css": "stylelint '{src,test,mocks}/**/*.{ts,tsx}'",
|
"lint:css": "stylelint '{src,test,mocks}/**/*.{ts,tsx}'",
|
||||||
"lint:js": "eslint '{src,test,mocks}/**/*.{ts,tsx}' --max-warnings=0",
|
"lint:js": "eslint '{src,test,mocks}/**/*.{ts,tsx}' --max-warnings=0",
|
||||||
|
"lint:js:lint-staged": "eslint --max-warnings=0",
|
||||||
"lint:typecheck": "tsc --noEmit",
|
"lint:typecheck": "tsc --noEmit",
|
||||||
"lint:fix": "npm run lint:js -- --fix",
|
"lint:fix": "npm run lint:js -- --fix",
|
||||||
"DIST COMMANDS": "=========================================================",
|
"DIST COMMANDS": "=========================================================",
|
||||||
|
|||||||
5
packages/e2e/.lintstagedrc
Normal file
5
packages/e2e/.lintstagedrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"*.{js,json,css,md,ts,tsx}": [
|
||||||
|
"prettier --write"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user