Last active
August 23, 2019 12:07
-
-
Save dannyockilson/9c63ccff88a9bc52e084fb19120efe53 to your computer and use it in GitHub Desktop.
get lint staged working with angular cli (v8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
module.exports = { | |
'*.ts': relativePaths => { | |
return [ | |
`ng lint --fix --files ${relativePaths.join(' --files ')}`, | |
`git add ${relativePaths.join(' ')}`, | |
]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// normal package.json stuff | |
"dependencies": {}, | |
"devDependencies": { | |
// other stuff here | |
"husky": "^3.0.4", | |
"lint-staged": "^9.2.3", | |
}, | |
"husky": { | |
"hooks": { | |
"pre-commit": "lint-staged -r", | |
"pre-push": "npm test" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment