lint-staged 8.1.4 → 8.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -29
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Run linters against staged git files and don't let :poop: slip into your code base!
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://asciinema.org/a/199934)
|
|
6
6
|
|
|
7
7
|
## Why
|
|
8
8
|
|
|
@@ -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
|
-
|
|
24
|
+
The fastest way to start using lint-staged is to run following command in your terminal:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
```bash
|
|
27
|
+
npx mrm lint-staged
|
|
28
|
+
```
|
|
29
29
|
|
|
30
|
-
|
|
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
|
-
|
|
32
|
+
Don't forget to commit changes to `package.json` to share this setup with your team!
|
|
44
33
|
|
|
45
|
-
|
|
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
|
-
|
|
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.
|
|
55
37
|
|
|
56
38
|
## Changelog
|
|
57
39
|
|
|
58
|
-
[
|
|
40
|
+
See [Releases](https://github.com/okonet/lint-staged/releases)
|
|
59
41
|
|
|
60
42
|
## Command line flags
|
|
61
43
|
|
|
@@ -204,7 +186,7 @@ Tools like [Prettier](https://prettier.io), ESLint/TSLint, or stylelint can refo
|
|
|
204
186
|
|
|
205
187
|
```json
|
|
206
188
|
{
|
|
207
|
-
"*.js": ["
|
|
189
|
+
"*.js": ["prettier --write", "git add"]
|
|
208
190
|
}
|
|
209
191
|
```
|
|
210
192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lint-staged",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.5",
|
|
4
4
|
"description": "Lint files staged by git",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/okonet/lint-staged",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@iamstarkov/listr-update-renderer": "0.4.1",
|
|
33
32
|
"chalk": "^2.3.1",
|
|
34
33
|
"commander": "^2.14.1",
|
|
35
34
|
"cosmiconfig": "^5.0.2",
|
|
@@ -42,6 +41,7 @@
|
|
|
42
41
|
"is-glob": "^4.0.0",
|
|
43
42
|
"is-windows": "^1.0.2",
|
|
44
43
|
"listr": "^0.14.2",
|
|
44
|
+
"listr-update-renderer": "^0.5.0",
|
|
45
45
|
"lodash": "^4.17.11",
|
|
46
46
|
"log-symbols": "^2.2.0",
|
|
47
47
|
"micromatch": "^3.1.8",
|