Skip to content

Commit

Permalink
feat(eslint-config): adjust vitest config for in-source testing
Browse files Browse the repository at this point in the history
Adjusted the ESLint configuration for `vitest` to disable the `vitest/require-hook` rule. This change accommodates in-source testing patterns by allowing top-level evaluations that are not part of the test suite. This modification ensures compatibility with projects utilizing in-source testing methodologies, enhancing flexibility and usability.
  • Loading branch information
shorwood committed Apr 26, 2024
1 parent 4f689fa commit 9b43406
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/eslint-config/configs/vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ export function vitest(): Linter.FlatConfig[] {
'vitest/no-conditional-tests': 'off',

/**
* Allow hooks to be defined at the top-level of the test file.
* Since we use in-source testing, we need to disable the rule as it may prevent
* us from using top level evaluation that are not part of the test suite.
*
* @see https://github.com/veritem/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
*/
'vitest/require-hook': 'off',
'vitest/no-hooks': 'off',

/**
Expand Down

0 comments on commit 9b43406

Please sign in to comment.