https://github.com/loopmode/esdoc-importpath-dedupe-plugin
Plugin for ESDoc that removes duplicates at the ends of import paths
https://github.com/loopmode/esdoc-importpath-dedupe-plugin
Last synced: about 1 year ago
JSON representation
Plugin for ESDoc that removes duplicates at the ends of import paths
- Host: GitHub
- URL: https://github.com/loopmode/esdoc-importpath-dedupe-plugin
- Owner: loopmode
- License: mit
- Created: 2018-12-25T09:31:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-25T10:50:14.000Z (over 7 years ago)
- Last Synced: 2025-02-08T20:45:56.053Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ESDoc Import Path Dedupe Plugin
This is a plugin that converts the import path in documentation.
It removes duplicate last parts in import paths, which is useful for components that have a folder and a file with the same name, but are imported using the `index.js` file anyways.
For example, consider this structure:
```
src/
components/
MyComponent/
index.js
MyComponent.js
```
In your codebase, you will do `import MyComponent from 'components/MyComponent'`.
ESDoc will generate docs with `import MyComponent from 'components/MyComponent/MyComponent.js'`.
Using this plugin, the docs will be generated with `import MyComponent from 'components/MyComponent'` because the plugin detects that the last two segments of the path are equal when applying the `js` extension.
## Install
```sh
npm install esdoc-importpath-dedupe-plugin
```
## Config
In the default configuration, only paths to files with the extension `js` are handled, but you can change that using the `extensions` option.
The extensions option can be a comma-separated string or an array of extension strings.
```json
{
"source": "./src",
"destination": "./doc",
"plugins": [
{
"name": "esdoc-importpath-dedupe-plugin",
"option": {
"extensions": ["js"]
}
}
]
}
```
## LICENSE
MIT
## Author
Jovica Aleksic