Skip to content

Commit c485955

Browse files
fix: linting for not defined refs
1 parent d639855 commit c485955

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/apidom-ls/src/services/validation/linter-functions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,11 @@ export const standardLinterfunctions: FunctionItem[] = [
11161116
{
11171117
functionName: 'apilintReferenceNotUsed',
11181118
function: (element) => {
1119+
const elParent = element.parent?.parent?.parent?.parent;
1120+
if (!elParent.hasKey || !elParent.hasKey('schemas')) {
1121+
return true;
1122+
}
1123+
11191124
const api = root(element);
11201125
const isReferenceElement = (el: Element) => el.element === 'reference';
11211126
const referenceElements = filter((el) => {

0 commit comments

Comments
 (0)