esdoc / esdoc

ESDoc - Good Documentation for JavaScript
https://esdoc.org
MIT License
2.74k stars 205 forks source link

.mjs files are not parsed #530

Open cloewen8 opened 5 years ago

cloewen8 commented 5 years ago

Make sure these boxes are checked before submitting your issue - thank you! (If your issue is neither a both bug nor a request, please write in a free style)

Short summary of your issue

If a file has an extension of .mjs, it is not parsed. This is a javascript module file and should be parsed as one. Changing the file extension to .js causes it to be parsed.

Input data for reproducing

Configuration

{
    "source": "./lib",
    "destination": "./docs",
    "plugins": [
        { "name": "esdoc-coverage-plugin" },
        { "name": "esdoc-type-inference-plugin" },
        { "name": "esdoc-publish-markdown-plugin" },
        { "name": "esdoc-lint-plugin" },
        { "name": "esdoc-exclude-source-plugin" },
        { "name": "esdoc-undocumented-identifier-plugin" },
        { "name": "esdoc-unexported-identifier-plugin" },
        { "name": "esdoc-ecmascript-proposal-plugin", "option": {
            "exportExtensions": true,
            "dynamicImport": true
        } }
    ]
}

Codes (lib/index.mjs)

/**
 * @typedef {Object} Plan
 */

Output data

Log

> esdoc -c esdoc.json

output: ~\docs\coverage.json
output: ~\docs\badge.svg
output: ~\docs\index.md
output: ~\docs\lint.json

Your environment

natade-jp commented 5 years ago

You can specify the target file in "includes".

Configuration

{
    "source": "./lib",
    "destination": "./docs",
    "includes" : ["\\.(js|mjs)$"],
    "plugins": [
        { "name": "esdoc-coverage-plugin" },
        { "name": "esdoc-type-inference-plugin" },
        { "name": "esdoc-publish-markdown-plugin" },
        { "name": "esdoc-lint-plugin" },
        { "name": "esdoc-exclude-source-plugin" },
        { "name": "esdoc-undocumented-identifier-plugin" },
        { "name": "esdoc-unexported-identifier-plugin" },
        { "name": "esdoc-ecmascript-proposal-plugin", "option": {
            "exportExtensions": true,
            "dynamicImport": true
        } }
    ]
}

reference https://esdoc.org/manual/config.html