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

fix: noArrayIndexKey false negative in template literals #1586

Merged
merged 33 commits into from
Jan 17, 2024

Conversation

vasucp1207
Copy link
Member

Summary

Closes #1575

Handles array index value inside string literals and with string concatinations.

Test Plan

New tests added,

function Component8() {
    return (
        <HoC>
            {({ things }) => things.map((_, index) => <Component key={`test-key-${index}`} />)}
        </HoC>
    );
}

Recursively handles when left or right of expression is again binary_expression.

function Component10() {
    return (
        <HoC>
            {({ things }) => things.map((_, index) => <Component key={"test" + index + "test"} />)}
        </HoC>
    );
}

Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit ee9aa93
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65a7fb3510c69000082caa0b
😎 Deploy Preview https://deploy-preview-1586--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 94 (🔴 down 6 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Jan 17, 2024
Copy link

codspeed-hq bot commented Jan 17, 2024

CodSpeed Performance Report

Merging #1586 will improve performances by 7.97%

Comparing vasucp1207:noArrayIndexKey (ee9aa93) with main (a46230d)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main vasucp1207:noArrayIndexKey Change
db.json[cached] 77.2 ms 71.5 ms +7.97%

@Conaclos Conaclos merged commit 66cafa1 into biomejs:main Jan 17, 2024
19 checks passed
ematipico pushed a commit to DaniGuardiola/biome that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💅 lint/suspicious/noArrayIndexKey false negative in template literals
2 participants