Backed out 2 changesets (bug 1943998) for causing wd failures @ phases.py CLOSED...
[gecko.git] / tools / moztreedocs / docs / jsdoc-support.rst
bloba9078fe93af3d566060aad723d29723b56895bbb
1 jsdoc support
2 =============
4 ESLint support
5 --------------
7 If you are looking to enable JSDoc generation for your documents, please also
8 enable the ESLint plugin for JSDoc if it is not already enabled.
10 In the top-level :searchfox:`.eslintrc-rollouts.js file <.eslintrc-rollouts.js>`
11 there are currently two sections where the ``valid-jsdoc`` and ``require-jsdoc``
12 rules are enabled. Please check that your component is not excluded from these
13 sections. If it is, you should remove the exclusion and fix any instances that
14 are raised by running
16 .. code-block:: shell
18     ./mach eslint path/to/component/
21 Enabling JSDoc generation
22 -------------------------
24 Here is a quick example, for the public AddonManager :ref:`API <AddonManager Reference>`
26 To use it for your own code:
28 #. Check that JSDoc generates the output you expect (you may need to use a @class annotation on "object initializer"-style class definitions for instance)
30 #. Create an `.rst file`, which may contain explanatory text as well as the API docs. The minimum will look something like
31    `this <https://firefox-source-docs.mozilla.org/_sources/toolkit/mozapps/extensions/addon-manager/AddonManager.rst.txt>`__.
33 #. Ensure your component is on the js_source_path here in the sphinx
34    config: https://hg.mozilla.org/mozilla-central/file/72ee4800d415/tools/docs/conf.py#l46
36 #. Run `mach doc` locally to generate the output and confirm that it looks correct.