eslint-plugin-putout
Version:
ESLint plugin for 🐊Putout
22 lines (16 loc) • 485 B
JavaScript
export const category = 'object';
export const report = () => 'Remove empty import specifiers';
export const filter = ({text, node, getCommentsInside}) => {
const comments = getCommentsInside(node);
if (comments.length)
return false;
return text.includes('{}');
};
export const fix = ({text}) => {
return text
.replace('import {} from', 'import')
.replace(/,? {}/, '');
};
export const include = () => [
'ImportDeclaration',
];