kvalita 1.22.0 → 1.23.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
|
@@ -30,6 +30,8 @@ Create a `biome.json` file in your project root:
|
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
The config runs two GritQL plugins on Bun tests. One flags `await` before `expect(...).rejects`, since Bun tracks that assertion on its own. The other flags a callback written inline in `expect(() => fn()).toThrow()`, which reads better as `const throwing = () => fn()`. The plugins load from `node_modules/kvalita`, so the config expects kvalita installed at the project root.
|
|
34
|
+
|
|
33
35
|
### [Commitlint](https://github.com/conventional-changelog/commitlint) Configuration
|
|
34
36
|
|
|
35
37
|
Create a `commitlint.json` file in your project root:
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
`await expect($value).rejects.$matcher($args)` where {
|
|
4
|
+
register_diagnostic(span=$value, message="Drop the await: Bun tracks an expect(...).rejects assertion on its own. Name the call as `const throwing = () => fn()` and assert `expect(throwing()).rejects...`.")
|
|
5
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://biomejs.dev/schemas/latest/schema.json",
|
|
3
3
|
"root": false,
|
|
4
|
+
"plugins": [
|
|
5
|
+
"./node_modules/kvalita/configs/biome/no-await-expect-rejects.grit",
|
|
6
|
+
"./node_modules/kvalita/configs/biome/use-throwing-const.grit"
|
|
7
|
+
],
|
|
4
8
|
"vcs": {
|
|
5
9
|
"enabled": true,
|
|
6
10
|
"clientKind": "git",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
language js
|
|
2
|
+
|
|
3
|
+
`expect($callback).$matcher($args)` where {
|
|
4
|
+
$callback <: or {
|
|
5
|
+
`() => $body`,
|
|
6
|
+
`async () => $body`
|
|
7
|
+
},
|
|
8
|
+
$matcher <: or {
|
|
9
|
+
`toThrow`,
|
|
10
|
+
`toThrowError`
|
|
11
|
+
},
|
|
12
|
+
register_diagnostic(span=$callback, message="Name the throwing call: `const throwing = () => fn()`, then `expect(throwing).toThrow(...)`.")
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"configs"
|
|
16
16
|
],
|
|
17
17
|
"exports": {
|
|
18
|
-
"./biome": "./configs/biome.json",
|
|
18
|
+
"./biome": "./configs/biome/shared.json",
|
|
19
19
|
"./commitlint": "./configs/commitlint.json",
|
|
20
20
|
"./semantic-release": "./configs/semantic-release.json",
|
|
21
21
|
"./semantic-release-dry-run": "./configs/semantic-release-dry-run.json"
|
|
@@ -37,9 +37,10 @@
|
|
|
37
37
|
"@commitlint/cli": "^21.2.2",
|
|
38
38
|
"@commitlint/config-conventional": "^21.2.2",
|
|
39
39
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
40
|
+
"kvalita": "file:.",
|
|
40
41
|
"lefthook": "^2.1.14",
|
|
41
42
|
"semantic-release": "^25.0.9",
|
|
42
43
|
"typescript": "^7.0.2"
|
|
43
44
|
},
|
|
44
|
-
"version": "1.
|
|
45
|
+
"version": "1.23.0"
|
|
45
46
|
}
|