Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.26 KB

File metadata and controls

61 lines (40 loc) · 1.26 KB

vitest/consistent-vitest-vi

📝 Enforce using vitest or vi but not both.

⚠️ This rule warns in the 🌐 all config.

🔧 This rule is automatically fixable by the --fix CLI option.

Rule Details

Examples of incorrect code for this rule:

vitest.mock('./src/calculator.ts', { spy: true })

vi.stubEnv('NODE_ENV', 'production')

Examples of correct code for this rule:

vi.mock('./src/calculator.ts', { spy: true })

vi.stubEnv('NODE_ENV', 'production')
vitest.mock('./src/calculator.ts', { spy: true })

vitest.stubEnv('NODE_ENV', 'production')

Options

Name Description Type Choices
fn Preferred utility keyword to enforce. String vi, vitest
{
  "type": "object",
  "properties": {
    "fn": {
      "enum": ["vi", "vitest"]
    }
  },
  "additionalProperties": false
}

fn

Decides whether to prefer vitest or vi.

The default configuration is top level vi.