atsikov / eslint-jest-testing-library-codemod

A set of autofixes for eslint-plugin-testing-library to make migration less painful
https://github.com/atsikov/eslint-jest-testing-library-codemod
15 stars 2 forks source link

Merging this codemod into eslint-plugin-testing-library #8

Open Belco90 opened 2 years ago

Belco90 commented 2 years ago

Hi @atsikov!

This codemod repo is pretty useful! Would you be interested into bringing this into eslint-plugin-testing-library itself to corresponding rules as autofixes or suggestions?

atsikov commented 2 years ago

Hi @Belco90

I like the idea, however I'm not sure all the logic could be migrated to the plugin. As far as I know, unlike jscodeshift, eslint doesn't allow to parse module multiple times in a single rule, and at least prefer-screen-queries heavily relies on this feature.

I need to take a look which fixes are missing in your plugin and what could be migrated.

Belco90 commented 2 years ago

That's a good point.

All the fixes from your codemod are missing in the plugin, so whatever could be migrated there would be really helpful.

MincoKe commented 8 months ago

as I known, some code like import xxx from 'xxx.json' assert { type: 'json' }; will fail to transform so I think it's a lot of effort to to this job