ecoCode-javascript
ecoCode-javascript copied to clipboard
Extend the no-torch rule to plain HTML5 Web APIs
Solution you'd like
La règle no-torch devrait detecter l'utilisation de la contrainte torch de l'API HTML5 MediaTrackConstraints (torch)
const mediaStream = await navigator.mediaDevices.getUserMedia({video: true});
const [track] = mediaStream.getVideoTracks();
try {
await track.applyConstraints({ advanced: [
{ torch: on }
] });
// Do something with the track such as using the Image Capture API.
} catch((e) {
// The constraints could not be satisfied by the available devices.
}
Is your feature request related to a problem?
La règle no-torch repose actuellement sur une lib React Native. Telle quelle, cette version devrait avoir un lable react + potentiellement un label react-native.
Alternatives you've considered
No response
Additional Information
No response