src/content/docs/linter/rules/use-fragment-syntax.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JSX and TSX" icon="seti:javascript"> ## Summary - Rule available since: `v1.0.0` - Diagnostic Category: [`lint/style/useFragmentSyntax`](/reference/diagnostics#diagnostic-category) - This rule isn't recommended, so you need to enable it. - This rule has an [**unsafe**](/linter/#unsafe-fixes) fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - Sources: - Same as [`react/jsx-fragments`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-fragments.md){
"linter": {
"rules": {
"style": {
"useFragmentSyntax": "error"
}
}
}
}
This rule enforces the use of <>...</> over <Fragment>...</Fragment>.
The shorthand fragment syntax saves keystrokes and is only inapplicable when keys are required.
<Fragment>child</Fragment>
<React.Fragment>child</React.Fragment>