├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitattributes
├── .github
├── dependabot.yml
├── documentation-js-logo.png
└── workflows
│ ├── codeql.yml
│ └── node.js.yml
├── .gitignore
├── .husky
└── pre-commit
├── .npmignore
├── .prettierignore
├── .prettierrc
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── __tests__
├── .eslintrc
├── __snapshots__
│ ├── bin-readme.js.snap
│ ├── bin.js.snap
│ ├── index.js.snap
│ └── test.js.snap
├── bin-readme.js
├── bin.js
├── config_fixture
│ ├── config
│ ├── config.json
│ ├── config.yaml
│ ├── config.yml
│ ├── config_comments.json
│ ├── config_file.yml
│ └── config_links.yml
├── fixture
│ ├── _external-deps-included.json
│ ├── _multi-file-input.json
│ ├── auto_lang_hljs
│ │ ├── config.yml
│ │ ├── multilanguage.input.js
│ │ └── multilanguage.output.md
│ ├── bad
│ │ ├── syntax.input
│ │ └── syntax.output.json
│ ├── boolean-literal-type.input.js
│ ├── class.input.js
│ ├── config-bad.yml
│ ├── config-malformed.json
│ ├── config.json
│ ├── custom_theme
│ │ └── index.js
│ ├── default-export-function.input.js
│ ├── document-exported-bad
│ │ ├── exports-z.js
│ │ └── x.js
│ ├── document-exported-export-default-object.input.js
│ ├── document-exported-export-default-value.input.js
│ ├── document-exported.input.js
│ ├── document-exported
│ │ ├── x.js
│ │ ├── y.js
│ │ └── z.js
│ ├── es6-class-property.input.js
│ ├── es6-class.input.js
│ ├── es6-default2.input.js
│ ├── es6-ext.es6
│ ├── es6-import.input.js
│ ├── es6.input.js
│ ├── es6.output-toc.md
│ ├── event.input.js
│ ├── example-caption.input.js
│ ├── extension.jsx
│ ├── extension
│ │ ├── extension-required.jsx
│ │ └── index.otherextension
│ ├── external.input.js
│ ├── factory.input.js
│ ├── flow-exported-opaque-type.input.js
│ ├── flow-optional-chaining.input.js
│ ├── flow-unnamed-params.input.js
│ ├── flow
│ │ └── comment-types.js
│ ├── html
│ │ ├── documentation.yml
│ │ ├── nested.input.js
│ │ ├── nested.output.files
│ │ └── nested.output.json
│ ├── import.meta.input.js
│ ├── infer-private.input.js
│ ├── inheritance.input.js
│ ├── inline-link.input.js
│ ├── interface.input.js
│ ├── internal.input.js
│ ├── lends.input.js
│ ├── lint
│ │ ├── lint.input.dependency.js
│ │ ├── lint.input.js
│ │ ├── lint.input.shallow.js
│ │ └── lint.output
│ ├── literal_types.input.js
│ ├── memberedclass.input.js
│ ├── merge-infered-type.input.js
│ ├── meta.input.js
│ ├── multisignature.input.js
│ ├── nearby_params.input.js
│ ├── nest_events.input.js
│ ├── nest_params.input.js
│ ├── newline-in-description.input.js
│ ├── no-name.input.js
│ ├── node_modules
│ │ ├── external
│ │ │ ├── index.js
│ │ │ ├── lib
│ │ │ │ └── main.js
│ │ │ ├── node_modules
│ │ │ │ └── external2
│ │ │ │ │ └── index.js
│ │ │ └── package.json
│ │ └── external2
│ │ │ └── index.js
│ ├── optional-record-field-type.input.js
│ ├── params.input.js
│ ├── polyglot
│ │ └── blend.json
│ ├── react-jsx.input.js
│ ├── readme
│ │ ├── README.input.md
│ │ ├── README.output.md
│ │ └── index.js
│ ├── require-json-no-extension.input.js
│ ├── require-json.input.js
│ ├── require-json.json
│ ├── resolve
│ │ ├── index.js
│ │ ├── node.js
│ │ └── package.json
│ ├── sections.config.yml
│ ├── sections.input.js
│ ├── simple-callback.input.js
│ ├── simple-hashbang.input.js
│ ├── simple-private.input.js
│ ├── simple-singlestar.input.js
│ ├── simple-triplestar.input.js
│ ├── simple-two.input.js
│ ├── simple.config.yml
│ ├── simple.input.js
│ ├── snowflake.md
│ ├── sort-order-alpha.input.js
│ ├── sorting
│ │ ├── input.js
│ │ ├── output-bad.txt
│ │ └── output.json
│ ├── string-literal-key.input.js
│ ├── this-class.input.js
│ ├── type_application.input.js
│ ├── var-function-param-return.input.js
│ ├── vue-no-script.input.vue
│ └── vue.input.vue
├── format_type.js
├── index.js
├── lib
│ ├── __snapshots__
│ │ └── sort.js.snap
│ ├── filter_access.js
│ ├── flow_doctrine.js
│ ├── git
│ │ ├── find_git.js
│ │ └── url_prefix.js
│ ├── github.js
│ ├── hierarchy.js
│ ├── infer
│ │ ├── __snapshots__
│ │ │ └── params.js.snap
│ │ ├── access.js
│ │ ├── augments.js
│ │ ├── finders.js
│ │ ├── implements.js
│ │ ├── kind.js
│ │ ├── membership.js
│ │ ├── name.js
│ │ ├── params.js
│ │ ├── properties.js
│ │ ├── return.js
│ │ └── type.js
│ ├── input
│ │ ├── dependency.js
│ │ └── shallow.js
│ ├── lint.js
│ ├── merge_config.js
│ ├── module_filters.js
│ ├── nest.js
│ ├── output
│ │ └── util
│ │ │ └── formatters.js
│ ├── parse.js
│ ├── parsers
│ │ ├── javascript.js
│ │ └── parse_to_ast.js
│ ├── sort.js
│ ├── ts_doctrine.js
│ └── walk.js
├── linker.js
├── misc
│ └── package.json
├── test.js
└── utils.js
├── bin
└── documentation.js
├── declarations
└── comment.js
├── docs
├── CONFIG.md
├── FAQ.md
├── GETTING_STARTED.md
├── NODE_API.md
├── POLYGLOT.md
├── RECIPES.md
├── THEMING.md
├── TROUBLESHOOTING.md
├── USAGE.md
└── USAGE_NODE.md
├── package-lock.json
├── package.json
├── screenshorts
└── show options.jpg
└── src
├── commands
├── build.js
├── index.js
├── lint.js
├── readme.js
└── shared_options.js
├── config.js
├── default_theme
├── README.md
├── assets
│ ├── anchor.js
│ ├── bass-addons.css
│ ├── bass.css
│ ├── fonts
│ │ ├── EOT
│ │ │ ├── SourceCodePro-Bold.eot
│ │ │ └── SourceCodePro-Regular.eot
│ │ ├── LICENSE.txt
│ │ ├── OTF
│ │ │ ├── SourceCodePro-Bold.otf
│ │ │ └── SourceCodePro-Regular.otf
│ │ ├── TTF
│ │ │ ├── SourceCodePro-Bold.ttf
│ │ │ └── SourceCodePro-Regular.ttf
│ │ ├── WOFF
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff
│ │ │ │ └── SourceCodePro-Regular.otf.woff
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff
│ │ │ │ └── SourceCodePro-Regular.ttf.woff
│ │ ├── WOFF2
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff2
│ │ │ │ └── SourceCodePro-Regular.otf.woff2
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff2
│ │ │ │ └── SourceCodePro-Regular.ttf.woff2
│ │ └── source-code-pro.css
│ ├── github.css
│ ├── site.js
│ ├── split.css
│ ├── split.js
│ └── style.css
├── index._
├── index.js
├── note._
├── paramProperty._
├── section._
└── section_list._
├── extractors
├── comments.js
└── exported.js
├── filter_access.js
├── flow_doctrine.js
├── garbage_collect.js
├── get-readme-file.js
├── git
├── find_git.js
└── url_prefix.js
├── github.js
├── hierarchy.js
├── index.js
├── infer
├── access.js
├── augments.js
├── finders.js
├── implements.js
├── kind.js
├── membership.js
├── name.js
├── params.js
├── properties.js
├── return.js
└── type.js
├── input
├── dependency.js
├── moduleDeps.js
├── readFileCode.js
├── shallow.js
└── smart_glob.js
├── is_jsdoc_comment.js
├── lint.js
├── merge_config.js
├── module_filters.js
├── nest.js
├── output
├── highlighter.js
├── html.js
├── json.js
├── markdown.js
├── markdown_ast.js
└── util
│ ├── format_type.js
│ ├── formatters.js
│ ├── linker_stack.js
│ └── reroute_links.js
├── parse.js
├── parsers
├── README.md
├── javascript.js
└── parse_to_ast.js
├── remark-jsDoc-link.js
├── remark-parse.js
├── remark-remove-position.js
├── sort.js
├── ts_doctrine.js
├── type_annotation.js
└── walk.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.{js,css}]
2 | indent_style = space
3 | indent_size = 2
4 | trim_trailing_whitespace = true
5 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | __tests__/fixture/*
2 | src/default_theme/*
3 | coverage/*
4 | lib/*
5 | declarations/*
6 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 | "parserOptions": {
4 | "sourceType": "module",
5 | "ecmaVersion": 2020
6 | },
7 | "rules": {
8 | "no-var": 2,
9 | "prefer-const": 2,
10 | "no-use-before-define": [2, "nofunc"],
11 | "camelcase": 2,
12 | "no-lonely-if": 2,
13 | "no-else-return": 2,
14 | "new-cap": 2,
15 | "no-empty": 2,
16 | "consistent-return": 0,
17 | "no-new": 2,
18 | "object-shorthand": ["error", "always", { "avoidQuotes": true }],
19 | "no-throw-literal": 2,
20 | "no-self-compare": 2,
21 | "no-void": 2,
22 | "no-unused-vars": 2,
23 | "wrap-iife": 2,
24 | "no-eq-null": 2,
25 | "strict": [2, "global"],
26 | "no-shadow": 0,
27 | "no-undef": 2
28 | },
29 | "extends": ["eslint:recommended", "prettier"],
30 | "env": {
31 | "node": true,
32 | "es6": true
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | test/fixture/polyglot/* linguist-vendored
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/en/code-security/dependabot
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: github-actions
9 | directory: /
10 | schedule:
11 | interval: weekly
12 | - package-ecosystem: npm
13 | directory: /
14 | schedule:
15 | interval: weekly
16 |
--------------------------------------------------------------------------------
/.github/documentation-js-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/documentationjs/documentation/8d029e735d2661c8f5e097c285050c7abe5edf6e/.github/documentation-js-logo.png
--------------------------------------------------------------------------------
/.github/workflows/codeql.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL"
2 |
3 | on:
4 | push:
5 | branches: [ "master" ]
6 | pull_request:
7 | branches: [ "master" ]
8 | schedule:
9 | - cron: '0 0 1 * *'
10 | workflow_dispatch:
11 |
12 | jobs:
13 | analyze:
14 | name: Analyze
15 | runs-on: ubuntu-latest
16 | permissions:
17 | security-events: write
18 |
19 | strategy:
20 | fail-fast: false
21 | matrix:
22 | language: [ 'javascript-typescript' ]
23 |
24 | steps:
25 | - name: Checkout repository
26 | uses: actions/checkout@v4
27 |
28 | # Initializes the CodeQL tools for scanning.
29 | - name: Initialize CodeQL
30 | uses: github/codeql-action/init@v3
31 | with:
32 | languages: ${{ matrix.language }}
33 | queries: +security-and-quality
34 |
35 | - name: Autobuild
36 | uses: github/codeql-action/autobuild@v3
37 |
38 | - name: Perform CodeQL Analysis
39 | uses: github/codeql-action/analyze@v3
40 | with:
41 | category: "/language:${{matrix.language}}"
42 |
--------------------------------------------------------------------------------
/.github/workflows/node.js.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3 |
4 | name: Node.js CI
5 |
6 | on:
7 | push:
8 | branches: [master]
9 | pull_request:
10 | branches: [master]
11 |
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 |
16 | strategy:
17 | matrix:
18 | node-version: [18.x, 20.x]
19 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20 |
21 | steps:
22 | - uses: actions/checkout@v4
23 | - name: Use Node.js ${{ matrix.node-version }}
24 | uses: actions/setup-node@v4
25 | with:
26 | node-version: ${{ matrix.node-version }}
27 | cache: 'npm'
28 | - run: npm ci
29 | - run: npm run test-ci
30 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | coverage
2 | .nyc_output
3 | /node_modules
4 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npm run pre-commit
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .editorconfig
2 | .eslintignore
3 | .eslintrc
4 | .gitattributes
5 | .gitignore
6 | .nyc_output
7 | circle.yml
8 | coverage
9 | __tests__
10 | .circleci
11 | .github
12 | .prettierignore
13 | .prettierrc
14 | CODE_OF_CONDUCT.md
15 | ISSUE_TEMPLATE.md
16 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | __tests__/fixture
2 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "none",
4 | "arrowParens": "avoid"
5 | }
6 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to make participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies within all project spaces, and it also applies when
49 | an individual is representing the project or its community in public spaces.
50 | Examples of representing a project or community include using an official
51 | project e-mail address, posting via an official social media account, or acting
52 | as an appointed representative at an online or offline event. Representation of
53 | a project may be further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team. All complaints will be reviewed and
59 | investigated and will result in a response that is deemed necessary and appropriate
60 | to the circumstances. The project team is obligated to maintain confidentiality with
61 | regard to the reporter of an incident. Further details of specific enforcement
62 | policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # documentation is an OPEN Open Source Project
2 |
3 | -----------------------------------------
4 |
5 | ## What?
6 |
7 | Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
8 |
9 | ## Rules
10 |
11 | There are a few basic ground-rules for contributors:
12 |
13 | 1. **No `--force` pushes** or modifying the Git history in any way.
14 | 1. **Non-master branches** ought to be used for ongoing work.
15 | 1. **External API changes and significant modifications** ought to be subject to an **internal pull-request** to solicit feedback from other contributors.
16 | 1. Internal pull-requests to solicit feedback are *encouraged* for any other non-trivial contribution but left to the discretion of the contributor.
17 | 1. Contributors should attempt to adhere to the prevailing code-style.
18 |
19 | ## Releases
20 |
21 | Declaring formal releases remains the prerogative of the project maintainer.
22 |
23 | ## Changes to this arrangement
24 |
25 | This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change.
26 |
27 | [this approach is totally cribbed from the excellent LevelUP project](https://github.com/Level/community/blob/master/CONTRIBUTING.md)
28 |
29 | ----
30 |
31 | ## Releasing
32 |
33 | documentation aims to **release often**. We use [standard-changelog](https://github.com/conventional-changelog/standard-changelog)
34 | to generate CHANGELOG.md entries and [commitizen](https://github.com/commitizen/cz-cli) to standardize
35 | commit messages. Pull Request messages should be standardized to commitizen syntax (aka angular standard)
36 | before merge.
37 |
38 | Release process:
39 |
40 | * Confirm that `master` passes CI tests
41 | * Run `npm run release` or in case it's a prerelease you'd run i.e. `npm run release -- --prerelease alpha`
42 | * It will automatically update the version in package.json and make a git tag.
43 | * Push commits
44 | * npm publish
45 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **If you're reporting a bug, please include _input code_, _output documentation_,
2 | a description of what you expected to happen, and what happened instead.**
3 |
4 | * What version of documentation.js are you using?:
5 | * How are you running documentation.js (on the CLI, Node.js API, Grunt, other?):
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ISC License
2 |
3 | Copyright (c) 2025, documentationjs <>
4 |
5 | Permission to use, copy, modify, and/or distribute this software for any
6 | purpose with or without fee is hereby granted, provided that the above
7 | copyright notice and this permission notice appear in all copies.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 |
17 | --------------------------------------------------------------------------------
18 |
19 | Contains sections of eslint
20 |
21 | ESLint
22 | Copyright JS Foundation and other contributors, https://js.foundation
23 |
24 | Permission is hereby granted, free of charge, to any person obtaining a copy
25 | of this software and associated documentation files (the "Software"), to deal
26 | in the Software without restriction, including without limitation the rights
27 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28 | copies of the Software, and to permit persons to whom the Software is
29 | furnished to do so, subject to the following conditions:
30 |
31 | The above copyright notice and this permission notice shall be included in
32 | all copies or substantial portions of the Software.
33 |
34 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
40 | THE SOFTWARE.
41 |
42 | --------------------------------------------------------------------------------
43 |
44 | Contains sections of prettier
45 |
46 | Copyright © James Long and contributors
47 |
48 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
49 |
50 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
51 |
52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/__tests__/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "valid-jsdoc": [0],
4 | "no-unused-vars": [0]
5 | },
6 | "env": {
7 | "jest": true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/__tests__/__snapshots__/bin-readme.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`readme autodetection of different filenames updates readme.markdown 1`] = `
4 | "# A title
5 |
6 | # API
7 |
8 |
9 |
10 | ### Table of Contents
11 |
12 | * [foo](#foo)
13 | * [Parameters](#parameters)
14 | * [bar](#bar)
15 | * [Parameters](#parameters-1)
16 |
17 | ## foo
18 |
19 | A function with documentation.
20 |
21 | ### Parameters
22 |
23 | * \`a\` {string} blah
24 |
25 | Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\\\_Objects/Number)** answer
26 |
27 | ## bar
28 |
29 | A second function with docs
30 |
31 | ### Parameters
32 |
33 | * \`b\`
34 |
35 | # Another section
36 | "
37 | `;
38 |
39 | exports[`readme command --readme-file 1`] = `
40 | "# A title
41 |
42 | # API
43 |
44 |
45 |
46 | ### Table of Contents
47 |
48 | * [foo](#foo)
49 | * [Parameters](#parameters)
50 | * [bar](#bar)
51 | * [Parameters](#parameters-1)
52 |
53 | ## foo
54 |
55 | A function with documentation.
56 |
57 | ### Parameters
58 |
59 | * \`a\` {string} blah
60 |
61 | Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\\\_Objects/Number)** answer
62 |
63 | ## bar
64 |
65 | A second function with docs
66 |
67 | ### Parameters
68 |
69 | * \`b\`
70 |
71 | # Another section
72 | "
73 | `;
74 |
75 | exports[`readme command updates README.md 1`] = `
76 | "# A title
77 |
78 | # API
79 |
80 |
81 |
82 | ### Table of Contents
83 |
84 | * [foo](#foo)
85 | * [Parameters](#parameters)
86 | * [bar](#bar)
87 | * [Parameters](#parameters-1)
88 |
89 | ## foo
90 |
91 | A function with documentation.
92 |
93 | ### Parameters
94 |
95 | * \`a\` {string} blah
96 |
97 | Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\\\_Objects/Number)** answer
98 |
99 | ## bar
100 |
101 | A second function with docs
102 |
103 | ### Parameters
104 |
105 | * \`b\`
106 |
107 | # Another section
108 | "
109 | `;
110 |
--------------------------------------------------------------------------------
/__tests__/__snapshots__/index.js.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`build 1`] = `
4 | Array [
5 | Object {
6 | "augments": Array [],
7 | "description": Object {
8 | "children": Array [
9 | Object {
10 | "children": Array [
11 | Object {
12 | "type": "text",
13 | "value": "hi",
14 | },
15 | ],
16 | "type": "paragraph",
17 | },
18 | ],
19 | "type": "root",
20 | },
21 | "errors": Array [],
22 | "examples": Array [],
23 | "implements": Array [],
24 | "loc": SourceLocation {
25 | "end": Position {
26 | "column": 9,
27 | "index": 9,
28 | "line": 1,
29 | },
30 | "filename": undefined,
31 | "identifierName": undefined,
32 | "start": Position {
33 | "column": 0,
34 | "index": 0,
35 | "line": 1,
36 | },
37 | },
38 | "members": Object {
39 | "events": Array [],
40 | "global": Array [],
41 | "inner": Array [],
42 | "instance": Array [],
43 | "static": Array [],
44 | },
45 | "name": "name",
46 | "namespace": "name",
47 | "params": Array [],
48 | "path": Array [
49 | Object {
50 | "kind": undefined,
51 | "name": "name",
52 | },
53 | ],
54 | "properties": Array [],
55 | "returns": Array [],
56 | "sees": Array [],
57 | "tags": Array [],
58 | "throws": Array [],
59 | "todos": Array [],
60 | "yields": Array [],
61 | },
62 | ]
63 | `;
64 |
65 | exports[`build 2`] = `
66 | "
67 |
68 | ## name
69 |
70 | hi
71 | "
72 | `;
73 |
74 | exports[`build 3`] = `
75 | "[
76 | {
77 | \\"description\\": {
78 | \\"type\\": \\"root\\",
79 | \\"children\\": [
80 | {
81 | \\"type\\": \\"paragraph\\",
82 | \\"children\\": [
83 | {
84 | \\"type\\": \\"text\\",
85 | \\"value\\": \\"hi\\"
86 | }
87 | ]
88 | }
89 | ]
90 | },
91 | \\"tags\\": [],
92 | \\"loc\\": {
93 | \\"start\\": {
94 | \\"line\\": 1,
95 | \\"column\\": 0,
96 | \\"index\\": 0
97 | },
98 | \\"end\\": {
99 | \\"line\\": 1,
100 | \\"column\\": 9,
101 | \\"index\\": 9
102 | }
103 | },
104 | \\"augments\\": [],
105 | \\"examples\\": [],
106 | \\"implements\\": [],
107 | \\"params\\": [],
108 | \\"properties\\": [],
109 | \\"returns\\": [],
110 | \\"sees\\": [],
111 | \\"throws\\": [],
112 | \\"todos\\": [],
113 | \\"yields\\": [],
114 | \\"name\\": \\"name\\",
115 | \\"members\\": {
116 | \\"global\\": [],
117 | \\"inner\\": [],
118 | \\"instance\\": [],
119 | \\"events\\": [],
120 | \\"static\\": []
121 | },
122 | \\"path\\": [
123 | {
124 | \\"name\\": \\"name\\"
125 | }
126 | ],
127 | \\"namespace\\": \\"name\\"
128 | }
129 | ]"
130 | `;
131 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config:
--------------------------------------------------------------------------------
1 | foo: bar
--------------------------------------------------------------------------------
/__tests__/config_fixture/config.json:
--------------------------------------------------------------------------------
1 | { "foo": "bar" }
2 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config.yaml:
--------------------------------------------------------------------------------
1 | foo: bar
2 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config.yml:
--------------------------------------------------------------------------------
1 | foo: bar
2 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config_comments.json:
--------------------------------------------------------------------------------
1 | // there is a comment here
2 | { "foo": "bar" }
3 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config_file.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | - name: snowflake
3 | file: ../fixture/snowflake.md
4 |
--------------------------------------------------------------------------------
/__tests__/config_fixture/config_links.yml:
--------------------------------------------------------------------------------
1 | foo: >-
2 | hello [link](https://github.com/my/link) world
3 |
--------------------------------------------------------------------------------
/__tests__/fixture/auto_lang_hljs/config.yml:
--------------------------------------------------------------------------------
1 | hljs:
2 | highlightAuto: true
3 | languages:
4 | - js
5 | - css
6 | - html
7 |
--------------------------------------------------------------------------------
/__tests__/fixture/auto_lang_hljs/multilanguage.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This function returns the number one.
3 | * @returns {Number} numberone
4 | * @example
5 | * var myFoo = new Foo('[data-foo]');
6 | * myFoo.foo(42);
7 | * @example
8 | *
Data-Foo Element in the dom
9 | * @example
10 | * [data-foo] {
11 | * background-color: red;
12 | * }
13 | * @throws {Error} if you give it something
14 | * @throws {TypeError} if you give it something else
15 | * @augments Foo
16 | * @augments Bar
17 | */
18 | module.exports = function() {
19 | // this returns 1
20 | return 1;
21 | };
22 |
--------------------------------------------------------------------------------
/__tests__/fixture/auto_lang_hljs/multilanguage.output.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## multilanguage.input
4 |
5 | **Extends Foo, Bar**
6 |
7 | This function returns the number one.
8 |
9 | **Examples**
10 |
11 | ```js
12 | var myFoo = new Foo('[data-foo]');
13 | myFoo.foo(42);
14 | ```
15 |
16 | ```html
17 | Data-Foo Element in the dom
18 | ```
19 |
20 | ```css
21 | [data-foo] {
22 | background-color: red;
23 | }
24 | ```
25 |
26 | - Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if you give it something
27 | - Throws **[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** if you give it something else
28 |
29 | Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone
30 |
--------------------------------------------------------------------------------
/__tests__/fixture/bad/syntax.input:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/bad/syntax.output.json:
--------------------------------------------------------------------------------
1 | {
2 | "pos": 19,
3 | "loc": {
4 | "line": 2,
5 | "column": 0
6 | },
7 | "_babel": true
8 | }
--------------------------------------------------------------------------------
/__tests__/fixture/boolean-literal-type.input.js:
--------------------------------------------------------------------------------
1 | /** */
2 | function f(t: true, f: false): [true, false] {
3 | return [t, f];
4 | }
5 |
--------------------------------------------------------------------------------
/__tests__/fixture/class.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is my class, a demo thing.
3 | * @class MyClass
4 | * @implements {MyInterface}
5 | * @property {number} howMany how many things it contains
6 | */
7 | function MyClass() {
8 | this.howMany = 2;
9 | }
10 |
11 | /**
12 | * Get the number 42
13 | * @param {boolean} getIt whether to get the number
14 | * @returns {number} forty-two
15 | */
16 | MyClass.prototype.getFoo = function(getIt) {
17 | return getIt ? 42 : 0;
18 | };
19 |
20 | /**
21 | * Get undefined
22 | * @returns {undefined} does not return anything.
23 | */
24 | MyClass.prototype.getUndefined = function() {};
25 |
--------------------------------------------------------------------------------
/__tests__/fixture/config-bad.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | - notfound
3 |
--------------------------------------------------------------------------------
/__tests__/fixture/config-malformed.json:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "toc": ["bananas", "carrots", "apples"]
3 | }
4 |
--------------------------------------------------------------------------------
/__tests__/fixture/custom_theme/index.js:
--------------------------------------------------------------------------------
1 | var File = require('vinyl');
2 |
3 | /**
4 | * This is a theme only used by documentation to test custom theme
5 | * support.
6 | */
7 | module.exports = function(comments, options, callback) {
8 | return Promise.resolve([
9 | new File({
10 | base: '/',
11 | path: '/index.html',
12 | contents: Buffer.from('Hello world')
13 | })
14 | ]);
15 | };
16 |
--------------------------------------------------------------------------------
/__tests__/fixture/default-export-function.input.js:
--------------------------------------------------------------------------------
1 | /** i am foo */
2 | export default function() {
3 | /** i am foo's son */
4 | this.bar = () => {};
5 | }
6 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported-bad/exports-z.js:
--------------------------------------------------------------------------------
1 | export var z = 1;
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported-bad/x.js:
--------------------------------------------------------------------------------
1 | export { y as x } from './exports-z.js';
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported-export-default-object.input.js:
--------------------------------------------------------------------------------
1 | // Options: {"documentExported": true}
2 |
3 | export default {
4 | x: 42
5 | };
6 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported-export-default-value.input.js:
--------------------------------------------------------------------------------
1 | // Options: {"documentExported": true}
2 |
3 | export default 42;
4 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported.input.js:
--------------------------------------------------------------------------------
1 | // Options: {"documentExported": true}
2 |
3 | export class Class {
4 | constructor(a: string) {}
5 | classMethod() {}
6 | get classGetter() {}
7 | set classSetter(v) {}
8 | static staticMethod() {}
9 | static get staticGetter() {}
10 | static set staticSetter(v) {}
11 | }
12 |
13 | export var object = {
14 | method() {},
15 | get getter() {},
16 | set setter(v) {},
17 | prop: 42,
18 | func: function() {}
19 | };
20 |
21 | /** Should not document this */
22 | class NotExportedClass {
23 | /** Should not document this */
24 | classMethod() {}
25 | /** Should not document this */
26 | get classGetter() {}
27 | /** Should not document this */
28 | set classSetter(v) {}
29 | /** Should not document this */
30 | static staticMethod() {}
31 | /** Should not document this */
32 | static get staticGetter() {}
33 | /** Should not document this */
34 | static set staticSetter(v) {}
35 | }
36 |
37 | /** Should not document this */
38 | var notExportedObject = {
39 | /** Should not document this */
40 | method() {},
41 | /** Should not document this */
42 | get getter() {},
43 | /** Should not document this */
44 | set setter(v) {},
45 | /** Should not document this */
46 | prop: 42,
47 | /** Should not document this */
48 | func: function() {}
49 | };
50 |
51 | export { x, y3 as y4 } from './document-exported/x';
52 | export z from './document-exported/z.js';
53 | export y2Default from './document-exported/y.js';
54 |
55 | function f1() {}
56 | function f2() {}
57 |
58 | export { f1, f2 as f3 };
59 |
60 | export type T = number;
61 | type T2 = string;
62 | type T3 = string;
63 |
64 | export type { T2, T3 as T4 };
65 |
66 | export type { T5 } from './document-exported/x.js';
67 |
68 | export var f4 = function(x: X) {};
69 |
70 | export { f5 };
71 |
72 | export var o1 = {
73 | om1() {}
74 | };
75 |
76 | /** f5 comment */
77 | var f5 = function(y: Y) {},
78 | o2 = {
79 | om2() {}
80 | };
81 | export { o2 };
82 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported/x.js:
--------------------------------------------------------------------------------
1 | export { y as x, y3 } from './y.js';
2 |
3 | export type T5 = boolean;
4 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported/y.js:
--------------------------------------------------------------------------------
1 | export function y(yparam) {}
2 |
3 | function y2() {}
4 |
5 | export default y2;
6 |
7 | /** Description of y3 */
8 | function y3(p: number): void {}
9 |
10 | export { y3 };
11 |
--------------------------------------------------------------------------------
/__tests__/fixture/document-exported/z.js:
--------------------------------------------------------------------------------
1 | export default class z {
2 | zMethod() {}
3 | }
4 |
--------------------------------------------------------------------------------
/__tests__/fixture/es6-class-property.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is for issue 906.
3 | */
4 | export class Issue906 {
5 | /**
6 | * This is a read-write property.
7 | * @type {boolean}
8 | */
9 | get readWriteProp() {
10 | return this._rw;
11 | }
12 |
13 | set readWriteProp(value) {
14 | this._rw = value;
15 | }
16 |
17 | /**
18 | * This is a read-only property.
19 | * @type {string}
20 | * @readonly
21 | */
22 | get readOnlyProp() {
23 | return 'foo';
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/__tests__/fixture/es6-class.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is my component. This is from issue #458
3 | */
4 | class Foo extends React.Component {}
5 |
6 | /**
7 | * Does nothing. This is from issue #556
8 | * @param {string} str
9 | */
10 | export class Bar {
11 | constructor(str) {
12 | /**
13 | * A useless property
14 | * @type {string}
15 | */
16 | this.bar = '';
17 | }
18 | }
19 |
20 | /**
21 | * This class has fully inferred constructor parameters.
22 | */
23 | export class Baz {
24 | constructor(n: number, l: Array) {}
25 | }
26 |
--------------------------------------------------------------------------------
/__tests__/fixture/es6-default2.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @public
3 | */
4 | export default thisIsTheArgument => {};
5 |
--------------------------------------------------------------------------------
/__tests__/fixture/es6-ext.es6:
--------------------------------------------------------------------------------
1 | /**
2 | * This is the default export frogs!
3 | */
4 | export default 10;
5 |
--------------------------------------------------------------------------------
/__tests__/fixture/es6-import.input.js:
--------------------------------------------------------------------------------
1 | import hasEx6 from './es6-ext';
2 | import multiply from './simple.input.js';
3 | import * as foo from 'some-other-module';
4 |
5 | // Disable dynamic imports for now until
6 | // https://github.com/thgreasi/babel-plugin-system-import-transformer
7 | // can be updated to support babel 7.
8 | // import('./simple.input.js').then(() => {});
9 |
10 | /**
11 | * This function returns the number one.
12 | * @returns {Number} numberone
13 | */
14 | var multiplyTwice = a => a * multiply(a);
15 |
16 | export default multiplyTwice;
17 |
--------------------------------------------------------------------------------
/__tests__/fixture/event.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Mouse event
3 | *
4 | * @event Map#mousemove
5 | * @type {Object}
6 | * @property {Point} point the pixel location of the event
7 | * @property {Event} originalEvent the original DOM event
8 | */
9 |
--------------------------------------------------------------------------------
/__tests__/fixture/example-caption.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This function returns the number one.
3 | * @returns {Number} numberone
4 | * @example demonstrates how to run foo
5 | * foo(1);
6 | */
7 | function foo() {
8 | // this returns 1
9 | return 1;
10 | }
11 |
--------------------------------------------------------------------------------
/__tests__/fixture/extension.jsx:
--------------------------------------------------------------------------------
1 | var required = require('./extension/extension-required');
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/extension/extension-required.jsx:
--------------------------------------------------------------------------------
1 | module.exports = {};
2 |
--------------------------------------------------------------------------------
/__tests__/fixture/extension/index.otherextension:
--------------------------------------------------------------------------------
1 | /**
2 | * apples
3 | */
4 | function apples() {}
5 |
6 | var HelloMessage = React.createClass({
7 | render: function() {
8 | return Hello {this.props.name}
;
9 | }
10 | });
11 |
12 | ReactDOM.render(, mountNode);
13 |
--------------------------------------------------------------------------------
/__tests__/fixture/external.input.js:
--------------------------------------------------------------------------------
1 | require('external');
2 | require('external2');
3 | require('module-not-found');
4 |
5 | /**
6 | * I am in `external.input.js`.
7 | */
8 | function foo() {
9 | return 'bar';
10 | }
11 |
12 | module.exports = foo;
13 |
--------------------------------------------------------------------------------
/__tests__/fixture/factory.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * an area chart generator
3 | * @returns {area} chart
4 | */
5 | var area = function() {
6 | /**
7 | * @class area
8 | */
9 | var chart = function(selection) {};
10 |
11 | /**
12 | * Sets the chart data.
13 | * @function
14 | */
15 | chart.data = function(_) {};
16 |
17 | return chart;
18 | };
19 |
--------------------------------------------------------------------------------
/__tests__/fixture/flow-exported-opaque-type.input.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | /** MyOpaqueType Description Here */
4 | export opaque type MyOpaqueType: string = string
--------------------------------------------------------------------------------
/__tests__/fixture/flow-optional-chaining.input.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | /** foo */
4 | const foo: { prop1?: { prop2?: string } } = { prop1: { prop2: 'value' } };
5 | /** value */
6 | const value = foo?.prop1?.prop2;
7 |
--------------------------------------------------------------------------------
/__tests__/fixture/flow-unnamed-params.input.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | /** x */
4 | let x: T => string;
5 |
6 | /** x2 */
7 | let x2: (a: T) => string;
8 |
9 | /** T */
10 | type T = (string[]) => { num: number };
11 |
12 | /** T2 */
13 | type T2 = (a: string[]) => { num: number };
14 |
15 | /** T3 */
16 | type T3 = (a?: string) => { num: number };
17 |
--------------------------------------------------------------------------------
/__tests__/fixture/flow/comment-types.js:
--------------------------------------------------------------------------------
1 | // @flow
2 |
3 | /*::
4 | type Foo = {
5 | foo: number,
6 | bar: boolean,
7 | baz: string
8 | };
9 | */
10 |
11 | class MyClass {
12 | /*:: prop: Foo; */
13 |
14 | method(value /*: Foo */) /*: boolean */ {
15 | return value.bar;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/__tests__/fixture/html/documentation.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | - name: Highlighted section
3 | description: |
4 | The public key is a base64 encoded string of a protobuf containing an RSA DER
5 | buffer. This uses a node buffer to pass the base64 encoded public key protobuf
6 | to the multihash for ID generation.
7 |
8 | ```js
9 | var PeerId = require('peer-id')
10 |
11 | PeerId.create({ bits: 1024 }, (err, id) => {
12 | console.log(JSON.stringify(id.toJSON(), null, 2)
13 | })
14 | ```
15 |
16 | ```
17 | {
18 | "id": "Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi",
19 | "privKey": "CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..",
20 | "pubKey": "CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY..."
21 | }
22 | ```
23 |
--------------------------------------------------------------------------------
/__tests__/fixture/import.meta.input.js:
--------------------------------------------------------------------------------
1 | import x from "y";
2 |
3 |
4 | console.log(import.meta.url);
--------------------------------------------------------------------------------
/__tests__/fixture/infer-private.input.js:
--------------------------------------------------------------------------------
1 | // Options: {"inferPrivate": "^_"}
2 |
3 | /**
4 | * _p description
5 | */
6 | function _p() {}
7 |
8 | /** C description */
9 | class C {
10 | /** m description */
11 | m() {}
12 | /** _p description */
13 | _p() {}
14 | }
15 |
--------------------------------------------------------------------------------
/__tests__/fixture/inheritance.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * With ES6, built-in types are extensible!
3 | */
4 | class SpecialArray extends Array {
5 | additionalMethod() {}
6 | }
7 |
8 | /** @class Foo */
9 | module.exports = class Foo extends Bar {};
10 |
--------------------------------------------------------------------------------
/__tests__/fixture/inline-link.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Adds one to a number
3 | * @param {number} a the input
4 | * @returns {number} the output
5 | */
6 | function addOne(a) {
7 | return a + 1;
8 | }
9 |
10 | /**
11 | * This function returns the number one. Internally, this uses
12 | * {@link addOne} to do the math. This demonstrates
13 | * {@link https://en.wikipedia.org/wiki/Addition Addition}
14 | * and {@link https://en.wikipedia.org/wiki/Addition}
15 | *
16 | * This link refers to nothing: {@link nothing}
17 | *
18 | * @param {number} a the input
19 | * @returns {number} numberone
20 | */
21 | module.exports = function(a) {
22 | return addOne(a);
23 | };
24 |
--------------------------------------------------------------------------------
/__tests__/fixture/interface.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is my interface.
3 | */
4 | interface Foo extends Bar, Baz {
5 | /** This is prop 1 */
6 | prop1: number,
7 | /** This is prop 2 */
8 | prop2: string
9 | }
10 |
--------------------------------------------------------------------------------
/__tests__/fixture/internal.input.js:
--------------------------------------------------------------------------------
1 | var otherModule = require('./external.input.js');
2 | module.exports = otherModule;
3 |
--------------------------------------------------------------------------------
/__tests__/fixture/lends.input.js:
--------------------------------------------------------------------------------
1 | /**
2 | * A neat layout view
3 | * @class TheClass
4 | * @augments Augmented
5 | */
6 | export default TheClass(
7 | /** @lends TheClass.prototype */
8 | {
9 | /** My field */
10 | 'my-field': true,
11 | /**
12 | * My neat function
13 | * @param {string} word your word
14 | * @returns {string} your word but one better
15 | */
16 | foo: function(word) {
17 | return word + 1;
18 | },
19 | /**
20 | * My neat function
21 | * @param {string} word your word
22 | * @returns {string} your word but one better
23 | */
24 | bar(word) {
25 | return word + 1;
26 | }
27 | }
28 | );
29 |
--------------------------------------------------------------------------------
/__tests__/fixture/lint/lint.input.dependency.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @param {String} foo bar
3 | * @returns {object} bad object return type
4 | * @type {Array