storybookjs / eslint-plugin-storybook

🎗Official ESLint plugin for Storybook
MIT License
245 stars 52 forks source link

Improve use-storybook-testing-library rule #15

Closed yannbf closed 2 years ago

yannbf commented 2 years ago

The rule should work with the following scenarios. It currently only works with scenario 1:

1.

import { within } from '@testing-library/react'

// becomes
import { within } from '@storybook/testing-library'

2.

import userEvent from '@storybook/user-event'

// becomes
import { userEvent } from '@storybook/testing-library'

3.

import { within } from '@testing-library/react'
import { userEvent } from '@storybook/user-event'

// becomes
import { within, userEvent } from '@storybook/testing-library'