You can do some very fancy things when you combine ESLint’s no-restricted-syntax
rule with selectors
. In your case you should be able to achieve the linting you want without writing your own plugin. The rule would look something like:
{
rules: {
'no-restricted-syntax': [
'error',
{
message: "Please don't use asMutable. We don't like it!",
selector:
'MemberExpression > Identifier[name="asMutable"]'
}
]
}
}
Study the documentation page for selectors
; it is very flexible!