Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cartant
Created December 5, 2020 12:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cartant/7d3b0f48164fd4c9bbd6896ecb8cd6dd to your computer and use it in GitHub Desktop.
Save cartant/7d3b0f48164fd4c9bbd6896ecb8cd6dd to your computer and use it in GitHub Desktop.
const baseRule = require("./no-foreach");
module.exports = {
meta: {
/* ... */
},
create(context) {
const contextForBaseRule = new Proxy(context, {
get(target, property, receiver) {
if (property === "options") {
return [{ types: ["Array"] }];
}
return Reflect.get(target, property, receiver);
}
});
return baseRule.create(contextForBaseRule);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment