Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a = fs.readFileSync('pla.txt');
- var b = a
- .toString()
- .split(/^\n/gm)
- .map(x => x.split('\n'))
- .map(([file, ...errors]) => ({
- file,
- errors: errors.filter(err => err.includes('import/no-unused-modules')),
- }))
- .flatMap(err =>
- // filename : line number ' ' identifier remove quotes
- err.errors.map(
- str => err.file + ':' + str.match(/\d+/) + ' ' + str.match(/(?!declaration )'(\w+)'/g)[0].slice(1, -1)
- )
- )
- .join('\n');
- fs.writeFileSync('out.txt', b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement