Skip to content

false positive when "number" is used for interpolation #66

@leethree

Description

@leethree

I got lint error from the following translation:

error  'title' requires interpolation data  @m6web/i18n/interpolation-data
"title": "Lesson {{number}} - {{name}}",
localise('title', {
   number: lessonNumber,
   name: sectionTitle,
})

The problem seems to be caused by this check for useTranslate:

https://github.com/M6Web/i18n-tools/blob/b3eeb1db403259c85c81601f5f128fcf135c4fad/packages/eslint-plugin-i18n/src/utils/utils.js#L52-L70

Essentially using any key from ['data', 'number', 'general', 'renderers'] will cause an error. But we don't use useTranslate and "number" should be a very normal key to use for interpolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions