mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 22:11:12 +00:00
29 lines
676 B
JavaScript
29 lines
676 B
JavaScript
import { propertyName } from "../bindings.mjs";
|
|
|
|
const RAW_SESSION_FACTORIES = new Set([
|
|
"newCDPSession",
|
|
"newBrowserCDPSession",
|
|
]);
|
|
|
|
export default {
|
|
meta: {
|
|
type: "problem",
|
|
docs: {
|
|
description:
|
|
"Open Playwright CDP sessions only through the registered-command owner.",
|
|
},
|
|
schema: [],
|
|
messages: {
|
|
raw: "Use newPlaywrightCdpSession so every command is registered and every reply is admitted by its result schema.",
|
|
},
|
|
},
|
|
create(context) {
|
|
return {
|
|
MemberExpression(node) {
|
|
if (RAW_SESSION_FACTORIES.has(propertyName(node)))
|
|
context.report({ node, messageId: "raw" });
|
|
},
|
|
};
|
|
},
|
|
};
|