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

no-commented-out-code misses JSX comments and one line comments in some occasions #36

Open
adamgen opened this issue Aug 24, 2021 · 1 comment

Comments

@adamgen
Copy link

adamgen commented Aug 24, 2021

Expected: to have the entire snippet marked as a comment block.

Actual: only the lines stated are identified as such.

       {/*{options.map((button: { label: string }, index: any) => (*/}
       {/*  <div*/}
       {/*    className={`toggle toggle__opt--${button.label}`}*/}
       {/*    key={`${button.label}-${index}`}*/}
       {/*    onClick={() =>*/}
       {/*      handleButtonsChange(button.label)*/} <------- THIS IS COMMENTED CODE 
       {/*    }*/}
       {/*  >*/}
       {/*    {button.label.toUpperCase()}*/} <------- THIS IS COMMENTED CODE 
       {/*  </div>*/}
       {/*))}*/}

This happens because all comments in JSX are multiline and we only combine single-line comments to a block. Combining multiline comments, at least inside JSX, shuld resolve it.

Do you want me to submit a PR for that?

@cartant
Copy link
Owner

cartant commented Aug 24, 2021

Do you want me to submit a PR for that?

Sure. As you've stated, the whole snippet should be deemed commented-out code.

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

No branches or pull requests

2 participants