Skip to content

Commit ba3a562

Browse files
committed
feature: @putout/plugin-filesystem: remove-vim-swap-file: .swo
1 parent 99a3c62 commit ba3a562

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__putout_processor_filesystem({
2+
"type": "directory",
3+
"filename": "home/coderaiser/putout",
4+
"files": [{
5+
"type": "file",
6+
"filename": "/home/coderaiser/putout/README.md"
7+
}, {
8+
"type": "directory",
9+
"filename": "/home/coderaiser/putout/lib",
10+
"files": []
11+
}]
12+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
__putout_processor_filesystem({
2+
"type": "directory",
3+
"filename": "home/coderaiser/putout",
4+
"files": [{
5+
"type": "file",
6+
"filename": "/home/coderaiser/putout/README.md",
7+
}, {
8+
"type": "directory",
9+
"filename": "/home/coderaiser/putout/lib",
10+
"files": [{
11+
"type": "file",
12+
"filename": "/home/coderaiser/putout/lib/.swo",
13+
}]
14+
}]
15+
});

packages/plugin-filesystem/lib/remove-vim-swap-file/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {
44
report,
55
fix,
66
scan,
7-
} = createRemoveFiles('*.swp');
7+
} = createRemoveFiles(['*.swp', '*.swo']);
88

99
export {
1010
report,

packages/plugin-filesystem/lib/remove-vim-swap-file/index.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const test = createTest(import.meta.url, {
88
});
99

1010
test('packages: remove-vim-swap-file: report', (t) => {
11-
t.report('remove-vim-swap-file', `Remove '*.swp': '/home/coderaiser/putout/lib/putout.js.swp'`);
11+
t.report('remove-vim-swap-file', `Remove '*.swp,*.swo': '/home/coderaiser/putout/lib/putout.js.swp'`);
1212
t.end();
1313
});
1414

@@ -17,6 +17,11 @@ test('packages: remove-vim-swap-file: transform', (t) => {
1717
t.end();
1818
});
1919

20+
test('packages: remove-vim-swap-file: transform: swo', (t) => {
21+
t.transform('swo');
22+
t.end();
23+
});
24+
2025
test('packages: remove-vim-swap-file: progress', async ({progress}) => {
2126
await progress('remove-vim-swap-file', {
2227
i: 1,

0 commit comments

Comments
 (0)