Package Exports
- js-unused-exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-unused-exports) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Unused Exports
Tool for identifying and reporting unused exports found in ECMAScript/JavaScript code.
You may think of it as ESLint no-unused-vars
rule, but for the whole project scope.
Tool uses Babel parser to parse source code. You can provide custom parser options using config file.
Instalation
npm install -g js-unused-exports
Usage
Usage: js-unused-exports [options]
E.g.: js-unused-exports --config "unused-exports-config.json"
Options:
-v, --version output the version number
-c, --config [path] path to the JSON config file
-f, --fix automatically remove "export" directive where possible
-h, --help output usage information
Configuration
{
// Root project directory or CWD (default)
projectRoot: '',
// Source paths relative to project root
sourcePaths: ['src/**/*.js'],
// Patterns for files that should be ignored
ignorePaths: [],
// Test file patterns
testPaths: [
'src/**/*.spec.js'
],
// Import patterns to ignore
ignoreImportPatterns: [ '(png|gif|jpg|jpeg|css|scss)$' ],
// If you use alias in you codebase you can specify them here, e.g.:
aliases: {
components: 'src/components'
},
// @babel/parser options for parsing source code
// https://babeljs.io/docs/en/babel-parser
parserOptions: {
sourceType: 'module',
plugins: [
'objectRestSpread',
'jsx',
'flow',
'classProperties',
'decorators-legacy',
'exportDefaultFrom'
]
}
}