Modify lint-staged - Run prettier and eslint only on changed files

This commit is contained in:
2019-08-10 13:46:21 +05:30
parent 6cd41bc4bd
commit 400757182f
2 changed files with 12 additions and 2 deletions
+10 -1
View File
@@ -1,3 +1,12 @@
module.exports = {
"*.{js,jsx,ts,tsx}": () => "run-s check:* lint"
"*.{js,jsx,ts,tsx}": filenames => {
// Escape filenames and join by space
const joinedFilenames = filenames.map(str => `"${str}"`).join(" ");
return [
"run-s check:!(format)",
`npm run check:format -- ${joinedFilenames}`,
`npm run _lint -- ${joinedFilenames}`
];
// `run-s check:!(format) "check:format -- ${joinedFilenames}" "_lint -- ${joinedFilenames}"`;
}
};