Skip to content

Commit

Permalink
feature(@putout/plugin-remove-empty-pattern) keep
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Mar 14, 2020
1 parent c203253 commit 2ad1f8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -3,8 +3,8 @@
module.exports.report = () => 'Empty pattern';

module.exports.replace = () => ({
'const {} = __': '',
'const [] = __': '',
'const {} = __a': '__a',
'const [] = __a': '__a',
'([]) => __a': '() => __a',
'({}) => __a': '() => __a',
});
Expand Down
Expand Up @@ -16,12 +16,12 @@ test('plugin-remove-empty-pattern: report: array', (t) => {
});

test('plugin-remove-empty-pattern: object', (t) => {
t.transformCode('const {} = object', '');
t.transformCode('const {} = object;', 'object;');
t.end();
});

test('plugin-remove-empty-pattern: array', (t) => {
t.transformCode('const [] = array', '');
t.transformCode('const [] = array', 'array;');
t.end();
});

Expand Down

0 comments on commit 2ad1f8c

Please sign in to comment.