eslint-plugin-zod 1.1.0 → 1.2.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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const create = (context) => {
|
|
3
3
|
return {
|
|
4
4
|
CallExpression(node) {
|
|
5
|
-
var _a, _b;
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
6
6
|
if (((_a = node.callee.object) === null || _a === void 0 ? void 0 : _a.name) !== 'z') {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
@@ -18,7 +18,11 @@ const create = (context) => {
|
|
|
18
18
|
node,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
else if (
|
|
21
|
+
else if (
|
|
22
|
+
// z.object().strict()
|
|
23
|
+
((_c = (_b = node.parent) === null || _b === void 0 ? void 0 : _b.property) === null || _c === void 0 ? void 0 : _c.name) !== 'strict' &&
|
|
24
|
+
// z.object().merge().strict()
|
|
25
|
+
((_g = (_f = (_e = (_d = node.parent) === null || _d === void 0 ? void 0 : _d.parent) === null || _e === void 0 ? void 0 : _e.parent) === null || _f === void 0 ? void 0 : _f.property) === null || _g === void 0 ? void 0 : _g.name) !== 'strict') {
|
|
22
26
|
// As far as I can think, in cases where the property name is not-strict,
|
|
23
27
|
// e.g. passthrough, we should not add a strict() call.
|
|
24
28
|
context.report({
|
package/package.json
CHANGED