Skip to content

Commit 557e6f2

Browse files
committed
docs
1 parent 9f9298b commit 557e6f2

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/rules/no-system-props.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Disallow use of style system props (no-system-colors)
2+
3+
🔧 The `--fix` option on the [ESLint CLI](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
4+
5+
System props are deprecated in Primer components (excluding utility components).
6+
7+
## Rule details
8+
9+
This rule disallows use of any styled system prop on a Primer component.
10+
11+
\*The two non-deprecated utility components (`Box` and `Text`) are allowed to use system props.
12+
13+
👎 Examples of **incorrect** code for this rule:
14+
15+
```jsx
16+
/* eslint primer-react/no-system-props: "error" */
17+
import {Button} from '@primer/components'
18+
19+
<Button width={200} />
20+
<Button width={200} sx={{height: 300}} />
21+
```
22+
23+
👍 Examples of **correct** code for this rule:
24+
25+
```jsx
26+
/* eslint primer-react/no-system-props: "error" */
27+
import {Box, Button, ProgressBar} from '@primer/components'
28+
import {Avatar} from 'some-other-library'
29+
30+
<Button sx={{width: 200}} />,
31+
<Button someOtherProp="foo" />,
32+
33+
<ProgressBar bg="howdy" />
34+
35+
<Box width={200} />,
36+
37+
<Avatar width={200} />,
38+
```

0 commit comments

Comments
 (0)