@peerigon/configs 7.2.0 → 7.4.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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # [7.4.0](https://github.com/peerigon/configs/compare/v7.3.0...v7.4.0) (2025-09-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ - Add **important** to some agent instructions ([257ef95](https://github.com/peerigon/configs/commit/257ef954b1fc490622cac65225cffeeae2b54a85))
6
+
7
+ ### Features
8
+
9
+ - Introduce vitest specific rules ([ac7b0c7](https://github.com/peerigon/configs/commit/ac7b0c7745ae73c68b6b3841f58cf40616fb047c)), closes [#164](https://github.com/peerigon/configs/issues/164)
10
+
11
+ # [7.3.0](https://github.com/peerigon/configs/compare/v7.2.0...v7.3.0) (2025-09-12)
12
+
13
+ ### Features
14
+
15
+ - **eslint:** bump typescript-eslint from 8.39.1 to 8.41.0 ([#160](https://github.com/peerigon/configs/issues/160)) ([2e93592](https://github.com/peerigon/configs/commit/2e935923e94c1e7480305b8fcf0422061e14deb1))
16
+
1
17
  # [7.2.0](https://github.com/peerigon/configs/compare/v7.1.0...v7.2.0) (2025-09-02)
2
18
 
3
19
  ### Features
@@ -57,7 +57,7 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
57
57
 
58
58
  ## Functions
59
59
 
60
- - Use arrow functions unless there is no appropriate syntax like function overloads or generators
60
+ - **Important**: Use arrow functions instead of function declarations unless there is no appropriate syntax like function overloads or generators
61
61
  - Use objects as parameters when there are more than 2 parameters
62
62
  - Keep functions small and focused on single responsibility
63
63
  - Write pure functions when possible
@@ -68,7 +68,7 @@ globs: **/*.js, **/*.ts, **/*.mjs, **/*.cjs, **/*.mts, **/*.cts
68
68
  - Use strict mode
69
69
  - Only use `interface` for interfaces that are intended to be implemented by a `class`
70
70
  - Use `type` for all other cases, especially object types
71
- - Use the generic notation for types (e.g. `Array<string>` instead of `string[]`)
71
+ - **Important**: Use the generic notation for types (e.g. `Array<string>` instead of `string[]`)
72
72
  - Do not use `any` to fix type errors. Search for a better alternative.
73
73
  - If you have to use `any`, try with `unknown` first
74
74
  - [Parse, don't validate](https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/). Lift types into higher-level, special types as soon as they have been parsed (e.g. prefer explicit string literals over just `string`)
@@ -152,7 +152,7 @@ export const javascript = [
152
152
  "no-await-in-loop": "off",
153
153
  // In case you want to test errors thrown by a constructor
154
154
  "no-new": "off",
155
- // should show a warning when a test is focussed
155
+ // should show a warning when a test is focussed (overridden to off when using vitest config)
156
156
  "no-only-tests/no-only-tests": "error",
157
157
  },
158
158
  },
@@ -0,0 +1,3 @@
1
+ /** @type {import("eslint").Linter.Config[]} */
2
+ export const vitest: import("eslint").Linter.Config[];
3
+ export default vitest;
@@ -0,0 +1,45 @@
1
+ import vitestPlugin from "@vitest/eslint-plugin";
2
+ import { globPatterns } from "../lib/glob-patterns.js";
3
+ const files = globPatterns.tests;
4
+ /** @type {import("eslint").Linter.Config[]} */
5
+ export const vitest = [
6
+ {
7
+ files,
8
+ plugins: {
9
+ // @ts-expect-error Vitest plugin seems to have incorrect types
10
+ vitest: vitestPlugin,
11
+ },
12
+ rules: {
13
+ ...vitestPlugin.configs.recommended.rules,
14
+ "vitest/max-nested-describe": ["warn", { max: 4 }],
15
+ "vitest/no-commented-out-tests": "warn",
16
+ "vitest/no-conditional-expect": "warn",
17
+ "vitest/no-duplicate-hooks": "warn",
18
+ "vitest/no-focused-tests": "warn",
19
+ "vitest/no-interpolation-in-snapshots": "warn",
20
+ "vitest/no-standalone-expect": "warn",
21
+ "vitest/no-test-return-statement": "warn",
22
+ "vitest/prefer-each": "warn",
23
+ "vitest/prefer-equality-matcher": "warn",
24
+ "vitest/prefer-hooks-in-order": "warn",
25
+ "vitest/prefer-hooks-on-top": "warn",
26
+ "vitest/prefer-mock-promise-shorthand": "warn",
27
+ "vitest/prefer-spy-on": "warn",
28
+ "vitest/prefer-todo": "warn",
29
+ "vitest/prefer-vi-mocked": "warn",
30
+ // Disable generic no-only-tests rule in favor of Vitest specific one
31
+ "no-only-tests/no-only-tests": "off",
32
+ },
33
+ settings: {
34
+ vitest: {
35
+ typecheck: true,
36
+ },
37
+ },
38
+ languageOptions: {
39
+ globals: {
40
+ ...vitestPlugin.environments.env.globals,
41
+ },
42
+ },
43
+ },
44
+ ];
45
+ export default vitest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peerigon/configs",
3
- "version": "7.2.0",
3
+ "version": "7.4.0",
4
4
  "description": "Configs for ESLint, Prettier, TypeScript & friends",
5
5
  "keywords": [
6
6
  "eslint",
@@ -27,6 +27,7 @@
27
27
  "./eslint/presets/typescript-node": "./dist/eslint/presets/typescript-node.js",
28
28
  "./eslint/presets/typescript-react": "./dist/eslint/presets/typescript-react.js",
29
29
  "./eslint/presets/typescript": "./dist/eslint/presets/typescript.js",
30
+ "./eslint/rules/vitest": "./dist/eslint/rules/vitest.js",
30
31
  "./eslint/styles/jsx-no-literals": "./dist/eslint/styles/jsx-no-literals.js",
31
32
  "./eslint/styles/no-default-export": "./dist/eslint/styles/no-default-export.js",
32
33
  "./eslint/styles/no-null": "./dist/eslint/styles/no-null.js",
@@ -50,6 +51,7 @@
50
51
  "test:presets:javascript": "cd eslint/presets/javascript.test; eslint --max-warnings 0 .",
51
52
  "test:presets:typescript": "cd eslint/presets/typescript.test; eslint --max-warnings 0 .",
52
53
  "test:presets:typescript-react": "cd eslint/presets/typescript-react.test; eslint --max-warnings 0 .",
54
+ "test:rules:vitest": "cd eslint/rules/vitest.test; eslint --max-warnings 0 .",
53
55
  "test:styles:jsx-no-literals": "cd eslint/styles/jsx-no-literals.test; eslint --max-warnings 0 .",
54
56
  "test:styles:no-default-export": "cd eslint/styles/no-default-export.test; eslint --max-warnings 0 .",
55
57
  "test:styles:no-null": "cd eslint/styles/no-null.test; eslint --max-warnings 0 .",
@@ -77,6 +79,7 @@
77
79
  "@semantic-release/git": "^10.0.1",
78
80
  "@types/eslint-config-prettier": "^6.11.3",
79
81
  "@types/eslint-plugin-jsx-a11y": "^6.10.0",
82
+ "@vitest/eslint-plugin": "^1.3.5",
80
83
  "eslint-config-prettier": "^10.1.8",
81
84
  "eslint-plugin-jsx-a11y": "^6.10.2",
82
85
  "eslint-plugin-no-only-tests": "^3.3.0",
@@ -91,7 +94,7 @@
91
94
  "prettier-plugin-jsdoc": "^1.3.3",
92
95
  "prettier-plugin-packagejson": "^2.5.19",
93
96
  "prettier-plugin-tailwindcss": "^0.6.14",
94
- "typescript-eslint": "^8.39.1"
97
+ "typescript-eslint": "^8.41.0"
95
98
  },
96
99
  "devDependencies": {
97
100
  "@types/jest": "^30.0.0",