Skip to content

Commit 37a32c4

Browse files
committed
feature: @putout/plugin-filesystem: remove-ds-store-file: add
1 parent e1c44e5 commit 37a32c4

File tree

9 files changed

+50
-0
lines changed

9 files changed

+50
-0
lines changed

packages/plugin-filesystem/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ npm i @putout/plugin-filesystem -D
2525
-[remove-travis-yml-file](#remove-travis-yml-file);
2626
-[remove-vim-swap-file](#remove-vim-swap-file);
2727
-[remove-nyc-output-files](#remove-nyc-output-files);
28+
-[remove-ds-store-file](#remove-ds-store-file);
2829
-[remove-files](#remove-files);
2930
-[rename-referenced-file](#rename-referenced-file);
3031
-[rename-spec-to-test](#rename-spec-to-test);
@@ -39,6 +40,7 @@ npm i @putout/plugin-filesystem -D
3940
"rules": {
4041
"filesystem/remove-empty-directory": "on",
4142
"filesystem/remove-travis-yml-file": "on",
43+
"filesystem/remove-ds-store-file": "on",
4244
"filesystem/remove-vim-swap-file": "on",
4345
"filesystem/remove-nyc-output-files": "on",
4446
"filesystem/bundle": "off",
@@ -123,6 +125,12 @@ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/52d8126f3e
123125
-| `-- def/
124126
```
125127

128+
## remove-ds-store-file
129+
130+
```diff
131+
-.DS_Store
132+
```
133+
126134
## remove-nyc-output-files
127135

128136
Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/52d8126f3e41b687c6028852a1925db7/5efcb17493ad5ebe8f1786075a985e1dd35ea59e).

packages/plugin-filesystem/lib/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import * as convertJsToJson from './convert-js-to-json/index.js';
1616
import * as removeNycOutputFiles from './remove-nyc-output-files/index.js';
1717
import * as removeTravisYmlFile from './remove-travis-yml-file/index.js';
1818
import * as removeEmptyDirectory from './remove-empty-directory/index.js';
19+
import * as removeDsStoreFile from './remove-ds-store-file/index.js';
1920

2021
export const rules = {
2122
'remove-vim-swap-file': removeVimSwapFile,
@@ -36,4 +37,5 @@ export const rules = {
3637
'remove-nyc-output-files': removeNycOutputFiles,
3738
'remove-travis-yml-file': removeTravisYmlFile,
3839
'remove-empty-directory': removeEmptyDirectory,
40+
'remove-ds-store-file': removeDsStoreFile,
3941
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__putout_processor_filesystem(["/"]);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__putout_processor_filesystem([
2+
'/',
3+
'/.DS_Store',
4+
]);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {createRemoveFiles} from '../create-remove-files.js';
2+
3+
export const {
4+
report,
5+
fix,
6+
scan,
7+
} = createRemoveFiles('.DS_Store');
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {createTest} from '@putout/test';
2+
import * as plugin from './index.js';
3+
4+
const test = createTest(import.meta.url, {
5+
plugins: [
6+
['remove-ds-store-file', plugin],
7+
],
8+
});
9+
10+
test('putout: plugin-filesystem: remove-ds-store-file: report', (t) => {
11+
t.report('remove-ds-store-file', `Remove '.DS_Store': '/.DS_Store'`);
12+
t.end();
13+
});
14+
15+
test('putout: plugin-filesystem: remove-ds-store-file: transform', (t) => {
16+
t.transform('remove-ds-store-file');
17+
t.end();
18+
});

packages/plugin-filesystem/test/filesystem.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,8 @@ test('plugin-filesystem: transform: remove-empty-directory', (t) => {
9696
t.transform('remove-empty-directory');
9797
t.end();
9898
});
99+
100+
test('plugin-filesystem: transform: remove-ds-store-file', (t) => {
101+
t.transform('remove-ds-store-file');
102+
t.end();
103+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__putout_processor_filesystem(["/"]);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__putout_processor_filesystem([
2+
'/',
3+
'/.DS_Store',
4+
]);

0 commit comments

Comments
 (0)