Skip to content
Closed
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 @@ -18,35 +18,35 @@

'use strict';

var Linter = require( 'eslint' ).Linter;
var rule = require( './../lib' );
var Linter = require('eslint').Linter;

Check failure on line 21 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

There should be exactly one space before the closing parenthesis in require calls

Check failure on line 21 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

There should be exactly one space after the opening parenthesis in require calls
var rule = require('./../lib');

Check failure on line 22 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

There should be exactly one space before the closing parenthesis in require calls

Check failure on line 22 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

There should be exactly one space after the opening parenthesis in require calls

var linter = new Linter();
var result;
var code;

code = 'var special = require( \'@stdlib/math\' ).base.special;';

linter.defineRule( 'no-nested-require', rule );
linter.defineRule('no-nested-require', rule);

result = linter.verify( code, {
'rules': {
'no-nested-require': 'error'
}
result = linter.verify(code, {
'rules': {

Check failure on line 33 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Expected indentation of 1 tab but found 4 spaces
'no-nested-require': 'error'

Check failure on line 34 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Expected indentation of 2 tabs but found 8 spaces
}

Check failure on line 35 in lib/node_modules/@stdlib/_tools/eslint/rules/no-nested-require/examples/index.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Expected indentation of 1 tab but found 4 spaces
});
console.log( result );
console.log(result);
/* =>
[
{
'ruleId': 'no-nested-require',
'severity': 2,
'message': 'do not use nested property access for require() expressions',
'line': 2,
'column': 15,
'nodeType': 'CallExpression',
'source': 'var special = require( \'@stdlib/math\' ).base.special;',
'endLine': 2,
'endColumn': 29
}
]
[
{
'ruleId': 'no-nested-require',
'severity': 2,
'message': 'do not use nested property access for require() expressions',
'line': 2,
'column': 15,
'nodeType': 'CallExpression',
'source': 'var special = require( \'@stdlib/math\' ).base.special;',
'endLine': 2,
'endColumn': 29
}
]
*/
Loading