Skip to content
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/file-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function handleModuleCase(node, context, defaultFilename) {
});

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

Expand Down