False positive in rule typescript:S7749 ("Invalid group length in numeric value")

I am using SonarCloud to analyze several repositories containing TypeScript code.

Apparently on 2025-09-22 the typescript:S7749 rule (“Numeric literals should use consistent digit grouping with separators”) was added to the built-in “Sonar way” quality profile. Since then this rule has triggered lots of false positives in many TypeScript files which use an underscore character “_” to format numeric literals. Here is an example code snippet:

expect(DEFAULT_BATCH_CONFIG).toEqual({
delayBetweenBatches: 1_000
})

SonarCloud raises a warning about the “delayBetweenBatches: 1_000”:

Invalid group length in numeric value.
Numeric literals should use consistent digit grouping with separators typescript:S7749
Software qualities impacted: Maintainability Low

The same happens for dozens of other numbers which in my opinion all are correctly formatted using an underscore separator between thousand groups (e.g. 5_000 and 10_000). Several colleagues double-checked and confirmed that these numbers look just fine and that apparently this rule is causing false positive alerts.

Could someone please confirm if there is indeed a bug in this rule? If so, could it please be fixed? :slight_smile:

Hello @Thilo,

could you please provide a file which raised an issue in this file? We have not been able to spot these FPs.

Hello Victor,

Thanks for your reply. Here is an example repository: GitHub - markupai/content-guardian-action

The SonarCloud analysis for the main branch currently shows 21 issues for the “Invalid group length in numeric value (typescript:S7749)” rule, all of them false positives in my opinion.

Here are three concrete examples:

Please let me know if you need more examples or information to reproduce the problem.

Hi @Thilo,

thanks for the samples. We have now a fix that should land in the next release of the JS/TS analyzer.

1 Like