tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
908 stars 86 forks source link

JSDoc inaccuracy #273

Open cspotcode opened 5 years ago

cspotcode commented 5 years ago

https://github.com/tschaub/mock-fs/blob/master/lib/index.js#L118-L126

The JSDoc says that options is required, and that the properties of the options object are also required. Those properties need to be wrapped in square brackets to indicate that they're optional.

The JSDoc comments drive code intelligence in editors. Without flagging the arg and props as optional, editors will flag omissions as an error.

 * @param {Object} [options] Any filesystem options.
 * @param {boolean} [options.createCwd] Create a directory for `process.cwd()`
 *     (defaults to `true`).
 * @param {boolean} [options.createTmp] Create a directory for `os.tmpdir()`
 *     (defaults to `true`)