Skip to content

Commit b7db9a5

Browse files
committed
add: consolidate test
1 parent 7739546 commit b7db9a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/file-name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function handleModuleCase(node, context, defaultFilename) {
4646
});
4747

4848
// Check that the definition is an import declaration.
49-
if (variable.defs[0].parent.type !== 'ImportDeclaration') {
49+
if (!(variable && variable.defs && variable.defs[0] && variable.defs[0].parent && variable.defs[0].parent.type === 'ImportDeclaration')) {
5050
return defaultFilename;
5151
}
5252

0 commit comments

Comments
 (0)