dgraham / eslint-plugin-jquery

Disallow jQuery functions with native equivalents.
MIT License
209 stars 22 forks source link

Should prefer setAttribute for $(element).attr('attribute', value); not getAttribute #15

Closed OmgImAlexis closed 6 years ago

OmgImAlexis commented 6 years ago

Since jQuery supports getting via a single param and setting via 2 it'd be nice to see the warning show the correct message.

Right now this suggests using getAttribute even though it should be setting it.

$(element).attr('attribute', value);