Open ghost opened 7 years ago
| A constructor name should not start with a lowercase letter new-cap
That sounds like a lint error. If you capitalize the variable you assign it to, I suspect that would go away.
let Acl = require('acl');
I'm using JavaScript Standard Style and Atom.
This is a linter warning... I get the same:
A constructor name should not start with a lowercase letter.
It's referring to both acl
and acl.mongodbBackend()
, which are a constructors.
You can change acl
to Acl
or ACL
and that warning goes away, but I don't think you can do anything about mongodbBackend()
, it comes from the library.
It's annoying, but this thing works:
const Acl = require('acl')
const MongodbBackend = Acl.mongodbBackend
const acl = new Acl(new MonbodbBackend())
How would you rephrase it in ES6 syntax ?
var acl = require('acl'); acl = new acl(new acl.mongodbBackend(dbInstance, prefix))
I tried let acl = require('acl'); acl = new acl(new acl.mongodbBackend(conn.db,'acl_'))
currently I get 2 errors A constructor name should not start with a lowercase letter new-cap