Skip to content

Commit 5d39f66

Browse files
author
Kent C. Dodds
committed
custom config for lint-staged
1 parent 7a57626 commit 5d39f66

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lint-staged.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const config = require('kcd-scripts/dist/config/lintstagedrc')
2+
3+
// we need to exclude the test and lint scripts on commit because we run it in the validate script
4+
const jsLinter = Object.keys(config.linters).find(key => key.includes('js'))
5+
config.linters[jsLinter] = config.linters[jsLinter].filter(
6+
script => !script.includes('test') && !script.includes('lint'),
7+
)
8+
9+
module.exports = config

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"build": "kcd-scripts build",
1212
"lint": "kcd-scripts lint",
1313
"test": "echo TODO",
14+
"test:ci": "echo TODO",
1415
"test:update": "npm test -- --updateSnapshot --coverage",
15-
"validate": "kcd-scripts validate",
16+
"validate": "kcd-scripts validate build,lint,test",
1617
"setup": "npm install && npm run validate -s",
1718
"precommit": "kcd-scripts precommit"
1819
},

0 commit comments

Comments
 (0)