@putout/plugin-gitignore 7.0.3 → 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
@@ -17,48 +17,70 @@ npm i @putout/plugin-gitignore -D
17
17
 
18
18
  ## Rules
19
19
 
20
- By default, all files enabled, if you want disable some of them use `dismiss` property:
20
+ - [add](#add);
21
+ - ✅ [sort](#sort);
22
+
23
+ ## Config
21
24
 
22
25
  ```json
23
26
  {
24
27
  "rules": {
25
- "gitignore": ["on", {
28
+ "gitignore/add": ["on", {
26
29
  "dismiss": [
27
30
  "*.swp",
28
31
  "coverage",
29
32
  "*.lock",
30
33
  "*.log"
31
34
  ]
32
- }]
35
+ }],
36
+ "gitignore/sort": "on"
33
37
  }
34
38
  }
35
39
  ```
36
40
 
37
- ## Add Putoutcache
41
+ ## add
38
42
 
39
- Adds `.putoutcache` into .gitignore.
43
+ Adds `.putoutcache`, `*.swp`, `.idea`:
40
44
 
41
45
  ```diff
42
46
  node_modules
43
47
  +.putoutcache
48
+ +*.swp
49
+ +.idea
44
50
  ```
45
51
 
46
- ## Add Vim Files
52
+ ## sort
47
53
 
48
- Adds `*.swp` into .gitignore.
54
+ ### Example of incorrect code
49
55
 
50
- ```diff
51
- +*.swp
56
+ ```ignore
52
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
53
67
  ```
54
68
 
55
- ## Add `.idea` Files
69
+ ### Example of correct code
56
70
 
57
- 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
58
81
 
59
- ```diff
60
- +.idea
61
82
  node_modules
83
+ coverage# sort
62
84
  ```
63
85
 
64
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.3",
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