Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 640 Bytes

no-trim.md

File metadata and controls

30 lines (21 loc) · 640 Bytes

no-trim

Disallows the $.trim utility. Prefer String#trim.

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

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

Rule details

❌ Examples of incorrect code:

$.trim( ' test ' );

✔️ Examples of correct code:

trim( ' test ' );
' test '.trim();
' test '.trim;
$( 'input' ).text().trim();
$( 'input' ).data( 'foo' ).trim();

Resources