JamieMason / eslint-plugin-prefer-arrow-functions

Auto-fix plain Functions into Arrow Functions, in all cases where conversion would result in the same behaviour
https://www.npmjs.com/package/eslint-plugin-prefer-arrow-functions
MIT License
43 stars 11 forks source link

fix: adjusts fix for generic type arguments on TSX files #32

Open renato-bohler opened 4 months ago

renato-bohler commented 4 months ago

Description (What)

This PR implements an adjustment on the auto=fixer when transforming generic TSX components with one type argument.

Fixes #27

Justification (Why)

Otherwise, the auto-fix will generate invalid TSX syntax.

How Can This Be Tested?

I added unit tests, but I used a few React + TypeScript codebases to test this on, plus unit tests.

renato-bohler commented 4 months ago

CI failing because Node is 16, while a dependency requires >=18. Similar to https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions/pull/31#issuecomment-1963919099

https://github.com/JamieMason/eslint-plugin-prefer-arrow-functions/actions/runs/8126337559/job/22209940539?pr=32#step:4:8