Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint-staged for both win and mac #7784

Merged
merged 1 commit into from Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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