Check the browser compatibility of your code
It seems at the very least the plugin has trouble detecting callExpressions on HTMLElements. ```js /* This errors as expected with: HTMLElement.attachInternals() is not supported in iOS Safari 15.6-15.8eslint[compat/compat](https://github.com/amilajack/eslint-plugin-compat/blob/master/docs/rules/compat.md) */ globalThis.HTMLElement.attachInternals(); /* None of these cases error despite clearly either: * a) extending the `HTMLElement` object interface or * b) straight up being an instance of HTMLElement */ const x = globalThis.HTMLElement; new x().attachInternals(); const foo = document.createElement('custom-element'); foo.attachInternals(); class y extends HTMLElement { constructor () { this.attachInternals(); } } new y().attachInternals(); ``` Looking through the source code, it seems like the algorithm we're using to match for failing rules in [lintMemberExpression](https://github.com/amilajack/eslint-plugin-compat/blob/506819bd19cbfee558abc5a6edbd57064a620037/src/helpers.ts#L135C17-L135C37) isn't able to match failingRules on these cases. ```js const foo = document.createElement('custom-element'); foo.attachInternals(); ``` The expected rule.object here is HTMLElement, rule.property `attachInternals()` The evaluated node object name is `foo`, node property `attachInternals()` This fails the failingRule check on [line 170](https://github.com/amilajack/eslint-plugin-compat/blob/506819bd19cbfee558abc5a6edbd57064a620037/src/helpers.ts#L170) ```js class y extends HTMLElement { constructor () { this.attachInternals(); } } ``` The expected `protochainId` here is `HTMLElement.attachInternals()` the evaluated protochainId is `attachInternals()` It seems we're unable to evaluate / not evaluating the superclass of the `ClassDeclaration` represented by the `ThisExpression`. This fails the failingRule check on [line 156](https://github.com/amilajack/eslint-plugin-compat/blob/506819bd19cbfee558abc5a6edbd57064a620037/src/helpers.ts#L156) Notably I get the same issue with other callexpressions on HTMLElement such as [hidePopover](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/hidePopover) and [showPopover](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/showPopover) Though given the above examples I've given, this may be a larger problem with matching failing rules on memberExpressions. I've created a minimal reproduction case [here](https://github.com/gwyneplaine/eslint-plugin-compat-bug-repro). This leverages the latest version of this package with `[email protected]`, notably the same issue occurs with `[email protected]`
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by gwyneplaine and has received 1 comments.