Autocomplete - eslint is flagging use of $

What’s the recommended approach to implementing Autocomplete if the use of $ and jquery in general is discouraged?

I note there is still a lot of apparent reliance on $().autocomplete in the core codebase?

But my plugin javascript code is making eslint sad :frowning:

error  Do not use global `$` or `jQuery`  ember/no-global-jquery

I can get rid of this by adding this import:

import $ from 'jquery';

But should we be shooting for a completely native solution without jquery now or is this good enough?

1 Like

You can import it as a medium-term solution - no problem. We do that in a bunch of places in core. :+1:

We’ve enabled the ESLint rule to give us a better view of how much JQuery is still being used, so that we can eventually aim to remove it completely.

So, in the long term, yes it would be much better to update any uses of JQuery to use native browser APIs. We’ve been doing that slowly over the last few years in core, but we have no specific plan or timeline on removing it.

2 Likes

Thanks … I’ll not bite off more for the time being! :slight_smile:

2 Likes