ember-cli / eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
MIT License
257 stars 198 forks source link

Fix false positive error for `no-runloop` #2151

Closed mkszepp closed 1 week ago

mkszepp commented 3 weeks ago

fix #2150

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

ef4 commented 1 week ago

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 commented 1 week ago

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

ef4 commented 1 week ago

I think the tests can stay, thanks.