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

no-implicit-injections has bugs when auto-fixing #2154

Open elwayman02 opened 4 days ago

elwayman02 commented 4 days ago

1) The added service injection doesn't format properly - it removes indents from the existing line it's inserted above Injection formatting

2) The autofix tries to import the service decorator at the top of the file. It not only does so using the old deprecated syntax { inject as service }, but it fails to detect when the expected modern import { service } already exists and ends up incorrectly duplicating the imports.

Duplicate Import 1 Duplicate Import 2