@schafevormfenster/eslint-config 0.0.19 → 0.0.21

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @schafevormfenster/eslint-config@0.0.18 check /Users/jan-henrik.hempel/Projects/commons/packages/eslint-config
3
+ > @schafevormfenster/eslint-config@0.0.19 check /Users/jan-henrik.hempel/Projects/commons/packages/eslint-config
4
4
  > echo 'eslint-config: no build required'
5
5
 
6
6
  eslint-config: no build required
@@ -163,7 +163,9 @@ These configurations apply only to test files and should be added **after** your
163
163
  **Key rules**:
164
164
  - Enforce `*.test.ts`, `*.component.test.ts`, and `*.integration.test.ts` file naming
165
165
  - Prefer loose error matching (regex over exact strings)
166
- - Require environment setup hooks for env-var-based tests
166
+ - Require environment setup hooks for env-var-based unit tests (`beforeEach`/`afterEach`)
167
+ - Require environment guard hooks for integration tests (`beforeAll` throws if env var missing)
168
+ - Forbid `delete process.env.*` in `beforeEach` in integration tests
167
169
  - No environment variable preservation
168
170
  - Forbid `vi.mock()`, `vi.spyOn()`, `vi.fn()` in integration tests
169
171
  - Forbid `it.skip()`, `it.skipIf()`, `describe.skip()`, `it.todo()`, etc. in integration tests
@@ -205,7 +207,8 @@ These configurations apply only to test files and should be added **after** your
205
207
  - Forbid `it.skip()`, `it.skipIf()`, `describe.skip()`, `it.todo()`, etc. — integration tests must always run
206
208
  - Prefer loose error matching (regex over exact strings)
207
209
  - No environment variable preservation
208
- - Require environment setup in beforeEach
210
+ - Forbid `delete process.env.*` in `beforeEach` — env vars come from `.env` files, not test setup
211
+ - Require a `beforeAll` guard that checks required env vars are present (env vars come from `.env` files / dotenv — integration tests must not set or delete them)
209
212
  - Require describe() wrappers for test organization
210
213
  - Enforce meaningful test descriptions
211
214
  - Suggest test categorization (Happy Path → Error → Edge Cases)
@@ -327,7 +330,9 @@ These rules apply across all Vitest tiers. Tier-specific rules (unit, component,
327
330
  | `prefer-loose-error-matching` | warn | all tiers | Prefer regex over exact string matching for errors |
328
331
  | `enforce-test-file-naming` | error | all tiers | Enforce `*.test.ts`, `*.component.test.ts`, `*.integration.test.ts` for Vitest tests |
329
332
  | `no-env-preservation-in-tests` | error | all tiers | Forbid preserving/restoring process.env (individual vars or entire env with `{ ...process.env }`) |
330
- | `require-env-setup-in-tests` | warn | unit, integration | Require beforeEach/afterEach in current describe or parent to handle env vars |
333
+ | `require-env-setup-in-tests` | warn | unit | Require beforeEach/afterEach in current describe or parent to initialize/delete env vars |
334
+ | `require-env-guard-in-integration-tests` | warn | integration | Require a `beforeAll` guard that checks required env vars are set before the suite runs (env vars come from `.env` files) |
335
+ | `no-env-delete-in-before-each` | error | integration | Forbid `delete process.env.*` inside `beforeEach` — integration tests use env vars from `.env` files |
331
336
  | `no-mocks-in-integration-tests` | error | integration | Forbid `vi.mock()`, `vi.spyOn()`, and `vi.fn()` in integration tests |
332
337
  | `no-skip-in-integration-tests` | error | integration | Forbid `it.skip()`, `it.skipIf()`, `describe.skip()`, `it.todo()`, etc. — integration tests must always run |
333
338
  | `no-env-vars-in-component-tests` | error | component | Forbid `process.env` access in component tests |
@@ -361,7 +366,8 @@ These rules apply across all Vitest tiers. Tier-specific rules (unit, component,
361
366
  | `no-mocks-in-integration-tests` | error | Forbid `vi.mock()`, `vi.spyOn()`, and `vi.fn()` in integration tests |
362
367
  | `no-skip-in-integration-tests` | error | Forbid `it.skip()`, `it.skipIf()`, `describe.skip()`, `it.todo()`, etc. — integration tests must always run |
363
368
  | `no-env-preservation-in-tests` | error | Forbid preserving/restoring process.env (individual vars or entire env with `{ ...process.env }`) |
364
- | `require-env-setup-in-tests` | warn | Require beforeEach/afterEach in current describe or parent to handle env vars |
369
+ | `no-env-delete-in-before-each` | error | Forbid `delete process.env.*` inside `beforeEach` env vars come from `.env` files, not test setup |
370
+ | `require-env-guard-in-integration-tests` | warn | Require a `beforeAll` guard that checks required env vars are set before the suite runs (env vars come from `.env` files) |
365
371
  | `require-describe-wrapper` | warn | Require test cases to be wrapped in describe() blocks |
366
372
  | `require-meaningful-descriptions` | warn | Require meaningful descriptions (min 10 chars for describe, 15 for it/test) |
367
373
  | `suggest-test-categorization` | warn | Suggest organizing tests into categories (Happy Path → Error → Edge Cases) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schafevormfenster/eslint-config",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,7 +39,7 @@
39
39
  "eslint-plugin-zod": "^1.4.0",
40
40
  "globals": "^16.5.0",
41
41
  "typescript-eslint": "^8.56.0",
42
- "@schafevormfenster/eslint-plugin": "0.0.19"
42
+ "@schafevormfenster/eslint-plugin": "0.0.21"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=22"