@putout/plugin-gitignore 7.0.2 β†’ 7.0.4

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 CHANGED
@@ -3,7 +3,11 @@
3
3
  [NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-gitignore.svg?style=flat&longCache=true
4
4
  [NPMURL]: https://npmjs.org/package/@putout/plugin-gitignore "npm"
5
5
 
6
- 🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with 🐊[**Putout**](https://github.com/coderaiser/putout) plugins development.
6
+ > A `.gitignore` file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected.
7
+ >
8
+ > (c) [git-scm.com](https://git-scm.com/docs/gitignore)
9
+
10
+ 🐊[**Putout**](https://github.com/coderaiser/putout) plugin helps with `.gitignore`.
7
11
 
8
12
  ## Install
9
13
 
@@ -13,48 +17,70 @@ npm i @putout/plugin-gitignore -D
13
17
 
14
18
  ## Rules
15
19
 
16
- By default, all files enabled, if you want disable some of them use `dismiss` property:
20
+ - βœ… [add](#add);
21
+ - βœ… [sort](#sort);
22
+
23
+ ## Config
17
24
 
18
25
  ```json
19
26
  {
20
27
  "rules": {
21
- "gitignore": ["on", {
28
+ "gitignore/add": ["on", {
22
29
  "dismiss": [
23
30
  "*.swp",
24
31
  "coverage",
25
32
  "*.lock",
26
33
  "*.log"
27
34
  ]
28
- }]
35
+ }],
36
+ "gitignore/sort": "on"
29
37
  }
30
38
  }
31
39
  ```
32
40
 
33
- ## Add Putoutcache
41
+ ## add
34
42
 
35
- Adds `.putoutcache` into .gitignore.
43
+ Adds `.putoutcache`, `*.swp`, `.idea`:
36
44
 
37
45
  ```diff
38
46
  node_modules
39
47
  +.putoutcache
48
+ +*.swp
49
+ +.idea
40
50
  ```
41
51
 
42
- ## Add Vim Files
52
+ ## sort
43
53
 
44
- Adds `*.swp` into .gitignore.
54
+ ### ❌ Example of incorrect code
45
55
 
46
- ```diff
47
- +*.swp
56
+ ```ignore
48
57
  node_modules
58
+ *.swp
59
+ yarn-error.log
60
+ yarn.lock
61
+ .idea
62
+ .DS_Store
63
+ deno.lock
64
+
65
+ coverage
66
+ .filesystem.json
49
67
  ```
50
68
 
51
- ## Add `.idea` Files
69
+ ### βœ… Example of correct code
52
70
 
53
- Adds `*.swp` into .gitignore.
71
+ ```ignore
72
+ .idea
73
+ .filesystem.json
74
+ .DS_Store
75
+
76
+ *.swp
77
+
78
+ yarn-error.log
79
+ yarn.lock
80
+ deno.lock
54
81
 
55
- ```diff
56
- +.idea
57
82
  node_modules
83
+ coverage# sort
58
84
  ```
59
85
 
60
86
  ## License
package/lib/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import * as add from './add/index.js';
2
+ import * as sort from './sort/index.js';
3
+
4
+ export const rules = {
5
+ add,
6
+ sort,
7
+ };
@@ -0,0 +1,11 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {sortIgnore} = operator;
4
+
5
+ export const {
6
+ fix,
7
+ report,
8
+ traverse,
9
+ } = sortIgnore({
10
+ name: '.gitignore',
11
+ });
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@putout/plugin-gitignore",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with .gitignore",
7
7
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-gitignore#readme",
8
- "main": "lib/gitignore.js",
8
+ "main": "lib/index.js",
9
9
  "release": false,
10
10
  "tag": false,
11
11
  "changelog": false,
File without changes