Skip to content

Getting "TypeError: vueI18n.configs.flat/recommended is not iterable" #516

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

Closed
Bassadin opened this issue May 16, 2024 · 3 comments
Closed

Comments

@Bassadin
Copy link

Bassadin commented May 16, 2024

Tell us about your environment

  • ESLint version: 9.2.0
  • eslint-plugin-vue version: 9.26.0
  • eslint-plugin-vue-i18n version: 2.0.0
  • Node version: 20.11.1

Please show your full configuration:

import pluginVue from "eslint-plugin-vue";
import vueI18n from '@intlify/eslint-plugin-vue-i18n'

export default [
    ...pluginVue.configs["flat/recommended"],
    ...vueI18n.configs['flat/recommended'],
    {
        languageOptions: {
            parserOptions: {
                parser: "vue-eslint-parser",
                parser: "@typescript-eslint/parser",
                ecmaVersion: 2020,
            },
            globals: {
                es2021: true,
            },
        },
        rules: {
            "jsdoc/tag-lines": ["warn", "any", { startLines: 1 }],
            "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
            "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
            "vue/no-v-model-argument": "off",
            "@typescript-eslint/no-this-alias": "off",
            "vue/multi-word-component-names": "warn",
            "vue/component-name-in-template-casing": [1, "kebab-case"],
            "@intlify/vue-i18n/no-raw-text": "error",
            "vue/require-prop-types": "error",
            "vue/block-order": [
                "error",
                {
                    order: ["template", "script", "style"],
                },
            ],
        },
        settings: {
            "vue-i18n": {
                localeDir: "./src/locales/*.{json,json5,yaml,yml}",
                messageSyntaxVersion: "^9.0.0",
            },
        },
        ignores: ["../../libs/axios-client/dist/types/feature-type.js", "*.js", "legacy/", "node_modules/", "**/*.md", "**/*.less", "setup/assets/**/*"],
    },
];

What did you do?

Happens with any file.

What did you expect to happen?

ESLint runs normally.

What actually happened?

Oops! Something went wrong! :(

ESLint: 9.2.0

TypeError: vueI18n.configs.flat/recommended is not iterable
    at file:///home/basti/Documents/git-repos/core/apps/frontend/eslint.config.js?mtime=1715870073074:8:23
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
    at async loadFlatConfigFile (/home/basti/Documents/git-repos/core/node_modules/eslint/lib/eslint/eslint.js:317:21)
    at async calculateConfigArray (/home/basti/Documents/git-repos/core/node_modules/eslint/lib/eslint/eslint.js:396:28)
    at async ESLint.lintFiles (/home/basti/Documents/git-repos/core/node_modules/eslint/lib/eslint/eslint.js:815:25)
    at async Object.execute (/home/basti/Documents/git-repos/core/node_modules/eslint/lib/cli.js:500:23)
    at async main (/home/basti/Documents/git-repos/core/node_modules/eslint/bin/eslint.js:153:22)

Note: I'm in a monorepo context, but executing ESLint via npx and specifying the config file via the -c flag also nets the same error.

@alexcroox
Copy link

npm install --save-dev @intlify/eslint-plugin-vue-i18n@next

@Bassadin
Copy link
Author

Thanks! Might I suggest adding a hint for needing the "next" version on the Getting Started Page?

@alexcroox
Copy link

yeah someone has already raised an issue for it #508

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

2 participants