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-missing-keys rule fails to detect keys containing quotes #335

Open
Larspolo opened this issue Aug 31, 2022 · 0 comments
Open

no-missing-keys rule fails to detect keys containing quotes #335

Larspolo opened this issue Aug 31, 2022 · 0 comments
Labels
Type: Bug Bug or Bug fixes

Comments

@Larspolo
Copy link

Tell us about your environment

  • ESLint version: 8.1.0
  • eslint-plugin-vue version: 9.0.0
  • eslint-plugin-vue-i18n version: 2.0.0
  • Node version: 16.17.0

Please show your full configuration:

(using the eslinstrc supplied by this repo)

'use strict'

module.exports = {
  root: true,
  env: {
    node: true,
    mocha: true
  },
  extends: [
    'plugin:vue-libs/recommended',
    'plugin:prettier/recommended',
    'plugin:markdown/recommended',
    'prettier'
  ],
  plugins: ['@typescript-eslint'],
  parserOptions: {
    ecmaVersion: 2020,
    parser: 'espree'
  },
  rules: {
    'object-shorthand': 'error',
    'no-debugger': 'error',
    'vue/multi-word-component-names': 'off'
  },
  overrides: [
    {
      files: ['*.ts'],
      extends: ['plugin:@typescript-eslint/recommended'],
      parser: 'vue-eslint-parser',
      parserOptions: {
        parser: '@typescript-eslint/parser'
      },
      rules: {
        '@typescript-eslint/no-non-null-assertion': 'off',
        '@typescript-eslint/consistent-type-imports': 'error'
      }
    },
    {
      files: ['**/*.md/*.*'],
      rules: {
        'prettier/prettier': 'off'
      }
    }
  ]
}

What did you do?

Adding the following test to tests/lib/rules/no-missing-keys.ts under the invalid test case:

      {
        // quote in key key
        code: `$tc('missing "quote"')`,
        errors: [
          `'missing "quote"' does not exist in localization message resources`
        ]
      },

What did you expect to happen?
Expect the test to pass, as missing "quote" is not in any locale file

What actually happened?

  1) no-missing-keys
       invalid
         $tc('missing "quote"'):

      AssertionError [ERR_ASSERTION]: Should have 1 error but had 0: []
      + expected - actual

      -0
      +1

Repository to reproduce this issue

https://github.com/Larspolo/eslint-plugin-vue-i18n

@ota-meshi ota-meshi added the Type: Bug Bug or Bug fixes label Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants