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 ) {
95
95
for ( i = 0 ; i < comments . length ; i ++ ) {
96
96
current = comments [ i ] ;
97
97
line = current . loc . start . line ;
98
- prevLine = source . lines [ line - 2 ] ;
98
+ prevLine = source . lines [ line - 2 ] || '' ;
99
99
token = source . getTokenBefore ( current ) ;
100
100
101
101
if ( isObject ( token ) ) {
Original file line number Diff line number Diff line change 19
19
'use strict' ;
20
20
21
21
/**
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.
23
23
*
24
24
* @module @stdlib /_tools/eslint/rules/first-unit-test
25
25
*
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ function main( context ) {
101
101
j = 0 ;
102
102
103
103
// Skip over all variable declarations...
104
- while ( body . body [ j ] . type === 'VariableDeclaration' ) {
104
+ while ( j < body . body . length && body . body [ j ] . type === 'VariableDeclaration' ) {
105
105
j += 1 ;
106
106
}
107
107
first = body . body [ j ] ;
Original file line number Diff line number Diff line change @@ -85,13 +85,13 @@ result = linter.verify( code, {
85
85
{
86
86
'ruleId': 'new-cap-array',
87
87
'severity': 2,
88
- 'message': '`Array` constructor is invoked without the `new` ' keyword',
88
+ 'message': '`Array` constructor is invoked without the `new` keyword',
89
89
'line': 1,
90
90
'column': 11,
91
91
'nodeType': 'CallExpression',
92
92
'source': 'var arr = Array( 10 );',
93
93
'endLine': 1,
94
- 'endColumn': 41
94
+ 'endColumn': 22
95
95
}
96
96
]
97
97
*/
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ console.log( result );
39
39
{
40
40
'ruleId': 'new-cap-array',
41
41
'severity': 2,
42
- 'message': '`Array` constructor is invoked without the `new` ' keyword',
42
+ 'message': '`Array` constructor is invoked without the `new` keyword',
43
43
'line': 1,
44
44
'column': 11,
45
45
'nodeType': 'CallExpression',
46
46
'source': 'var arr = Array( 10 );',
47
47
'endLine': 1,
48
- 'endColumn': 41
48
+ 'endColumn': 22
49
49
}
50
50
]
51
51
*/
You can’t perform that action at this time.
0 commit comments