diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js index 59474cccfef8..8cd70482498e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js @@ -85,7 +85,10 @@ function main( context ) { node.arguments.length > 0 ) { args = node.arguments; - if ( args[ 0 ].type === 'ObjectExpression' ) { + if ( + args[ 0 ].type === 'ObjectExpression' && + args[ 0 ].properties.length > 0 + ) { prevToken = source.getTokenBefore( args[ 0 ] ); tokenAfter = source.getFirstToken( args[ 0 ] ); if ( source.isSpaceBetween( prevToken, tokenAfter ) ) { @@ -93,7 +96,10 @@ function main( context ) { } } else if ( args[ 0 ].type === 'ArrayExpression' ) { elem = args[ 0 ].elements[ 0 ]; - if ( elem.type === 'ObjectExpression' ) { + if ( + elem.type === 'ObjectExpression' && + elem.properties.length > 0 + ) { prevToken = source.getTokenBefore( args[ 0 ] ); tokenAfter = source.getFirstToken( args[ 0 ] ); if ( source.isSpaceBetween( prevToken, tokenAfter ) ) { @@ -118,7 +124,10 @@ function main( context ) { node.elements.length > 0 ) { elem = node.elements[ 0 ]; - if ( elem.type === 'ObjectExpression' ) { + if ( + elem.type === 'ObjectExpression' && + elem.properties.length > 0 + ) { prevToken = source.getFirstToken( node ); tokenAfter = source.getFirstToken( elem ); diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/test/fixtures/unvalidated.js b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/test/fixtures/unvalidated.js index c6c33b1faa84..e99ae557b430 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/test/fixtures/unvalidated.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/test/fixtures/unvalidated.js @@ -35,6 +35,21 @@ test = { }; valid.push( test); +test = { + 'code': [ + ' var log = require( \'@stdlib/console/log\' );', + ' log( {} );' + ].join( '\n' ) +}; +valid.push( test); + +test = { + 'code': [ + 'var arr = [ {}, 1, 2, 3, 4 ];' + ].join( '\n' ) +}; +valid.push( test); + // EXPORTS //