A function with a name starting with an uppercase letter should only be used as a constructor.
The sentence const router = express.Router(); issues with AirBnb eslint.
Can you provide more context? This isn't really a bug, just an issue with your chosen linting. Why not just use new?
Yea, looks like a non-issue to me :) express.Router _is a constructor_; you can do new express.Router(). The new is optional, just like many of the object constructors in JavaScript itself (i.e. Error('oh no!') and new Error('oh no!') are identical, as the new keyword is optional).
Ok, thanks for the quickly response!
Most helpful comment
Yea, looks like a non-issue to me :)
express.Router_is a constructor_; you can donew express.Router(). Thenewis optional, just like many of the object constructors in JavaScript itself (i.e.Error('oh no!')andnew Error('oh no!')are identical, as thenewkeyword is optional).