tools
tools copied to clipboard
fix(rome_js_analyze): improve the detection of invalid cases in `noArrayIndexKey`
Summary
- Resolves https://github.com/rome/tools/issues/3670
- Improves the detection of the following cases
// Return statement return array.map((_, index) => <Component key={index} />); // Assignment expression let element = null if (condition) { elements = array.map((_, index) => <Component key={index} />); } // Parenthesized expression function App({things}) { const elements = useMemo(() => ( things.map((_, index) => <Component key={index} />) ), [things]); return elements; } function App() { return ( <HoC> {({things}) => ( things.map((_, index) => <Component key={index} />) )} </HoC> ) } // Call expression const Component = () => array.map((_, index) => <Component key={index} />); // Variable declaration let elements = array.map((_, index) => <Component key={index} />);
Test Plan
Added new test cases
Deploy Preview for docs-rometools canceled.
Built without sensitive environment variables
Name | Link |
---|---|
Latest commit | 87911ad836b52f84c3fc7d53ad08fdbd92cca74f |
Latest deploy log | https://app.netlify.com/sites/docs-rometools/deploys/636f420ff96361000980c31d |