I have encountered a very strange code smell,please help!
- Sonarqube version is ‘Community Edition Version 9.8 (build 63668)’ and deploy in docker
- Coding Rule: typescript:S6480
- Issue Detail:
My project report code smell “JSX props should not use arrow functions” after sonar scan
<Modal
title={`${formMode} Authority Setting`}
visible={formVisible}
destroyOnClose
onCancel={() => setFormVisible(false)} //code smell
>
I follow recommend method and change to use method reference in props, but the code smell change to “JSX props should not use functions”.
function onOperationCancel() {
setFormVisible(false);
}
<Modal
title={`${formMode} Authority Setting`}
visible={formVisible}
destroyOnClose
onCancel={onOperationCancel}
>
It’s very strange that these two code smells use the same rule typescript:S6480. May I know if this is a bug?