Skip to content

Commit 6869b41

Browse files
committed
Fix error on empty arugments function
1 parent d3e0df6 commit 6869b41

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

lib/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const getImport = (context, callback) => ({
2424
ExpressionStatement: node => {
2525
if (
2626
node.expression.type === 'CallExpression' &&
27+
node.expression.arguments.length > 0 &&
2728
node.expression.arguments[0].type === 'Literal' &&
2829
(node.expression.callee.type === 'Import' ||
2930
(node.expression.callee.type === 'Identifier' &&

tests/rules/no-cross-imports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ruleTester.run('no-cross-imports', rule, {
1010
"import('module');",
1111
"import 'module';",
1212
"import '../some/relative/path';",
13+
'someFunction();',
1314
{
1415
options: [{ allow: '@test/workspace' }],
1516
filename: '/some/path',

tests/rules/no-relative-imports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ruleTester.run('no-relative-imports', rule, {
1010
"import('@test/workspace');",
1111
"import '@test/workspace';",
1212
"import '../some/relative/path';",
13+
'someFunction();',
1314
{
1415
filename: '/test/workspace',
1516
code: "import '../workspace';",

0 commit comments

Comments
 (0)