SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var a = fs.readFileSync('pla.txt');
  2.  
  3. var b = a
  4.   .toString()
  5.   .split(/^\n/gm)
  6.   .map(x => x.split('\n'))
  7.   .map(([file, ...errors]) => ({
  8.     file,
  9.     errors: errors.filter(err => err.includes('import/no-unused-modules')),
  10.   }))
  11.   .flatMap(err =>
  12.     //                    filename    :    line number        ' '   identifier                               remove quotes
  13.     err.errors.map(
  14.       str => err.file + ':' + str.match(/\d+/) + ' ' + str.match(/(?!declaration )'(\w+)'/g)[0].slice(1, -1)
  15.     )
  16.   )
  17.   .join('\n');
  18.  
  19. fs.writeFileSync('out.txt', b);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top