Configure Pre-commit & CI Linter
... | @@ -9,7 +9,9 @@ | ... | @@ -9,7 +9,9 @@ |
"test": "jest --coverage --watchAll=false --verbose --collectCoverageFrom=\"src/**/*.tsx\"", | "test": "jest --coverage --watchAll=false --verbose --collectCoverageFrom=\"src/**/*.tsx\"", | ||
"test-only": "jest -t", | "test-only": "jest -t", | ||
"lint": "eslint . --ext .ts,.tsx --fix", | "lint": "eslint . --ext .ts,.tsx --fix", | ||
"prettify": "prettier --write src" | "prettify": "prettier --write src", | ||
"prep": "npx mrm lint-staged", | |||
"prepare": "husky install" | |||
}, | }, | ||
"dependencies": { | "dependencies": { | ||
"@react-native-community/async-storage": "^1.12.1", | "@react-native-community/async-storage": "^1.12.1", | ||
... | @@ -45,7 +47,7 @@ | ... | @@ -45,7 +47,7 @@ |
"babel-jest": "^25.1.0", | "babel-jest": "^25.1.0", | ||
"babel-plugin-module-resolver": "^4.0.0", | "babel-plugin-module-resolver": "^4.0.0", | ||
"eslint": "^6.5.1", | "eslint": "^6.5.1", | ||
"husky": "^5.2.0", | "husky": "^6.0.0", | ||
"jest": "^25.1.0", | "jest": "^25.1.0", | ||
"jest-transform-stub": "^2.0.0", | "jest-transform-stub": "^2.0.0", | ||
"lint-staged": "^10.5.4", | "lint-staged": "^10.5.4", | ||
... | @@ -56,15 +58,11 @@ | ... | @@ -56,15 +58,11 @@ |
"resolutions": { | "resolutions": { | ||
"@types/react": "^16" | "@types/react": "^16" | ||
}, | }, | ||
"husky": { | |||
"hooks": { | |||
"pre-commit": "lint-staged" | |||
} | |||
}, | |||
"lint-staged": { | "lint-staged": { | ||
"./src/*.{ts,tsx}": [ | "./src/*.{ts,tsx}": [ | ||
"yarn run lint", | "yarn run lint", | ||
"yarn run prettify" | "yarn run prettify" | ||
] | ], | ||
"*.{ts,tsx}": "eslint --cache --fix" | |||
} | } | ||
} | } |
Please register or sign in to comment