You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li>If recursion is enabled with the <ahref="about-commandline.html"><code>-r</code> command-line flag</a>, JSDoc will search for files 10 levels deep (<code>recurseDepth</code>).</li>
105
109
<li>Only files ending in <code>.js</code>, <code>.jsdoc</code>, and <code>.jsx</code> will be processed (<code>source.includePattern</code>).</li>
106
110
<li>Any file starting with an underscore, or in a directory starting with an underscore, will be ignored (<code>source.excludePattern</code>).</li>
111
+
<li>JSDoc supports code that uses <ahref="howto-es2015-modules.html">ES2015 modules</a> (<code>sourceType</code>).</li>
107
112
<li>JSDoc allows you to use unrecognized tags (<code>tags.allowUnknownTags</code>).</li>
108
113
<li>Both standard JSDoc tags and <ahref="https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#jsdoc-tags">Closure Compiler tags</a> are enabled (
<p>The <code>recurseDepth</code> option controls how many levels deep JSDoc will recursively search for source files and tutorials. This option is used only if
134
-
you also specify the <ahref="about-commandline.html"><code>-r</code> command-line
135
-
flag</a>, which tells JSDoc to recursively search for input files.</p>
138
+
<p>The <code>recurseDepth</code> option controls how many levels deep JSDoc will recursively search for source files and tutorials. This option is available in
139
+
JSDoc 3.5.0 and later. This option is used only if you also specify the <ahref="about-commandline.html"><code>-r</code> command-line flag</a>, which tells
<li>JSDoc applies <code>source.excludePattern</code>, which removes <code>myProject/_private/a.js</code>.</li>
223
228
<li>JSDoc applies <code>source.exclude</code>, which removes <code>myProject/lib/ignore.js</code>.</li>
224
229
</ol>
230
+
<h2id="specifying-the-source-type">Specifying the source type</h2>
231
+
<p>The <code>sourceType</code> option affects how JSDoc parses your JavaScript files. This option is available in JSDoc 3.5.0 and later. This option accepts the
232
+
following values:</p>
233
+
<ul>
234
+
<li><code>module</code> (default): Use this value for most types of JavaScript files.</li>
235
+
<li><code>script</code>: Use this value if JSDoc logs errors such as <code>Delete of an unqualified identifier in
236
+
strict mode</code> when it parses your code.</li>
237
+
</ul>
238
+
<figure><preclass="prettyprint lang-js"><code>{
239
+
"sourceType": "module"
240
+
}
241
+
</code></pre>
242
+
</figure>
225
243
<h2id="incorporating-command-line-options-into-the-configuration-file">Incorporating command-line options into the configuration file</h2>
226
244
<p>You can put many of JSDoc's <ahref="about-commandline.html">command-line options</a> into the configuration file instead of specifying them on the command
227
245
line. To do this, add the long names of the relevant options into an
0 commit comments