Skip to content

Discrepancy in JSDoc and implementation in express.Router(), parameter required by documentation is actually optional #3598

@pubmikeb

Description

@pubmikeb

At the very beginning of my router (Express.js) there are the following lines of code:

"use strict";

let express = require('express');
let router = express.Router();

IntelliJ IDEA returns warning Invalid number of arguments regarding let router = express.Router();.
I checked the official documentation of Express.js (see express.Router), and there is the same line of code.

The IntelliJ IDEA response:

JSDoc defines special syntax for documenting which parameters are optional and IDEA respects this syntax.

The function in express.js is documented here as having a non-optional parameter, while the implementation makes it optional.

Please, have a look if there is a need to synchronize the documentation and implementation.

Details:
https://youtrack.jetbrains.com/issue/WEB-31658

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions