Skip to content

Commit 6aa1d90

Browse files
committed
Add subcomponents to allow list
1 parent 8c30e0b commit 6aa1d90

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/rules/__tests__/no-system-props.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ ruleTester.run('no-system-props', rule, {
2020
`import {ProgressBar} from '@primer/react'; <ProgressBar bg="howdy" />`,
2121
`import {Button} from '@primer/react'; <Button {...someExpression()} />`,
2222
`import {Button} from '@primer/react'; <Button variant="large" />`,
23-
`import {Button} from '@primer/react'; <Button size="large" />`
23+
`import {Button} from '@primer/react'; <Button size="large" />`,
24+
`import {ActionMenu} from '@primer/react'; <ActionMenu.Overlay width="large" />`
2425
],
2526
invalid: [
2627
{

src/rules/no-system-props.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,29 @@ const utilityComponents = new Set(['Box', 'Text'])
1313

1414
// Components for which we allow a set of prop names
1515
const excludedComponentProps = new Map([
16+
['ActionMenu.Overlay', new Set(['width', 'height', 'maxHeight', 'position', 'top', 'right', 'bottom', 'left'])],
17+
['Autocomplete.Overlay', new Set(['width', 'height', 'maxHeight', 'position', 'top', 'right', 'bottom', 'left'])],
1618
['AnchoredOverlay', new Set(['width', 'height'])],
1719
['Avatar', new Set(['size'])],
1820
['AvatarToken', new Set(['size'])],
1921
['CircleOcticon', new Set(['size'])],
2022
['Dialog', new Set(['width', 'height'])],
2123
['IssueLabelToken', new Set(['size'])],
24+
['Overlay', new Set(['width', 'height', 'maxHeight', 'position', 'top', 'right', 'bottom', 'left'])],
2225
['ProgressBar', new Set(['bg'])],
2326
['Spinner', new Set(['size'])],
27+
['SplitPageLayout.Header', new Set(['padding'])],
28+
['SplitPageLayout.Footer', new Set(['padding'])],
29+
['SplitPageLayout.Pane', new Set(['padding', 'position', 'width'])],
30+
['SplitPageLayout.Content', new Set(['padding', 'width'])],
2431
['StyledOcticon', new Set(['size'])],
2532
['PointerBox', new Set(['bg'])],
2633
['Token', new Set(['size'])],
2734
['PageLayout', new Set(['padding'])],
35+
['PageLayout.Header', new Set(['padding'])],
36+
['PageLayout.Footer', new Set(['padding'])],
37+
['PageLayout.Pane', new Set(['padding', 'position', 'width'])],
38+
['PageLayout.Content', new Set(['padding', 'width'])],
2839
['ProgressBar', new Set(['bg'])],
2940
['PointerBox', new Set(['bg'])]
3041
])

0 commit comments

Comments
 (0)