no-canvas-to-image
UnreleasedConfiguration
Rule details
Prefer drawing a canvas directly with drawImage() when transferring its image
to another canvas. This rule reports converting a canvas through
loadImage(canvas.toDataURL()) before a drawImage() call, and passing
getImageData() results directly to putImageData().
The first argument can be a direct expression or a const initializer whose
binding is used once after its declaration. Awaited expressions are supported.
For the data URL pattern, the receiver must be an identifier or a non-computed
property whose name contains canvas, ignoring case.
The rule uses syntax and local references to recognize these patterns. It allows pixel data that is accessed or modified before drawing.
Examples of incorrect code for this rule
Examples of correct code for this rule
Options
This rule has no options.