intlify / eslint-plugin-vue-i18n

:globe_with_meridians: ESLint plugin for Vue I18n
https://eslint-plugin-vue-i18n.intlify.dev/
MIT License
135 stars 40 forks source link

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

Closed Bassadin closed 6 months ago

Bassadin commented 6 months ago

Tell us about your environment

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 commented 6 months ago

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

Bassadin commented 6 months ago

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

alexcroox commented 6 months ago

yeah someone has already raised an issue for it https://github.com/intlify/eslint-plugin-vue-i18n/issues/508