Skip to content

Commit a6db9d6

Browse files
committed
updates
1 parent f35e97a commit a6db9d6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/rules/no-system-props.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ const {some, last} = require('lodash')
66
const excludedComponents = new Set(['Box', 'Text'])
77

88
// Components for which we allow a set of prop names
9-
const excludedComponentProps = new Map([['ProgressBar', new Set(['bg'])]])
9+
const excludedComponentProps = new Map([
10+
['Avatar', new Set(['size'])],
11+
['Label', new Set(['variant'])],
12+
['ProgressBar', new Set(['bg'])],
13+
['Spinner', new Set(['size'])]
14+
])
1015

1116
module.exports = {
1217
meta: {
@@ -100,7 +105,12 @@ const objectEntriesStringFromStylesMap = styles => {
100105

101106
// Given an array of styled prop attributes, return a mapping from attribute to expression
102107
const stylesMapFromPropNodes = (badProps, context) => {
103-
return new Map(badProps.map(a => [a.name.name, a.value.raw || context.getSourceCode().getText(a.value.expression)]))
108+
return new Map(
109+
badProps.map(a => [
110+
a.name.name,
111+
a.value === null ? 'true' : a.value.raw || context.getSourceCode().getText(a.value.expression)
112+
])
113+
)
104114
}
105115

106116
// Given a style map and an existing sx prop, return a style map containing

0 commit comments

Comments
 (0)