eslint-plugin-no-mistakes 0.77.1 → 0.78.1
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/package.json
CHANGED
|
@@ -8,7 +8,7 @@ module.exports = rule(
|
|
|
8
8
|
{
|
|
9
9
|
type: "problem",
|
|
10
10
|
docs: {
|
|
11
|
-
description: "
|
|
11
|
+
description: "require positive Vitest timeouts and cap project defaults and overrides",
|
|
12
12
|
recommended: false,
|
|
13
13
|
},
|
|
14
14
|
schema: [
|
|
@@ -23,6 +23,8 @@ module.exports = rule(
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
messages: {
|
|
26
|
+
invalid:
|
|
27
|
+
"Vitest {{name}} must be positive; zero disables the timeout and negative values are invalid.",
|
|
26
28
|
timeout:
|
|
27
29
|
"Vitest {{name}} exceeds {{max}} ms. Fix the slow wait or test setup rather than hiding hangs with a larger timeout.",
|
|
28
30
|
unknown:
|
|
@@ -45,7 +47,9 @@ module.exports = rule(
|
|
|
45
47
|
const node = origin || entry.origin;
|
|
46
48
|
if (suppressed(node)) return;
|
|
47
49
|
if (entry.value.kind === "number") {
|
|
48
|
-
if (entry.value.value >
|
|
50
|
+
if (!(entry.value.value > 0))
|
|
51
|
+
context.report({ node, messageId: "invalid", data: { name } });
|
|
52
|
+
else if (entry.value.value > max)
|
|
49
53
|
context.report({ node, messageId: "timeout", data: { name, max } });
|
|
50
54
|
} else if (option.unknownValues === "finding")
|
|
51
55
|
context.report({ node, messageId: "unknown", data: { name, max } });
|