Skip to content

Using expect from built-in test context triggers prefer-importing-vitest-globals #724

@gtbuchanan

Description

@gtbuchanan

Using expect from the built-in test context (as recommended by Vitest for concurrent tests) triggers the new prefer-importing-vitest-globals rule.

import { describe, it, test } from 'vitest';

describe.concurrent('local expect', () => {
  it('should not trigger lint rules', ({ expect }) => {
    expect(true).toBe(true); // Triggers `prefer-importing-vitest-globals`
  });
});

I assume this also occurs for any function that accepts the local expect as a parameter of the same name.

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