Skip to content

Commit 4c65115

Browse files
committed
fix(rules): no-unused-props normalize TS declaraction fileName
1 parent e7a904d commit 4c65115

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/eslint-plugin-svelte/src/rules/no-unused-props.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { TSESTree } from '@typescript-eslint/types';
44
import type ts from 'typescript';
55
import { findVariable } from '../utils/ast-utils.js';
66
import { toRegExp } from '../utils/regexp.js';
7+
import { normalize } from 'path';
78

89
type PropertyPathArray = string[];
910
type DeclaredPropertyNames = Set<{ originalName: string; aliasName: string }>;
@@ -122,7 +123,7 @@ export default createRule('no-unused-props', {
122123
const declarations = symbol.getDeclarations();
123124
if (!declarations || declarations.length === 0) return false;
124125

125-
return declarations.every((decl) => decl.getSourceFile().fileName === fileName);
126+
return declarations.every((decl) => normalize(decl.getSourceFile().fileName) === fileName);
126127
}
127128

128129
/**

0 commit comments

Comments
 (0)