Jeff Williams 4badaef5fd better config loading (#1550)
+ Use `cosmiconfig` instead of rolling our own code (which gives us YAML support)
+ Look for the config in these locations, and in this order:
    + A `jsdoc` property in `package.json`
    + `.jsdocrc` (can be JSON or YAML; comments not allowed for JSON)
    + `.jsdocrc.json` (comments allowed)
    + `.jsdocrc.yaml`
    + `.jsdocrc.yml`
    + `.jsdocrc.js`
    + `jsdoc.config.js`
2019-01-25 19:33:18 -08:00

79 lines
2.3 KiB
JavaScript

/**
* The default configuration settings for JSDoc.
*
* @module @jsdoc/config/defaults
*/
module.exports = {
// TODO(hegemonic): integrate CLI options with other options
opts: {
destination: './out',
encoding: 'utf8'
},
/**
* The JSDoc plugins to load.
*/
plugins: [],
// TODO(hegemonic): move to `source` or remove
recurseDepth: 10,
// TODO(hegemonic): switch to glob patterns
/**
* Settings for loading and parsing source files.
*/
source: {
/**
* A regular expression that matches source files to exclude from processing.
*
* To exclude files if any portion of their path begins with an underscore, use the value
* `(^|\\/|\\\\)_`.
*/
excludePattern: '',
/**
* A regular expression that matches source files that JSDoc should process.
*
* By default, all source files with the extensions `.js`, `.jsdoc`, and `.jsx` are
* processed.
*/
includePattern: '.+\\.js(doc|x)?$',
/**
* The type of source file. In general, you should use the value `module`. If none of your
* source files use ECMAScript >=2015 syntax, you can use the value `script`.
*/
type: 'module'
},
/**
* Settings for interpreting JSDoc tags.
*/
tags: {
/**
* Set to `true` to allow tags that JSDoc does not recognize.
*/
allowUnknownTags: true,
// TODO(hegemonic): use module paths, not magic strings
/**
* The JSDoc tag dictionaries to load.
*
* If you specify two or more tag dictionaries, and a tag is defined in multiple
* dictionaries, JSDoc uses the definition from the first dictionary that includes that tag.
*/
dictionaries: [
'jsdoc',
'closure'
]
},
/**
* Settings for generating output with JSDoc templates.
*/
templates: {
/**
* Set to `true` to use a monospaced font for links to other code symbols, but not links to
* websites.
*/
cleverLinks: false,
/**
* Set to `true` to use a monospaced font for all links.
*/
monospaceLinks: false
}
};