mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
1.1 KiB
1.1 KiB
Core API for methods (methods)
Prevent misusage of methods.
Rule Details
This rule aims to prevent errors when using methods.
The following patterns are considered warnings:
Meteor.methods() // missing argument
Meteor.call() // missing argument
Meteor.apply() // missing argument
new Meteor.Error() // missing argument
Meteor.methods({
foo: function () {
this.userId = true // can not be changed
this.isSimulation++ // can not be changed
this.connection++ // update not allowed
this.unblock = true // can not be changed; allowed on server only
this.setUserId() // missing argument; allowed on server only
}
})
The following patterns are not warnings:
Meteor.call('foo')
Meteor.apply('foo', [])
Meteor.methods({
foo: function () {
return Bar.find({ _id: this.userId })
}
})
Limitations
- Does not verify usage of DDPRateLimiter.