Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,9 @@ function main( context ) {
* @param {ASTNode} currNode - current require node
*/
function report( prevNode, currNode ) {
var loc = {
'start': {
'line': prevNode.loc.end.line + 1,
'column': 0
},
'end': {
'line': currNode.loc.start.line,
'column': 0
}
};

context.report({
'node': null,
'node': currNode,
'message': 'Unexpected empty line between require statements.',
'loc': loc,
'fix': fix
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ var test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
}
],
'output': [
Expand Down Expand Up @@ -63,7 +64,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 8
}
],
'output': [
Expand Down Expand Up @@ -92,7 +94,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 8
}
],
'output': [
Expand Down Expand Up @@ -121,7 +124,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
}
],
'output': [
Expand Down Expand Up @@ -151,11 +155,13 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
},
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 9
}
],
'output': [
Expand Down Expand Up @@ -185,7 +191,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 8
}
],
'output': [
Expand Down Expand Up @@ -214,7 +221,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
}
],
'output': [
Expand All @@ -241,7 +249,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 6
}
],
'output': [
Expand All @@ -268,7 +277,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
}
],
'output': [
Expand Down Expand Up @@ -298,7 +308,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 7
}
],
'output': [
Expand Down Expand Up @@ -330,7 +341,8 @@ test = {
'errors': [
{
'message': 'Unexpected empty line between require statements.',
'type': null
'type': 'VariableDeclaration',
'line': 9
}
],
'output': [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ test = {
};
valid.push( test );

// Inline disable comment suppresses the rule for a specific require:
test = {
'code': [
'\'use strict\';',
'',
'// MODULES //',
'',
'var tape = require( \'tape\' );',
'',
'var isnan = require( \'@stdlib/math/base/assert/is-nan\' ); // eslint-disable-line no-empty-lines-between-requires'
].join( '\n' )
};
valid.push( test );


// EXPORTS //

Expand Down