Skip to content

Commit

Permalink
attempt to fix lint-staged for both win and mac
Browse files Browse the repository at this point in the history
  • Loading branch information
telamonian committed Jan 15, 2020
1 parent 2ee8ef2 commit ba3bcf3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .lintstagedrc

This file was deleted.

14 changes: 14 additions & 0 deletions lint-staged.config.js
@@ -0,0 +1,14 @@
const escape = require('shell-quote').quote;
const isWin = process.platform === 'win32';

module.exports = {
'**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}': filenames => {
const escapedFileNames = filenames
.map(filename => `"${isWin ? filename : escape([filename])}"`)
.join(' ');
return [
`prettier --write ${escapedFileNames}`,
`git add ${escapedFileNames}`
];
}
};
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -99,6 +99,7 @@
"lerna": "^3.19.0",
"lint-staged": "^9.5.0",
"prettier": "^1.19.1",
"shell-quote": "^1.7.2",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -13734,7 +13734,7 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shell-quote@1.7.2:
shell-quote@1.7.2, shell-quote@^1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2"
integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==
Expand Down

0 comments on commit ba3bcf3

Please sign in to comment.