Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] jsx-uses-react: mark fragment variables as used #2775

Merged
merged 1 commit into from Aug 29, 2020

Conversation

remcohaszing
Copy link
Contributor

This allows to use the following syntax:

import { createElement, Fragment } from 'react';

function Component {
  return <></>;
}

Or more common in Preact:

import { Fragment, h } from 'preact';

function Component {
  return <></>;
}

The react.fragment setting already existed for other rules, but it was
undocumented.

This allows to use the following syntax:

```jsx
import { createElement, Fragment } from 'react';

function Component {
  return <></>;
}
```

Or more common in Preact:

```jsx
import { Fragment, h } from 'preact';

function Component {
  return <></>;
}
```

The `react.fragment` setting already existed for other rules, but it was
undocumented.
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is documenting an existing setting, and it's either patch or minor to add it to jsx-uses-react, but I think it's reasonable to call this a bug fix.

@ljharb ljharb force-pushed the jsx-uses-react-fragment branch 2 times, most recently from 3125cb7 to 911f66e Compare August 29, 2020 05:58
@ljharb ljharb merged commit 911f66e into jsx-eslint:master Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants