testing-library / eslint-plugin-testing-library

ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library
https://npm.im/eslint-plugin-testing-library
MIT License
966 stars 133 forks source link

Drop support for `{framework}-testing-library` module imports #628

Open Belco90 opened 1 year ago

Belco90 commented 1 year ago

Drop support for {framework}-testing-library module imports, in favor of supporting only the testing-library scoped format (@testing-library/{framework})

There is an exception for Marko Testing Library tho.

skovy commented 1 year ago

Is this primarily for no-dom-import, or does this affect other rules?

Belco90 commented 1 year ago

This technically applies to all rules, since we check both import declarations and require call expressions in the detect-testing-library-utils. If you open lib/create-testing-library-rule/detect-testing-library-utils.ts in line 1036, you'll see we are detecting Testing Library imports with require() in there. We would have to remove that block entirely, and remove/update all the examples importing with require().

skovy commented 1 year ago

Ah that makes sense, thanks for that additional context! I'll see if I can pick this up in the coming days/weeks

Belco90 commented 1 year ago

Taking care of this one.

Belco90 commented 11 months ago

Back to TODO.