Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positive error for no-runloop #2151

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Jun 4, 2024

fix #2150

Unfortunately, I have no experience with eslint rules yet, but this should solve our problem

@ef4
Copy link
Contributor

ef4 commented Jun 18, 2024

This is probably the wrong place to fix this. The problem is that the rule is using a POJO:

https://github.com/ember-cli/eslint-plugin-ember/blob/bf4637b674454a69bb086ebec7ca1f0e942a146e/lib/rules/no-runloop.js#L78C39-L79C1

to store the mapping from local names to imported names, so it will always accidentally match methods that are present on Object.

Please just change that POJO to a Map and this extra check will not be needed.

@mkszepp
Copy link
Contributor Author

mkszepp commented Jun 21, 2024

@ef4 thanks for input. Tests do pass with this change. should we hold the added tests or can we safely remove?

@ef4
Copy link
Contributor

ef4 commented Jun 21, 2024

I think the tests can stay, thanks.

@ef4 ef4 merged commit 91657d4 into ember-cli:master Jun 21, 2024
8 checks passed
@mkszepp mkszepp deleted the fix-false-positive-no-runloop branch June 21, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ember/no-runloop brings false positive error with function name hasOwnProperty
3 participants