mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
1.3 KiB
1.3 KiB
Meteor Core API (core)
This rules prevents misuse of the Meteor core API.
Rule Details
This rule aims to prevent reassigning or misusing any part of the Meteor core API, which consists of:
Meteor.isClientMeteor.isServerMeteor.isCordovaMeteor.startupMeteor.wrapAsyncMeteor.absoluteUrlMeteor.settingsMeteor.release
The following patterns are considered warnings:
// reassigning any part of the Meteor core API
Meteor.isClient = true
// calling Meteor.startup with anything but one argument
Meteor.startup()
Meteor.startup(foo, bar)
// calling Meteor.wrapAsync with an invalid argument count
Meteor.wrapAsync()
Meteor.wrapAsync(function () {}, context, foo)
// calling Meteor.absoluteUrl with an invalid argument count
Meteor.absoluteUrl(foo, bar, baz)
The following patterns are not warnings:
Meteor.startup(x)
Meteor.startup(() => {})
Meteor.startup(function () {})
if (Meteor.isClient) {
console.log('Hello world')
}
Meteor.wrapAsync(function () {})
Meteor.wrapAsync(function () {}, context)
Meteor.absoluteUrl()
Meteor.absoluteUrl('/foo')
Meteor.absoluteUrl('/foo', { secure: true })