# Javascript Client Linting Errors

**URL:** <https://discuss.elastic.co/t/javascript-client-linting-errors/183649>\
**Category:** Elasticsearch\
**Created:** [May 31, 2019, 3:51am UTC](https://discuss.elastic.co/t/javascript-client-linting-errors/183649 "2019-05-31T03:51:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottdfedorov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scottdfedorov/32/64699_2.png) [@scottdfedorov](https://discuss.elastic.co/u/scottdfedorov)\
**Post date:** [May 31, 2019, 3:51am UTC](https://discuss.elastic.co/t/javascript-client-linting-errors/183649/1 "2019-05-31T03:51:15Z")

</div>

Attempting to use the new Javascript client and am having some linting errors with ESLint.

Using the prime example [from the docs here:](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/client-usage.html)  
ESLint is giving me an error:  
`ERROR: Parsing error: Unexpected token client`  
specifically on the line:  
`const result = await client.search({`

All the references I found online suggested I had the wrong ecmaVersion, but I have set to 2017, so shouldn't be the problem.

Other suggestions are the parser is wrong (tried as well). Does the example work for others?

I was assuming that the client was taking care of the async function, but is that not the case and it's not being wrapped in the async properly?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 28, 2019, 3:52am UTC](https://discuss.elastic.co/t/javascript-client-linting-errors/183649/2 "2019-06-28T03:52:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
