Skip to content

Feature Request: Trim Leading/Trailing Whitespace in @intlify/vue-i18n/no-raw-text Warning Messages #664

@A-kirami

Description

@A-kirami

Tell us about your environment

  • ESLint version: 9.35.0
  • eslint-plugin-vue version: 10.4.0
  • eslint-plugin-vue-i18n version: 4.1.0
  • Node version: 23.5.0

The problem you want to solve.

Currently, the @intlify/vue-i18n/no-raw-text rule displays warning messages that include all whitespace characters from the raw text, including leading and trailing spaces/line breaks. This makes the warning messages difficult to read and understand.

For example, with this template:

<template>
  <div>
    raw text
  </div>
</template>

The current warning shows:

warning  raw text '
    raw text
  ' is used                                                           @intlify/vue-i18n/no-raw-text

The excessive whitespace in the warning message affects readability.

Your take on the correct solution to problem.

The rule should trim leading and trailing whitespace characters from the raw text when displaying warning messages. The expected output should be:

warning  raw text 'raw text' is used                                                           @intlify/vue-i18n/no-raw-text

This would make the warnings much more readable while still clearly identifying the problematic raw text content.

Additional context

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions