Skip to content

Commit

Permalink
Add lint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Aug 16, 2024
1 parent c50d0e9 commit 9ce79ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,13 @@ module.exports = {
componentName +
' should have the `__next40pxDefaultSize` prop to opt-in to the new default size.',
} ) ),
{
// Falsy `__next40pxDefaultSize` without a `render` prop.
selector:
'JSXOpeningElement[name.name="FormFileUpload"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"][value.expression.value!=false])):not(:has(JSXAttribute[name.name="render"]))',
message:
'FormFileUpload should have the `__next40pxDefaultSize` prop to opt-in to the new default size.',
},
// Temporary rules until all existing components have the `__next40pxDefaultSize` prop.
...[ 'SelectControl', 'TextControl' ].map(
( componentName ) => ( {
Expand Down

0 comments on commit 9ce79ea

Please sign in to comment.