depcheck-babel-parser


A depcheck babel parser that uses an existing babel config instead of a fixed set of plugins.
Install
$ npm install depcheck-babel-parser
$ yarn add depcheck-babel-parser
Usage
Start by creating a .babelrc.json file with your babel config, if needed.
Custom parsers are currently only supported when using depcheck via the Node.js API. Simply add the parser to your parser config and run depcheck:
import depcheck from 'depcheck'
import babelParser from 'depcheck-babel-parser'
const options = {
parsers: {
'*.js': babelParser,
},
}
depcheck('/path/to/your/project', options, (unused) => {
console.log(unused.dependencies);
console.log(unused.devDependencies);
console.log(unused.missing);
console.log(unused.using);
console.log(unused.invalidFiles);
console.log(unused.invalidDirs);
})
License
Unless stated otherwise all works are:
Copyright © Sebastian Landwehr info@dword-design.de
and licensed under:
MIT License