-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.js
74 lines (73 loc) · 2.63 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import typescriptEslint from 'typescript-eslint';
import vitest from 'eslint-plugin-vitest';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.Config} */
export const testConfig = {
name: '@osskit/eslint-config/test.js',
files: ['tests/**', '**/*.spec.ts', '**/*.spec.js'],
plugins: {
vitest,
},
rules: {
'vitest/consistent-test-filename': 'off',
'vitest/consistent-test-it': ['error', { fn: 'it' }],
'vitest/prefer-lowercase-title': 'error',
'vitest/max-nested-describe': 'error',
'vitest/no-identical-title': 'error',
'vitest/no-focused-tests': 'error',
'vitest/no-conditional-tests': 'error',
'vitest/expect-expect': 'error',
'vitest/prefer-to-be': 'error',
'vitest/no-hooks': 'off',
'vitest/no-restricted-vi-methods': 'off',
'vitest/max-expects': 'off',
'vitest/no-alias-methods': 'off',
'vitest/no-commented-out-tests': 'error',
'vitest/no-conditional-expect': 'error',
'vitest/no-conditional-in-test': 'error',
'vitest/no-disabled-tests': 'error',
'vitest/no-duplicate-hooks': 'error',
'vitest/no-large-snapshots': 'off',
'vitest/no-interpolation-in-snapshots': 'error',
'vitest/no-mocks-import': 'off',
'vitest/no-restricted-matchers': 'off',
'vitest/no-standalone-expect': 'error',
'vitest/no-test-prefixes': 'error',
'vitest/no-test-return-statement': 'error',
'vitest/no-import-node-test': 'error',
'vitest/prefer-called-with': 'off',
'vitest/valid-title': 'off',
'vitest/valid-expect': 'error',
'vitest/prefer-to-be-falsy': 'off',
'vitest/prefer-to-be-object': 'error',
'vitest/prefer-to-be-truthy': 'off',
'vitest/prefer-to-have-length': 'error',
'vitest/prefer-equality-matcher': 'error',
'vitest/prefer-strict-equal': 'off',
'vitest/prefer-expect-resolves': 'error',
'vitest/prefer-each': 'error',
'vitest/prefer-hooks-on-top': 'error',
'vitest/prefer-hooks-in-order': 'error',
'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
'vitest/prefer-mock-promise-shorthand': 'error',
'vitest/prefer-snapshot-hint': 'off',
'vitest/valid-describe-callback': 'error',
'vitest/require-top-level-describe': 'error',
'vitest/require-to-throw-message': 'off',
'vitest/require-hook': 'error',
'vitest/prefer-todo': 'error',
'vitest/prefer-spy-on': 'error',
'vitest/prefer-comparison-matcher': 'error',
'vitest/prefer-to-contain': 'error',
'vitest/prefer-expect-assertions': 'off',
},
settings: {
vitest: {
typecheck: true,
},
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
};