Skip to content

Commit 503ca0c

Browse files
Merge pull request #505 from dphengsiaroun/development
Issue #492 - More robustness
2 parents 874106a + b7db9a5 commit 503ca0c

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)