Skip to Content

ESLint rule require-jsdoc isn't working properly in Multi-cloud WebIDE

I've tried to use the eslint rule require-jsdoc in the multi-cloud WebIDE. However it doesn't seem to work properly. I think this is due to the way we write javascript in UI5. If i write a native javascript function, then the rule picks it up.

Below picture is my function in a SAPUI5 Controller JS file, which isn't picked up. The error you see below is for the myfunction in the test.js file, which is a native Javascript function.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 19, 2017 at 06:14 AM

    Hi JaKob,

    Actually it works as expected. Eslint "require-jsdoc" rule works on following options:

    "require":{"FunctionDeclaration":true,"MethodDefinition":false,"ClassDeclaration":false,"ArrowFunctionExpression":false}

    https://eslint.org/docs/rules/require-jsdoc

    In your case the function is not from type of "FunctionDeclaration" but from type of "property".

    You can easily check it with: https://eslint.org/parser/

    Thanks,

    Alex

    Add comment
    10|10000 characters needed characters exceeded