wikimedia / eslint-plugin-no-jquery

Control allowance of certain jQuery functions, and suggest or autofix alternatives.
MIT License
31 stars 8 forks source link

Add global settings for configuring jQuery constructor/variable names #93

Closed edg2s closed 5 years ago

edg2s commented 5 years ago

Fixes #92

edg2s commented 5 years ago

I figured it was nicer to get straight into the rules, but it's irrelevant because it's being removed in #94.

stof commented 5 years ago

Should be rebased to fix conflicts, but this is a good news.

Btw, shouldn't the default setting for the jQuery constructor be ["$", "jQuery"] already ? jQuery is already available as variable in addition to $ when loading it.

jdforrester commented 5 years ago

Yeah, needs serious merge de-conflicting.

jdforrester commented 5 years ago

Btw, shouldn't the default setting for the jQuery constructor be ["$", "jQuery"] already ? jQuery is already available as variable in addition to $ when loading it.

This is an artefact of our use at WIkimedia, where we're strongly discouraging the jQuery name to ensure most repeatability -> minimal shipped bytes/higher compressibility. I'll file an Issue so we don't forget.

stof commented 5 years ago

This is an artefact of our use at WIkimedia, where we're strongly discouraging the jQuery name to ensure most repeatability -> minimal shipped bytes/higher compressibility. I'll file an Issue so we don't forget.

Well, I also have this convention. But forbidding a function should still detect both cases IMO.