@putout/plugin-gitignore 3.1.0 β 5.0.0
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 +2 -2
- package/lib/gitignore.js +10 -11
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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
|
-
π[
|
|
6
|
+
π[**Putout**](https://github.com/coderaiser/putout) plugin helps with π[**Putout**](https://github.com/coderaiser/putout) plugins development.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ npm i @putout/plugin-gitignore -D
|
|
|
13
13
|
|
|
14
14
|
## Rules
|
|
15
15
|
|
|
16
|
-
By default, all files enebled, if you want disable some of them use `
|
|
16
|
+
By default, all files enebled, if you want disable some of them use `dismiss` property:
|
|
17
17
|
|
|
18
18
|
```json
|
|
19
19
|
{
|
package/lib/gitignore.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import {types, operator} from 'putout';
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const {__ignore} = operator;
|
|
4
4
|
const {StringLiteral} = types;
|
|
5
5
|
const getValue = ({value}) => value;
|
|
6
6
|
|
|
@@ -11,15 +11,15 @@ const names = [
|
|
|
11
11
|
'coverage',
|
|
12
12
|
];
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
export const report = () => `Dot files should be added to .gitignore`;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
export const match = ({options}) => {
|
|
17
17
|
const {dismiss = []} = options;
|
|
18
18
|
const newNames = filterNames(names, dismiss);
|
|
19
19
|
|
|
20
20
|
return {
|
|
21
|
-
|
|
22
|
-
const list =
|
|
21
|
+
[__ignore]: ({__array}) => {
|
|
22
|
+
const list = __array.elements.map(getValue);
|
|
23
23
|
|
|
24
24
|
for (const name of newNames) {
|
|
25
25
|
if (!list.includes(name))
|
|
@@ -31,17 +31,17 @@ module.exports.match = ({options}) => {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
export const replace = ({options}) => {
|
|
35
35
|
const {dismiss = []} = options;
|
|
36
36
|
const newNames = filterNames(names, dismiss);
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
|
-
|
|
40
|
-
const list =
|
|
39
|
+
[__ignore]: ({__array}, path) => {
|
|
40
|
+
const list = __array.elements.map(getValue);
|
|
41
41
|
|
|
42
42
|
for (const name of newNames) {
|
|
43
43
|
if (!list.includes(name))
|
|
44
|
-
|
|
44
|
+
__array.elements.push(StringLiteral(name));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
return path;
|
|
@@ -61,4 +61,3 @@ function filterNames(names, dismiss) {
|
|
|
61
61
|
|
|
62
62
|
return newNames;
|
|
63
63
|
}
|
|
64
|
-
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/plugin-gitignore",
|
|
3
|
-
"version": "
|
|
4
|
-
"type": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "πPutout plugin helps with .gitignore",
|
|
7
7
|
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/plugin-gitignore#readme",
|
|
8
8
|
"main": "lib/gitignore.js",
|
|
9
9
|
"release": false,
|
|
@@ -31,21 +31,21 @@
|
|
|
31
31
|
"gitignore"
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@putout/test": "^
|
|
35
|
-
"c8": "^
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"eslint-plugin-putout": "^
|
|
39
|
-
"lerna": "^
|
|
40
|
-
"madrun": "^
|
|
41
|
-
"nodemon": "^
|
|
34
|
+
"@putout/test": "^9.0.0",
|
|
35
|
+
"c8": "^9.0.0",
|
|
36
|
+
"eslint": "^9.0.0-alpha.0",
|
|
37
|
+
"eslint-plugin-n": "^17.0.0-0",
|
|
38
|
+
"eslint-plugin-putout": "^22.0.0",
|
|
39
|
+
"lerna": "^6.0.1",
|
|
40
|
+
"madrun": "^10.0.0",
|
|
41
|
+
"nodemon": "^3.0.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"putout": ">=
|
|
44
|
+
"putout": ">=35"
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
48
|
+
"node": ">=18"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|