Skip to content

Commit

Permalink
fix(config): Use named bin in lintstagedrc.js (#3)
Browse files Browse the repository at this point in the history
* fix(config): Use named bin in lintstagedrc.js

* docs(contributors): Add @sudo-suhas
  • Loading branch information
sudo-suhas authored and Kent C. Dodds committed Sep 20, 2017
1 parent 8a34fa5 commit 78d450c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"infra",
"test"
]
},
{
"login": "sudo-suhas",
"name": "Suhas Karanth",
"avatar_url": "https://avatars2.githubusercontent.com/u/22251956?v=4",
"profile": "https://github.com/sudo-suhas",
"contributions": [
"code"
]
}
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![downloads][downloads-badge]][npmcharts]
[![MIT License][license-badge]][LICENSE]

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc]

Expand Down Expand Up @@ -107,8 +107,8 @@ here! Again, this is a very specific-to-me solution.
Thanks goes to these people ([emoji key][emojis]):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub>Kent C. Dodds</sub>](https://kentcdodds.com)<br />[💻](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Code") [📖](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Documentation") [🚇](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Tests") |
| :---: |
| [<img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;"/><br /><sub>Kent C. Dodds</sub>](https://kentcdodds.com)<br />[💻](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Code") [📖](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Documentation") [🚇](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/kentcdodds/kcd-scripts/commits?author=kentcdodds "Tests") | [<img src="https://avatars2.githubusercontent.com/u/22251956?v=4" width="100px;"/><br /><sub>Suhas Karanth</sub>](https://github.com/sudo-suhas)<br />[💻](https://github.com/kentcdodds/kcd-scripts/commits?author=sudo-suhas "Code") |
| :---: | :---: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors][all-contributors] specification.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"test:update": "node src test --updateSnapshot",
"build": "node src build",
"lint": "node src lint",
"format": "node src format",
"validate": "node src validate",
"precommit": "node src precommit"
"precommit": "node src precommit",
"kcd-scripts": "dist/index.js"
},
"files": ["dist", "babel.js", "eslint.js", "config.js"],
"keywords": [],
Expand Down
12 changes: 4 additions & 8 deletions src/config/lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
const [executor] = process.argv

const scripts = `${executor} ${require.resolve('../')}`

module.exports = {
linters: {
'**/*.+(js|json|less|css|ts)': [
`${scripts} format`,
`${scripts} lint`,
`${scripts} test --findRelatedTests`,
'kcd-scripts format',
'kcd-scripts lint',
'kcd-scripts test --findRelatedTests',
'git add',
],
'.all-contributorsrc': [
// lint-staged passes arguments to the scripts.
// to avoid passing these arguments, we do the echo thing
`${scripts} contributors generate`,
'kcd-scripts contributors generate',
'git add README.md',
],
},
Expand Down

0 comments on commit 78d450c

Please sign in to comment.