Skip to content

Commit 1303573

Browse files
authored
docs: Update screencast and installation instructions
Suggest to use `npx mrm lint-staged` to simplify initial installation and setup of both husky and lint-staged.
1 parent 0be88a0 commit 1303573

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

README.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Run linters against staged git files and don't let :poop: slip into your code base!
44

5-
The latest versions of `lint-staged` require Node.js v8.6 or newer. (Versions of `lint-staged` prior to v7 still work with Node.js v4.)
5+
[![asciicast](https://asciinema.org/a/199934.svg)](https://asciinema.org/a/199934)
66

77
## Why
88

@@ -21,41 +21,23 @@ This project contains a script that will run arbitrary shell tasks with a list o
2121
2222
## Installation and setup
2323

24-
> A fast way to perform the below is to run `npx mrm lint-staged`. It does most of the setup for you.
24+
The fastest way to start using lint-staged is to run following command in your terminal:
2525

26-
1. `npm install --save-dev lint-staged husky`
27-
1. Install and setup your linters just like you would do normally. Add appropriate `.eslintrc`, `.stylelintrc`, etc.
28-
1. Update your `package.json` like this:
26+
```bash
27+
npx mrm lint-staged
28+
```
2929

30-
```diff json
31-
{
32-
+ "husky": {
33-
+ "hooks": {
34-
+ "pre-commit": "lint-staged"
35-
+ }
36-
+ },
37-
+ "lint-staged": {
38-
+ "*.js": ["eslint --fix", "git add"]
39-
+ }
40-
}
41-
```
30+
It will install and configure [husky](https://github.com/typicode/husky) and lint-staged depending on code quality tools from `package.json` dependencies so please make sure you install (`npm install --save-dev`) and configure all code quality tools like [Prettier](https://prettier.io), [ESlint](https://eslint.org) prior that.
4231

43-
Now change a few files, `git add` some of them to your commit and try to `git commit` them.
32+
Don't forget to commit changes to `package.json` to share this setup with your team!
4433

45-
This is how it looks in action:
34+
Now change a few files, `git add` or `git add --patch` some of them to your commit and try to `git commit` them.
4635

47-
<p align="center">
48-
<img src="./screenshots/lint-staged-prettier.gif" alt="lint-staged with prettier example"
49-
width="640" height="432">
50-
</p>
51-
52-
See [examples](#examples) and [configuration](#configuration) below.
53-
54-
> I recommend using [husky](https://github.com/typicode/husky) to manage git hooks but you can use any other tool.
36+
See [examples](#examples) and [configuration](#configuration) for more information.
5537

5638
## Changelog
5739

58-
[releases](https://github.com/okonet/lint-staged/releases)
40+
See [Releases](https://github.com/okonet/lint-staged/releases)
5941

6042
## Command line flags
6143

@@ -204,7 +186,7 @@ Tools like [Prettier](https://prettier.io), ESLint/TSLint, or stylelint can refo
204186

205187
```json
206188
{
207-
"*.js": ["eslint --fix", "git add"]
189+
"*.js": ["prettier --write", "git add"]
208190
}
209191
```
210192

0 commit comments

Comments
 (0)