If you only want to run esLint and stylelint really only for staged files. Don't forget to adjust the source paths.
Last active
February 14, 2023 09:58
-
-
Save iceteabottle/452d9bc11e97ca0aaf5a8cb08d1489e5 to your computer and use it in GitHub Desktop.
Lint only staged files #lint-staged #stylelint
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
module.exports = { | |
'{**/*,**}.{html,ts,js}': (filesArray) => { | |
const files = filesArray.join(' '); | |
return [ | |
`npx eslint --fix ${files}`, | |
]; | |
}, | |
'{apps,libs}/**/*.scss': (filesArray) => { | |
const files = filesArray.join(','); | |
return [ | |
`npx stylelint --fix "{${files}}"`, | |
]; | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment