# Eslint: Previsto { dopo la condizione 'while'

**URL:** <https://meta.discourse.org/t/eslint-expected-after-while-condition/236003>\
**Category:** Development\
**Created:** [12 Agosto 2022, 4:19pm UTC](https://meta.discourse.org/t/eslint-expected-after-while-condition/236003 "2022-08-12T16:19:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)\
**Post date:** [13 Settembre 2022, 10:53pm UTC](https://meta.discourse.org/t/eslint-expected-after-while-condition/236003/2 "2022-09-13T22:53:11Z")

</div>

Il motivo dell’avviso di eslint è che sono necessarie le parentesi graffe attorno al tuo `return text`;

Cioè, dovrebbe apparire così:

```js
  while (
    text !==
    (text = text.replace(/\[title\](.+?)\[\/title\]/gi, function (match, p) {
      return `<div class="job-title">${p}</div>`;
    }))
  ) {
    return text;
  }

```

Sebbene JavaScript consenta l’omissione delle parentesi graffe, ESLint impone uno stile coerente delle parentesi graffe.

Maggiori dettagli sulla regola `curly` qui:

> **[curly - ESLint - Pluggable JavaScript Linter](https://eslint.org/docs/latest/rules/curly#rule-details)**
>
> A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

---

_[View the full topic](https://meta.discourse.org/t/eslint-expected-after-while-condition/236003)._
