# typescript:S7739 flags a \`then\` property whose value is a number

**URL:** <https://community.sonarsource.com/t/typescript-s7739-flags-a-then-property-whose-value-is-a-number/189626>\
**Category:** Report False-positive / False-negative...\
**Created:** [October 11, 2026, 6:40pm UTC](https://community.sonarsource.com/t/typescript-s7739-flags-a-then-property-whose-value-is-a-number/189626 "2026-10-11T18:40:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hamzahamidi](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/hamzahamidi/32/60763_2.png) [@hamzahamidi](https://community.sonarsource.com/u/hamzahamidi)\
**Post date:** [October 11, 2026, 6:40pm UTC](https://community.sonarsource.com/t/typescript-s7739-flags-a-then-property-whose-value-is-a-number/189626/1 "2026-10-11T18:40:55Z")

</div>

- **Language:** TypeScript
- **Rule:** typescript:S7739 “Do not add `then` to an object”
- **Product:** SonarQube Cloud
- **Why it is a false positive:** Promise resolution only treats an object as thenable when its `then` property is callable. A numeric value is never invoked. The issue is raised as a Bug with High reliability impact, which fails the default quality gate. In this project the keys mirror gherkin-lint `indentation` option names, so `then` cannot be renamed.

**Reproducer:**

```ts
export const INDENTATION_DEFAULTS = { Feature: 0, given: 2, when: 2, then: 2 };

```

Expected: no issue. Actual: S7739 is raised on `then`.

Source: [gherkin-refine/src/rules/legacy/helpers.ts at 49c5db79441c26c122d89f4875fb83a4a56dc61b · hamzahamidi/gherkin-refine · GitHub](https://github.com/hamzahamidi/gherkin-refine/blob/49c5db79441c26c122d89f4875fb83a4a56dc61b/src/rules/legacy/helpers.ts#L15)

**Suggestion:** only flag `then` when its value is a function or of unknown type.

---

<div class="post-metadata">

**Author:** ![francois.mora](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/francois.mora/32/35214_2.png) [@francois.mora](https://community.sonarsource.com/u/francois.mora)\
**Post date:** [October 28, 2026, 4:36pm UTC](https://community.sonarsource.com/t/typescript-s7739-flags-a-then-property-whose-value-is-a-number/189626/3 "2026-10-28T16:36:07Z")

</div>

Hi @hamzahamidi, welcome to the Community! 👋

Thank you for taking the time to share a clear example and explain why you need to keep the `then` key. You’re right: because its value is a number, JavaScript cannot call it as a thenable method. S7739 should not report it. I’m sorry this also affects your quality gate.

We created [JS-2758](https://sonarsource.atlassian.net/browse/JS-2758) to track the false positive. Thank you for helping us improve the rule!

-Francois
