Why is this an issue?

Turning on the torch mode programmatically must absolutely be avoided because the flashlight is one of the most energy-intensive component.

Non compliant Code Example

React Native

import Torch from 'react-native-torch'; // Noncompliant
import axios from 'axios'; // Compliant

HTML5 Web API (MediaTrackConstraints)

// Noncompliant
await track.applyConstraints({ advanced: [{ torch: true }] });
// Compliant
await track.applyConstraints({ advanced: [{ facingMode: "environment" }] });

Resources