File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
lib/node_modules/@stdlib/_tools/eslint/rules Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ function main( context ) {
9595 for ( i = 0 ; i < comments . length ; i ++ ) {
9696 current = comments [ i ] ;
9797 line = current . loc . start . line ;
98- prevLine = source . lines [ line - 2 ] ;
98+ prevLine = source . lines [ line - 2 ] || '' ;
9999 token = source . getTokenBefore ( current ) ;
100100
101101 if ( isObject ( token ) ) {
Original file line number Diff line number Diff line change 1919'use strict' ;
2020
2121/**
22- * ESLint rule to enforce enforce that a test file starts with the expected test.
22+ * ESLint rule to enforce that a test file starts with the expected test.
2323*
2424* @module @stdlib /_tools/eslint/rules/first-unit-test
2525*
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ function main( context ) {
101101 j = 0 ;
102102
103103 // Skip over all variable declarations...
104- while ( body . body [ j ] . type === 'VariableDeclaration' ) {
104+ while ( j < body . body . length && body . body [ j ] . type === 'VariableDeclaration' ) {
105105 j += 1 ;
106106 }
107107 first = body . body [ j ] ;
Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ result = linter.verify( code, {
8585 {
8686 'ruleId': 'new-cap-array',
8787 'severity': 2,
88- 'message': '`Array` constructor is invoked without the `new` ' keyword',
88+ 'message': '`Array` constructor is invoked without the `new` keyword',
8989 'line': 1,
9090 'column': 11,
9191 'nodeType': 'CallExpression',
9292 'source': 'var arr = Array( 10 );',
9393 'endLine': 1,
94- 'endColumn': 41
94+ 'endColumn': 22
9595 }
9696 ]
9797*/
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ console.log( result );
3939 {
4040 'ruleId': 'new-cap-array',
4141 'severity': 2,
42- 'message': '`Array` constructor is invoked without the `new` ' keyword',
42+ 'message': '`Array` constructor is invoked without the `new` keyword',
4343 'line': 1,
4444 'column': 11,
4545 'nodeType': 'CallExpression',
4646 'source': 'var arr = Array( 10 );',
4747 'endLine': 1,
48- 'endColumn': 41
48+ 'endColumn': 22
4949 }
5050 ]
5151*/
You can’t perform that action at this time.
0 commit comments