Skip to content

Custom config preset for eslint-plugin-vitest ESLint plugin

License

Notifications You must be signed in to change notification settings

socnik/eslint-config-vitest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESLint Config Vitest

Strict config for eslint-plugin-vitest. You can see config in src/index.js.

Usage

This config uses flat config format, so ESLint v9+ required.

Install packages:

npx nypm add -D eslint eslint-plugin-vitest @socnik/eslint-config-vitest

Add to your ESLint config:

// ...
import vitest from 'eslint-plugin-vitest'
import { vitestConfig } from '@socnik/eslint-config-vitest'
// ...

export default [
  // ...
  {
    ...vitestConfig, // Add Vitest rules preset. Add onto top!
    name: 'Vitest tests',
    files: ['src/**/*.test.ts'],
    plugins: {
      vitest, // Add Vitest plugin
    },
    rules: {
      'vitest/prefer-todo': 'off', // Override rules if you want to change something
    },
  },
  // ...
]

About

Custom config preset for eslint-plugin-vitest ESLint plugin

Topics

Resources

License

Stars

Watchers

Forks