How to forbid a specific named function with ESlint

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!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)