Skip to content

Invalid flat config #378

@swachter

Description

@swachter

Configuring the plugin by

// eslint.config.js
import vitest from 'eslint-plugin-vitest';

export default [
  vitest.configs.recommended
];

results in the following error:

ESLint: 8.56.0


A config object has a "plugins" key defined as an array of strings.

Flat config requires "plugins" to be an object in this form:

    {
        plugins: {
            vitest: pluginObject
        }
    }

I think the issue is caused by the createConfig function. A possible workaround it to tweak the returned config object in the following way:

export default [
  { ...vitest.configs.recommended, plugins: { vitest } }
];

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