Skip to content

Commit d808c30

Browse files
committed
fix: add back default
eslint-plugin-jsdoc automatically removes these. Fair enough for 99% of cases, but `unicorn/no-object-as-default-parameter` _correctly_ points out that default objects need to be spread. This adds back the jsdoc docs for this specific case.
1 parent 5b0535b commit d808c30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fs-wrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ function readJsonFileSync(file) {
4646
* Read a file using Promises.
4747
*
4848
* @param {Path} file
49-
* @param {fs.BaseEncodingOptions & { flag?: fs.OpenMode | undefined }} [options]
49+
* @param {fs.BaseEncodingOptions & { flag?: fs.OpenMode | undefined }} [options={encoding: 'utf8'}]
5050
* @returns {Promise<string>}
5151
*/
52-
async function readFile(file, options) {
52+
async function readFile(file, options = {}) {
5353
const data = await fsp.readFile(file, {encoding: 'utf8', ...options});
5454
return data.toString();
5555
}

0 commit comments

Comments
 (0)