import globalsVitest from 'globals-vitest';
import vitestPlugin from '@vitest/eslint-plugin';
import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
import vitestRules from '../rules/vitest.mjs';

export default [
  {
    languageOptions: {
      globals: {
        ...globalsVitest,
        // needed to avoid "no-undef" errors in vitest test files
        global: 'readonly',
      },
    },
    plugins: {
      vitest: vitestPlugin,
      'no-only-tests': noOnlyTestsPlugin,
    },
    rules: {
      ...vitestRules,
    },
  },
];
