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

feat: update jsx default config #281

Merged
merged 3 commits into from Oct 10, 2023
Merged

feat: update jsx default config #281

merged 3 commits into from Oct 10, 2023

Conversation

promise96319
Copy link
Contributor

Description

Update the JSX configuration to make it resemble the formatting of Prettier(Not 100% consistent).

Linked Issues

#185

Additional context

In many projects, JSX files are typically automatically formatted using Prettier, such as in Next.js. Therefore, there's often no need to configure JSX rules in eslint-plugin-react to achieve a consistent JSX format.

Now, if we want to use ESLint for JSX formatting instead of Prettier, it would be beneficial to ensure that the JSX configuration closely matches the formatting produced by Prettier for consistency.

I use jsx a lot, so I configured eslint rules according to the prettier style. Due to the limitations of eslint jsx rules, it is not yet completely consistent with Prettier and can only be as similar as possible. Perhaps it can be optimized in the future.

@antfu antfu merged commit 987b9d8 into antfu:main Oct 10, 2023
5 checks passed
@hooray
Copy link

hooray commented Oct 11, 2023

image image `style/jsx-child-element-spacing`, `style/jsx-one-expression-per-line`, These two rules seem to conflict, never verified correctly

@subframe7536
Copy link
Contributor

same here. currently I disable both of them

@antfu
Copy link
Owner

antfu commented Oct 11, 2023

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants