Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 807 Bytes

no-error.md

File metadata and controls

33 lines (23 loc) · 807 Bytes

no-error

Disallows the $.error utility. Prefer throw.

📋 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:

$.error( msg );

✔️ Examples of correct code:

error( msg );
myClass.error( msg );
$div.error( msg );

🔧 Examples of code fixed by this rule:

$.error( msg ); /* → */ throw new Error( msg );

Resources