https://github.com/lttb/gitignored
https://github.com/lttb/gitignored
gitignore gitignore-files precommit-hooks
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/lttb/gitignored
- Owner: lttb
- License: mit
- Created: 2017-12-20T23:44:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-25T13:00:28.000Z (almost 8 years ago)
- Last Synced: 2025-02-22T00:26:54.556Z (10 months ago)
- Topics: gitignore, gitignore-files, precommit-hooks
- Language: JavaScript
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitignored
Check if staged files should be ignored by some of [https://github.com/github/gitignore](https://github.com/github/gitignore).
## Installation
```sh
npm install --save-dev gitignored
```
## Usage
### lint-staged
Recommended way is to use `gitignored` as a pre-commit hook with [lint-staged](https://github.com/okonet/lint-staged).
For example `package.json`:
```json
"lint-staged": {
"*": "gitignored"
},
"gitignored": {
"types": ["Global/macOS", "Global/Linux"]
}
```
### CLI
```sh
gitignored -t Global/macOS,Global/Linux file1 file2
```
## Config
- package.json
.gitignoredrc
yaml
```json
types:
- Global/macOS
- Global/Linux
```
json
```json
{
"types": ["Global/macOS", "Global/Linux"]
}
```