Created
December 5, 2020 12:52
-
-
Save cartant/7d3b0f48164fd4c9bbd6896ecb8cd6dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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