eslint-plugin-putout
Version:
ESLint plugin for 🐊Putout
24 lines (15 loc) • 469 B
JavaScript
;
const alignSpaces = require('align-spaces');
const alignedMap = new Map();
module.exports.report = () => 'Keep whitespaces in blank lines';
module.exports.include = () => ['Program'];
module.exports.fix = ({text}) => {
return alignedMap.get(text);
};
module.exports.filter = ({text}) => {
const aligned = alignSpaces(text);
if (text === aligned)
return false;
alignedMap.set(text, aligned);
return true;
};