Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 924 Bytes

no-escape-selector.md

File metadata and controls

33 lines (23 loc) · 924 Bytes

no-escape-selector

Disallows the $.escapeSelector utility. Prefer CSS.escape.

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

🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

Rule details

❌ Examples of incorrect code:

$.escapeSelector( '.foo>' );

✔️ Examples of correct code:

escapeSelector( '.foo>' );
myClass.escapeSelector( '.foo>' );
$div.escapeSelector( '.foo>' );

🔧 Examples of code fixed by this rule:

$.escapeSelector( '.foo>' ); /* → */ CSS.escape( '.foo>' );

Resources