Skip to content

Raw string attributes are not reported #661

@asmeikal

Description

@asmeikal

Tell us about your environment

  • ESLint version: 9.33
  • eslint-plugin-vue version: 10.4
  • eslint-plugin-vue-i18n version: 4.1
  • Node version: 20.12

Please show your full configuration:

import vueI18n from "@intlify/eslint-plugin-vue-i18n";
import withNuxt from "./.nuxt/eslint.config.mjs";

export default withNuxt(...vueI18n.configs.recommended, {
  settings: {
    "vue-i18n": {
      localeDir: "./i18n/locales/*.json",
      messageSyntaxVersion: "11.1.11",
    },
  },
});

What did you do?

<template>
  <div>
    <p>This is an error</p>
    <p>{{ $t("greeting") }}</p>
    <input placeholder="This SHOULD be an error">
    <input type="button" value="This too SHOULD be an error">
  </div>
</template>

What did you expect to happen?

I expect the eslint-plugin-vue-i18n to highlight both the placeholder attribute and the value attribute on the inputs as a warning, since they are using raw text that will be visible to the user.

What actually happened?

> eslint .

/project/workspace/app.vue
  3:8  warning  raw text 'This is an error' is used  @intlify/vue-i18n/no-raw-text

✖ 1 problem (0 errors, 1 warning)

Repository to reproduce this issue

https://github.com/asmeikal/i18n-attributes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions