Skip to content

Commit

Permalink
Adjust Commit Linting Hook (#9694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer authored and ijjk committed Dec 11, 2019
1 parent e11cf22 commit 338e08b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .prettierignore_staged
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.next/**
**/_next/**
**/dist/**
8 changes: 5 additions & 3 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ module.exports = {
.map(filename => `"${isWin ? filename : escape([filename])}"`)
.join(' ')
return [
`prettier --write ${escapedFileNames}`,
`eslint --max-warnings=0 --fix ${filenames.map(f => `"${f}"`).join(' ')}`,
`prettier --with-node-modules --ignore-path='./.prettierignore_staged' --write ${escapedFileNames}`,
`eslint --no-ignore --max-warnings=0 --fix ${filenames
.map(f => `"${f}"`)
.join(' ')}`,
`git add ${escapedFileNames}`,
]
},
Expand All @@ -17,7 +19,7 @@ module.exports = {
.map(filename => `"${isWin ? filename : escape([filename])}"`)
.join(' ')
return [
`prettier --write ${escapedFileNames}`,
`prettier --with-node-modules --ignore-path='./.prettierignore_staged' --write ${escapedFileNames}`,
`git add ${escapedFileNames}`,
]
},
Expand Down

0 comments on commit 338e08b

Please sign in to comment.