Skip to content

Instantly share code, notes, and snippets.

@dannyockilson
Last active August 23, 2019 12:07
Show Gist options
  • Save dannyockilson/9c63ccff88a9bc52e084fb19120efe53 to your computer and use it in GitHub Desktop.
Save dannyockilson/9c63ccff88a9bc52e084fb19120efe53 to your computer and use it in GitHub Desktop.
get lint staged working with angular cli (v8)
const path = require('path')
module.exports = {
'*.ts': relativePaths => {
return [
`ng lint --fix --files ${relativePaths.join(' --files ')}`,
`git add ${relativePaths.join(' ')}`,
];
}
}
{
// 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