Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-raw-text ignoreNodes configuration not behaving as expected #435

Open
auirarrazaval opened this issue Oct 2, 2023 · 0 comments
Open

Comments

@auirarrazaval
Copy link

Tell us about your environment

  • ESLint version: 8.50.0
  • eslint-plugin-vue version: 9.17.0
  • eslint-plugin-vue-i18n version: 2.0.0
  • Node version: v18.16.1

Please show your full configuration:

module.exports = {
  root: true,
  extends: [
    'plugin:vue/vue3-recommended',
    'airbnb-base',
    '@vue/typescript/recommended',
    'plugin:vuejs-accessibility/recommended',
    'plugin:@intlify/vue-i18n/recommended',
  ],
  plugins: ['import', '@typescript-eslint', 'destructuring-newline', 'vuejs-accessibility'],
  parserOptions: {
    ecmaVersion: 'latest',
  },
  settings: {
    'import/resolver': {
      node: {
        paths: ['src', '.storybook'],
      },
      alias: {
        map: [
          ['@', './src'],
        ],
      },
      typescript: {
        project: './',
      },
    },
    'vue-i18n': {
      localeDir: './src/locales/*.json',
    },
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
  },
  rules: {
    'prefer-destructuring': ['error', { VariableDeclarator: { array: true } }],
    'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
    'import/prefer-default-export': 'off',
    'import/extensions': [
      'error',
      'ignorePackages',
      {
        js: 'never',
        jsx: 'never',
        ts: 'never',
        tsx: 'never',
      },
    ],
    '@typescript-eslint/no-unused-vars': ['error'],
    'no-spaced-func': 'off',
    'func-call-spacing': 'off',
    '@typescript-eslint/func-call-spacing': ['error'],
    'vue/multi-word-component-names': 'off',
    'object-curly-spacing': ['error', 'always'],
    'object-curly-newline': 'error', // recommended
    'destructuring-newline/object-property-newline': ['error', { maxProperties: 3 }],
    '@intlify/vue-i18n/no-raw-text': ['error', {
      ignoreNodes: ['material-symbol', 'MaterialSymbol'],
    }],
  },
};

What did you do?

<template>
  <ButtonAtom
    ...
  >
    <div
      ...
    />
    <MaterialSymbol
      ...
    >
      notifications
    </MaterialSymbol>
    <TextAtom
      ...
    >
      {{ displayNumber }}
    </TextAtom>
  </ButtonAtom>
</template>

What did you expect to happen?

Because I set the rule to ignore the MaterialSymbol/material-symbol nodes, I expected the rule to be ignored in that case. As you can see, I tried using both kebab and Pascal case, but neither worked

What actually happened?

  22:6  error  raw text '
      notifications
    ' is used  @intlify/vue-i18n/no-raw-text

✖ 1 problem (1 error, 0 warnings)

error Command failed with exit code 1.

Repository to reproduce this issue
Sadly, this is a private project. But if this is not enough, I'll try creating a repository that reproduces the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant