Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 628 Bytes

no-trigger.md

File metadata and controls

30 lines (22 loc) · 628 Bytes

no-trigger

Disallows the .trigger method. Prefer EventTarget#dispatchEvent.

📋 This rule is enabled in plugin:no-jquery/all.

Rule details

❌ Examples of incorrect code:

$( 'div' ).trigger();
$div.trigger();
$( 'div' ).first().trigger();
$( 'div' ).append( $( 'input' ).trigger() );

✔️ Examples of correct code:

trigger();
[].trigger();
div.trigger();
div.trigger;

Resources