rune-sdk
Version:
Build a multiplayer game played by millions! Your game runs inside the Rune app with 10 million installs across [iOS](https://apps.apple.com/app/rune-games-and-voice-chat/id1450358364) and [Android](https://play.google.com/store/apps/details?id=ai.rune.ti
31 lines (30 loc) • 878 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = exports.meta = void 0;
exports.meta = {
type: "problem",
docs: {
description: "Only allow using Date() with provided initial value",
recommended: true,
},
schema: [],
messages: {
noEmptyDate: "Use Rune.gameTime()/Rune.worldTime() instead, which keeps time synchronized across players.",
},
};
var create = function (context) {
return {
NewExpression: function (node) {
if (node.callee.type !== "Identifier" || node.callee.name !== "Date") {
return;
}
if (!node.arguments.length) {
context.report({
node: node,
messageId: "noEmptyDate",
});
}
},
};
};
exports.create = create;