jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
8.86k stars 2.75k forks source link

autofix-unused-prop-type #3725

Closed Veveue closed 2 months ago

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.42%. Comparing base (e4ecbcf) to head (656ca95).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3725 +/- ## ========================================== - Coverage 97.76% 94.42% -3.34% ========================================== Files 133 133 Lines 9467 9477 +10 Branches 3467 3470 +3 ========================================== - Hits 9255 8949 -306 - Misses 212 528 +316 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ljharb commented 2 months ago

It seems very dangerous to me to assume that it's safe to remove just because it's unused. Autofixing has a very high bar for when it's safe, and "removal" is generally not done with autofixes.

Veveue commented 2 months ago

It seems very dangerous to me to assume that it's safe to remove just because it's unused. Autofixing has a very high bar for when it's safe, and "removal" is generally not done with autofixes.

I want to automatically fix many unnecessary imports caused by copying and pasting code.

ljharb commented 2 months ago

Yes, but your desire to do less work doesn't mean the autofix is a safe thing to enable.

You could certainly implement this as a suggestion, though, if you like?

Veveue commented 2 months ago

I understand. I will handle this issue locally. Thank you for your suggestion!