eslint-plugin-zod-to-openapi
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -9,2 +9,6 @@ "use strict"; | ||
const createRule = utils_1.ESLintUtils.RuleCreator((name) => `https://example.com/rule/${name}`); | ||
const isInRegister = (callExpression) => callExpression.parent?.type === 'CallExpression' && | ||
callExpression.parent.callee.type === 'MemberExpression' && | ||
callExpression.parent.callee.property.type === 'Identifier' && | ||
callExpression.parent.callee.property.name === 'register'; | ||
exports.rule = createRule({ | ||
@@ -23,3 +27,3 @@ create(context) { | ||
const openApiCallExpression = (0, traverse_1.findOpenApiCallExpression)(declarator); | ||
if (!openApiCallExpression) { | ||
if (!openApiCallExpression || isInRegister(openApiCallExpression)) { | ||
return; | ||
@@ -47,3 +51,3 @@ } | ||
const openApiCallExpression = (0, traverse_1.findOpenApiCallExpression)(node); | ||
if (!openApiCallExpression) { | ||
if (!openApiCallExpression || isInRegister(openApiCallExpression)) { | ||
return; | ||
@@ -50,0 +54,0 @@ } |
@@ -0,4 +1,5 @@ | ||
import { TSESTree } from '@typescript-eslint/utils'; | ||
export declare const rule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"requires", never[], { | ||
VariableDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").VariableDeclaration): void; | ||
Property(node: import("@typescript-eslint/types/dist/generated/ast-spec").Property): void; | ||
VariableDeclaration(node: TSESTree.VariableDeclaration): void; | ||
Property(node: TSESTree.Property): void; | ||
}>; |
{ | ||
"name": "eslint-plugin-zod-to-openapi", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Eslint rules for zod-to-openapi", |
Sorry, the diff of this file is not supported yet
57619
768