mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
6d101435d4
Babel doesn't attach Comment nodes to anything, so they dangle off of the Program node while only specifying a range. This meant that previously we first had to traverse all of the Program's comments to find an eslint suppression of the rules of React, then during traversal of the individual functions, we would check if there were any *global* eslint suppressions, then bailout all components. This PR updates our logic to determine if individual functions are affected by an eslint suppression range: - If an eslint suppression range falls within its body; or - If an eslint suppression wraps the function