@elnop/oxlint-config-vitest 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,6 +5,7 @@ Oxlint config for Vitest tests:
5
5
  - `it()` inside a `describe`, `test()` outside
6
6
  - `vi.fn()` takes the type of the function it replaces: `vi.fn<() => void>()`
7
7
  - `toThrow()` names the expected message
8
+ - one matcher for each check: `toStrictEqual` instead of `toEqual`, `toBe(true)` instead of `toBeTruthy()`, `toBeNull()` instead of `toBe(null)`, `toHaveBeenCalledTimes(1)` instead of `toHaveBeenCalledOnce()`
8
9
  - `expect(value, message)` is accepted, Vitest takes a message as second argument
9
10
 
10
11
  It does not extend any other config, so it fits next to any of the `@elnop/oxlint-config-*` presets. `@elnop/oxlint-config-react-vite` already includes it.
@@ -1,14 +1,2 @@
1
- export declare const vitestConfig: {
2
- plugins: "vitest"[];
3
- rules: {
4
- 'vitest/consistent-test-it': ["error", {
5
- fn: "test";
6
- withinDescribe: "it";
7
- }];
8
- 'vitest/valid-expect': ["error", {
9
- maxArgs: number;
10
- }];
11
- 'vitest/require-mock-type-parameters': "error";
12
- 'vitest/require-to-throw-message': "error";
13
- };
14
- };
1
+ import type { OxlintConfig } from 'oxlint';
2
+ export declare const vitestConfig: OxlintConfig;
@@ -6,5 +6,9 @@ export const vitestConfig = defineConfig({
6
6
  'vitest/valid-expect': ['error', { maxArgs: 2 }],
7
7
  'vitest/require-mock-type-parameters': 'error',
8
8
  'vitest/require-to-throw-message': 'error',
9
+ 'vitest/prefer-strict-equal': 'error',
10
+ 'vitest/prefer-to-be': 'error',
11
+ 'vitest/prefer-strict-boolean-matchers': 'error',
12
+ 'vitest/prefer-called-times': 'error',
9
13
  },
10
14
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elnop/oxlint-config-vitest",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Oxlint config for Vitest tests: it() inside describe, test() outside, typed mocks, explicit expectations.",
5
5
  "keywords": [
6
6
  "oxlint",