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

@remcohaszing remcohaszing commented Aug 28, 2020

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.
@ljharb
ljharb approved these changes Aug 29, 2020
Copy link
Collaborator

@ljharb ljharb left a comment

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 remcohaszing:jsx-uses-react-fragment branch 2 times, most recently from 3125cb7 to 911f66e Aug 29, 2020
@ljharb ljharb merged commit 911f66e into yannickcr:master Aug 29, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.0009%) to 97.494%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.