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

react/jsx-wrap-multilines规则需要更新 #28

Closed
franckchen opened this issue Jan 14, 2021 · 3 comments · Fixed by #29
Closed

react/jsx-wrap-multilines规则需要更新 #28

franckchen opened this issue Jan 14, 2021 · 3 comments · Fixed by #29

Comments

@franckchen
Copy link
Contributor

eslint-plugin-react 7.5.0 - 2017-11-18 针对react/jsx-wrap-multilines规则有了新更新,支持了parens-new-line配置规则,且规则有了一定改变,而现在我们的规则里对此没有相应的更新.
此外我们spec中其实是推荐parens-new-line写法的,所以建议在普通检查中设置parens, 严格模式下parens-new-line
准备提交一个commit,望采纳~
下面是一个例子

//  普通模式下good case, strict模式下bad case
const Hello = () => (<div>
    <p>World</p>
</div>);
@otakustay
Copy link
Member

如果下面的代码,在普通模式下是good还是base来着:

const Hello = () => (
    <div />
);

@franckchen
Copy link
Contributor Author

如果下面的代码,在普通模式下是good还是base来着:

const Hello = () => (
    <div />
);

这种在我本次提交修改前,修改后的普通模式和严格模式下都是good. 感觉也应该算是good

@franckchen
Copy link
Contributor Author

const Hello = () => (<div>
    <p>World</p>
</div>);

上面这段代码
修改前:普通模式 good, 严格模式good
修改后: 普通模式good, 严格模式bad

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 a pull request may close this issue.

2 participants