ember-cli / ember-cli/eslint-plugin-ember

no-implicit-injections has bugs when auto-fixing

Open
#2,154 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

1) The added service injection doesn't format properly - it removes indents from the existing line it's inserted above
![Injection formatting](https://github.com/ember-cli/eslint-plugin-ember/assets/1325482/3348c2be-a1d8-41b6-ba8d-6896a82fd599)

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](https://github.com/ember-cli/eslint-plugin-ember/assets/1325482/99913963-1628-4ef0-9220-f31ecc4447f1)
![Duplicate Import 2](https://github.com/ember-cli/eslint-plugin-ember/assets/1325482/4b047b77-c8db-456c-9bdc-c7b5d2ffe42f)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.