Skip to content

Commit e5c8199

Browse files
authored
Merge pull request #31 from primer/colebemis-patch-2
no-system-props: Always ignore size prop
2 parents f8381ee + d2e7495 commit e5c8199

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

.changeset/tender-humans-rest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-primer-react": patch
3+
---
4+
5+
`no-system-props`: Always ignore `size` prop

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

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

src/rules/no-system-props.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ const utilityComponents = new Set(['Box', 'Text'])
1313
// Components for which we allow a set of prop names
1414
const excludedComponentProps = new Map([
1515
['AnchoredOverlay', new Set(['width', 'height'])],
16-
['Avatar', new Set(['size'])],
1716
['Dialog', new Set(['width', 'height'])],
1817
['ProgressBar', new Set(['bg'])],
19-
['Spinner', new Set(['size'])],
20-
['StyledOcticon', new Set(['size'])],
2118
['PointerBox', new Set(['bg'])]
2219
])
2320

24-
const alwaysExcludedProps = new Set(['variant'])
21+
const alwaysExcludedProps = new Set(['variant', 'size'])
2522

2623
module.exports = {
2724
meta: {

0 commit comments

Comments
 (0)