Disallows the $.parseXML
utility. Prefer DOMParser#parseFromString
.
📋 This rule is enabled in plugin:no-jquery/slim
.
📋 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.
❌ Examples of incorrect code:
$.parseXML( '<b>test</b>' );
✔️ Examples of correct code:
parseXML( '<b>test</b>' );
'test'.parseXML( '<b>test</b>' );
'<b>test</b>'.parseXML;
🔧 Examples of code fixed by this rule:
$.parseXML( '<b>test</b>' ); /* → */ ( new window.DOMParser() ).parseFromString( '<b>test</b>', 'text/xml' );