Skip to content

Files

Latest commit

 

History

History
42 lines (30 loc) · 830 Bytes

jsx-import.md

File metadata and controls

42 lines (30 loc) · 830 Bytes

Pattern: Missing jsx import from @emotion/react

Issue: -

Description

Ensures that jsx from @emotion/react is imported. This rule can usually be auto-fixed so you should not usually have to do anything yourself.

Example of incorrect code for this rule:

let element = (
  <div
    css={{
      color: 'green'
    }}
  />
)

Example of correct code for this rule:

/** @jsx jsx */
import { jsx } from '@emotion/react'

let element = (
  <div
    css={{
      color: 'green'
    }}
  />
)

When Not To Use It

If you are using a babel plugin or something like that to add imports and set the jsx pragma.

Further Reading