@enormora/eslint-config-vitest 0.0.1 → 0.0.3

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.
Files changed (3) hide show
  1. package/package.json +1 -1
  2. package/readme.md +29 -0
  3. package/vitest.js +2 -74
package/package.json CHANGED
@@ -18,5 +18,5 @@
18
18
  "url": "git://github.com/enormora/eslint-config.git"
19
19
  },
20
20
  "type": "module",
21
- "version": "0.0.1"
21
+ "version": "0.0.3"
22
22
  }
package/readme.md ADDED
@@ -0,0 +1,29 @@
1
+ # `@enormora/eslint-config-vitest`
2
+
3
+ Config preset for `vitest`, enabling specific rules and configures global variables.
4
+
5
+ ## Install & Setup
6
+
7
+ Install the `@enormora/eslint-config-vitest` and the base preset package via npm:
8
+
9
+ ```bash
10
+ npm install --save-dev @enormora/eslint-config-base @enormora/eslint-config-vitest
11
+ ```
12
+
13
+ Create an ESLint configuration file (e.g., `eslint.config.js`) in your project and add the base and mocha config to the configuration array:
14
+
15
+ ```javascript
16
+ import { baseConfig } from '@enormora/eslint-config-base';
17
+ import { vitestConfig } from '@enormora/eslint-config-vitest';
18
+
19
+ export default [
20
+ {
21
+ ignores: ['dist/**/*']
22
+ },
23
+ baseConfig,
24
+ {
25
+ ...vitestConfig,
26
+ files: ['**/*.test.js']
27
+ }
28
+ ];
29
+ ```
package/vitest.js CHANGED
@@ -72,7 +72,7 @@ export const vitestConfig = {
72
72
  '@vitest/prefer-comparison-matcher': 'error',
73
73
  '@vitest/prefer-describe-function-title': 'error',
74
74
  '@vitest/prefer-to-contain': 'error',
75
- '@vitest/prefer-expect-assertions': 'error',
75
+ '@vitest/prefer-expect-assertions': 'off',
76
76
  '@vitest/padding-around-after-all-blocks': 'error',
77
77
  '@vitest/padding-around-after-each-blocks': 'error',
78
78
  '@vitest/padding-around-all': 'error',
@@ -88,78 +88,6 @@ export const vitestConfig = {
88
88
  '@vitest/prefer-importing-vitest-globals': 'error',
89
89
  '@vitest/prefer-called-once': 'error',
90
90
  '@vitest/prefer-called-times': 'error',
91
- '@vitest/warn-todo': 'error',
92
-
93
- 'vitest/consistent-test-filename': 'error',
94
- 'vitest/consistent-test-it': 'error',
95
- 'vitest/consistent-vitest-vi': 'error',
96
- 'vitest/expect-expect': 'error',
97
- 'vitest/max-expects': 'off',
98
- 'vitest/max-nested-describe': ['error', { max: 2 }],
99
- 'vitest/no-alias-methods': 'error',
100
- 'vitest/no-commented-out-tests': 'error',
101
- 'vitest/no-conditional-expect': 'error',
102
- 'vitest/no-conditional-in-test': 'error',
103
- 'vitest/no-conditional-tests': 'error',
104
- 'vitest/no-disabled-tests': 'error',
105
- 'vitest/no-done-callback': 'off',
106
- 'vitest/no-duplicate-hooks': 'error',
107
- 'vitest/no-focused-tests': 'error',
108
- 'vitest/no-hooks': 'error',
109
- 'vitest/no-identical-title': 'error',
110
- 'vitest/no-import-node-test': 'error',
111
- 'vitest/no-importing-vitest-globals': 'off',
112
- 'vitest/no-interpolation-in-snapshots': 'error',
113
- 'vitest/no-large-snapshots': 'off',
114
- 'vitest/no-mocks-import': 'error',
115
- 'vitest/no-restricted-matchers': 'error',
116
- 'vitest/no-restricted-vi-methods': 'error',
117
- 'vitest/no-standalone-expect': 'error',
118
- 'vitest/no-test-prefixes': 'error',
119
- 'vitest/no-test-return-statement': 'error',
120
- 'vitest/padding-around-after-all-blocks': 'error',
121
- 'vitest/padding-around-after-each-block': 'error',
122
- 'vitest/padding-around-all': 'error',
123
- 'vitest/padding-around-before-all-blocks': 'error',
124
- 'vitest/padding-around-before-each-blocks': 'error',
125
- 'vitest/padding-around-describe-blocks': 'error',
126
- 'vitest/padding-around-expect-groups': 'error',
127
- 'vitest/padding-around-test-blocks': 'error',
128
- 'vitest/prefer-called-once': 'error',
129
- 'vitest/prefer-called-times': 'error',
130
- 'vitest/prefer-called-with': 'error',
131
- 'vitest/prefer-comparison-matcher': 'error',
132
- 'vitest/prefer-describe-function-title': 'error',
133
- 'vitest/prefer-each': 'error',
134
- 'vitest/prefer-equality-matcher': 'error',
135
- 'vitest/prefer-expect-assertions': 'error',
136
- 'vitest/prefer-expect-resolves': 'error',
137
- 'vitest/prefer-hooks-in-order': 'error',
138
- 'vitest/prefer-hooks-on-top': 'error',
139
- 'vitest/prefer-importing-vitest-globals': 'error',
140
- 'vitest/prefer-lowercase-title': 'error',
141
- 'vitest/prefer-mock-promise-shorthand': 'error',
142
- 'vitest/prefer-snapshot-hint': 'error',
143
- 'vitest/prefer-spy-on': 'error',
144
- 'vitest/prefer-strict-boolean-matchers': 'error',
145
- 'vitest/prefer-strict-equal': 'error',
146
- 'vitest/prefer-to-be': 'error',
147
- 'vitest/prefer-to-be-falsy': 'off',
148
- 'vitest/prefer-to-be-object': 'error',
149
- 'vitest/prefer-to-be-truthy': 'off',
150
- 'vitest/prefer-to-contain': 'error',
151
- 'vitest/prefer-to-have-length': 'error',
152
- 'vitest/prefer-todo': 'error',
153
- 'vitest/prefer-vi-mocked': 'error',
154
- 'vitest/require-hook': 'error',
155
- 'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
156
- 'vitest/require-mock-type-parameters': 'off',
157
- 'vitest/require-to-throw-message': 'off',
158
- 'vitest/require-top-level-describe': 'off',
159
- 'vitest/valid-describe-callback': 'error',
160
- 'vitest/valid-expect': 'error',
161
- 'vitest/valid-expect-in-promise': 'error',
162
- 'vitest/valid-title': 'error',
163
- 'vitest/warn-todo': 'error'
91
+ '@vitest/warn-todo': 'error'
164
92
  }
165
93
  };