forked from signalapp/Signal-Desktop
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2891 from yougotwill/dx_commit_experience
Improved Git Committing
- Loading branch information
Showing
9 changed files
with
1,218 additions
and
213 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no -- commitlint --edit "$1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const ignoredFiles = [ | ||
'package.json', | ||
'yarn.lock', | ||
'tsconfig.json', | ||
'.lintstagedrc.js', | ||
'.eslintrc.js', | ||
]; | ||
|
||
const path = require('path'); | ||
|
||
const buildFormatCommand = filenames => { | ||
const results = filenames | ||
.map(f => path.relative(process.cwd(), f)) | ||
.filter(f => !ignoredFiles.includes(f)); | ||
|
||
return results.length ? `prettier --list-different --write ${results.join(' ')}` : ''; | ||
}; | ||
|
||
const buildLintCommand = filenames => { | ||
const results = filenames | ||
.map(f => path.relative(process.cwd(), f)) | ||
.filter(f => !ignoredFiles.includes(f)); | ||
|
||
return results.length ? `eslint ${results.join(' ')}` : ''; | ||
}; | ||
|
||
module.exports = { | ||
'*.{css,js,json,scss,ts,tsx}': [buildFormatCommand, buildLintCommand], | ||
}; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; |
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
Oops, something went wrong.