Skip to content

Commit

Permalink
Adds documentation for integrating with eslint-plugin-react (#2882)
Browse files Browse the repository at this point in the history
* adds documentation for eslint plugin react

* Improve writing in eslint-plugin-react page

* Update docs/eslint-plugin-react.mdx

Co-authored-by: Sam Magura <srmagura@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
3 people authored Sep 13, 2022
1 parent 5ffa54a commit 5fa2d54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- testing
- typescript
- flow
- eslint-plugin-react

# This loads the READMEs instead of files in docs/
- title: Packages
Expand Down
15 changes: 15 additions & 0 deletions docs/eslint-plugin-react.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: 'eslint-plugin-react'
---

The [`react/no-unknown-property` rule](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md) from [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) will produce an error if the `css` prop is passed to a DOM element. This violation of the rule can be safely ignored because `@emotion/react` intercepts the `css` prop before it is applied to the DOM element.

The rule can be configured to ignore the `css` prop like so:

```json
{
"rules": {
"react/no-unknown-property": ["error", { "ignore": ["css"] }]
}
}
```

0 comments on commit 5fa2d54

Please sign in to comment.