我正在尝试使用node_acl插件,如README
中所述...
const conn = mongoose.connection;
var acl = require('acl');
// Using the mongodb backend
acl = new acl(new acl.mongodbBackend(dbInstance, prefix));
所以我写了
[30] let acl = require('acl');
[31]
[32] acl = new acl(new acl.mongodbBackend(mongoose.db, 'acl'));
[30] let acl = require('acl');
[31]
[32] conn.on('connected', (error) => {
[33] if (error) throw error;
[34] acl = new acl(new acl.mongodbBackend(conn.db, 'acl_'));
[35] });
但是ESLint提出了2个错误
✖ 34:13 A constructor name should not start with a lowercase letter new-cap
✖ 34:25 A constructor name should not start with a lowercase letter new-cap
我应该如何在ES8中使用它?
感谢您的反馈