1.0.0 • Published 8 years ago

orphan v1.0.0

Weekly downloads
2
License
ASL
Repository
-
Last release
8 years ago

orphan

Find orphan (unimported) files in your project! Like that! isn't it nice?

Just cd to the root folder of your application and run orphan. There is a sensitive bunch of default parameters which you can override via cli or with a config file called .orphanrc (also located at the root folder of your application). Here is an example of an .orphanrc (which also happens to be the default config):

module.exports = {
  rootDir: '.',
  tilde: '.',
  entryFiles: [
    './index.js'
  ],
  uses: [
    '**/*.js'
  ],
  ignores: [
    '**/*.test.js',
    '**/*.spec.js',
    '**/*.config.js',
    '**/*.babel.js',
    'node_modules',
    '.git',
    'gulp',
    'dist'
  ]

}

In case you are not familiar with it, tilde refers to the path used by babel-plugin-require-root-rewrite, so it's an optional parameter.

You can also use the following arguments to override .orphanrc and the default config:

arglongshorttype
rootDir--rootDir-rString
tilde--tilde-tString
entryFiles--entryFiles-eArray
uses--uses-uArray
ignores--ignores-iArray

For example, to also use css files you could use:

orphan -u '**/*/js' '**/*/css'