Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eslint-plugin-clsx #5547

Merged
merged 3 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = {
'plugin:primer-react/recommended',
'plugin:import/typescript',
'plugin:ssr-friendly/recommended',
'plugin:clsx/recommended',
],
settings: {
react: {
Expand Down Expand Up @@ -89,6 +90,7 @@ module.exports = {
'github/role-supports-aria-props': 'off',
'no-restricted-syntax': 'off',
'primer-react/a11y-use-next-tooltip': 'off',
'clsx/no-redundant-clsx': 'error',
},
overrides: [
// rules which apply only to JS
Expand Down
197 changes: 196 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@typescript-eslint/parser": "^7.3.1",
"eslint": "8.56.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-clsx": "0.0.9",
"eslint-plugin-github": "5.0.2",
"eslint-plugin-jest": "28.8.3",
"eslint-plugin-jsx-a11y": "6.7.1",
Expand Down
7 changes: 3 additions & 4 deletions packages/react/src/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ import type {
TypographyProps,
} from 'styled-system'
import {background, border, color, flexbox, grid, layout, position, shadow, space, typography} from 'styled-system'
import type {BetterSystemStyleObject} from '../sx'
import type {SxProp} from '../sx'
import sx from '../sx'
import type {ComponentProps} from '../utils/types'

type StyledBoxProps = {
sx?: BetterSystemStyleObject
} & SpaceProps &
type StyledBoxProps = SxProp &
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonrohan Any reason we would not use SxProp here?

Copy link
Member

@jonrohan jonrohan Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SxProp is deprecated, and I didn't want all Box elements to say it's deprecated since that's all the component does. #5459

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll revert it then

SpaceProps &
ColorProps &
TypographyProps &
LayoutProps &
Expand Down
Loading