Skip to content

enforceExistence is not working with ES2015 exports #159

@AlexanderZeilmann

Description

@AlexanderZeilmann

With "enforceExistence": true and the following function

/**
 * A square method
 *
 * @param  {number} n  - The numbe to be squared
 * @return {number} The square of the number
 */
export default function square (n) {
  return n * n;
}

I get the following error (using jscs 2.2.0, jscs-doc 1.2.0)

->jscs test.js --verbose
jsDoc: Expect valid jsdoc-block definition at test.js :
     5 | * @return {number} The square of the number
     6 | */
     7 |export default function square (n) {
-----------------------^
     8 |  return n * n;
     9 |}


1 code style error found.

The error does not occur when using jscs 2.2.0, jscs-doc 1.1.0.

With the following snippet everything is working

/**
 * A square method
 *
 * @param  {number} n  - The numbe to be squared
 * @return {number} The square of the number
 */
function square (n) {
  return n * n;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions