diff --git a/README.md b/README.md index b28aea39a..dc47479b4 100644 --- a/README.md +++ b/README.md @@ -6013,6 +6013,10 @@ enum Example { test = 123 } // Options: [{"contexts":["TSEnumDeclaration"]}] + +const foo = {...{}}; +function bar() {} +// Options: [{"exemptEmptyFunctions":false,"publicOnly":true,"require":{"ArrowFunctionExpression":true,"ClassDeclaration":true,"ClassExpression":true,"FunctionDeclaration":true,"FunctionExpression":false,"MethodDefinition":true}}] ```` diff --git a/src/exportParser.js b/src/exportParser.js index a7c8657ce..b8bb8ba26 100644 --- a/src/exportParser.js +++ b/src/exportParser.js @@ -105,6 +105,9 @@ const getSymbol = function (node, globals, scope, opt) { const val = createNode(); val.type = 'object'; node.properties.forEach((prop) => { + if (prop.type === 'ExperimentalSpreadProperty') { + return; + } const propVal = getSymbol(prop.value, globals, scope, opts); /* istanbul ignore next */ if (propVal) { diff --git a/test/rules/assertions/requireJsdoc.js b/test/rules/assertions/requireJsdoc.js index 60e468c66..05bdea68e 100644 --- a/test/rules/assertions/requireJsdoc.js +++ b/test/rules/assertions/requireJsdoc.js @@ -2325,5 +2325,34 @@ export default { sourceType: 'module', }, }, + { + // https://github.com/gajus/eslint-plugin-jsdoc/issues/378 + code: ` + const foo = {...{}}; + function bar() {} + `, + options: [ + { + exemptEmptyFunctions: false, + publicOnly: true, + require: { + ArrowFunctionExpression: true, + ClassDeclaration: true, + ClassExpression: true, + FunctionDeclaration: true, + FunctionExpression: false, + MethodDefinition: true, + }, + }, + ], + parser: require.resolve('babel-eslint'), + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 2017, + sourceType: 'module', + }, + }, ], };