You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,41 +21,23 @@ This project contains a script that will run arbitrary shell tasks with a list o
21
21
22
22
## Installation and setup
23
23
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:
25
25
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
+
```
29
29
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.
42
31
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!
44
33
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.
46
35
47
-
<palign="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.
0 commit comments