Skip to content

Commit

Permalink
custom config for lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Apr 6, 2018
1 parent 7a57626 commit 5d39f66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const config = require('kcd-scripts/dist/config/lintstagedrc')

// we need to exclude the test and lint scripts on commit because we run it in the validate script
const jsLinter = Object.keys(config.linters).find(key => key.includes('js'))
config.linters[jsLinter] = config.linters[jsLinter].filter(
script => !script.includes('test') && !script.includes('lint'),
)

module.exports = config
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
"build": "kcd-scripts build",
"lint": "kcd-scripts lint",
"test": "echo TODO",
"test:ci": "echo TODO",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate",
"validate": "kcd-scripts validate build,lint,test",
"setup": "npm install && npm run validate -s",
"precommit": "kcd-scripts precommit"
},
Expand Down

0 comments on commit 5d39f66

Please sign in to comment.