Skip to content

Commit 148a60b

Browse files
committed
refactor: apply code review suggestions
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 0be7638 commit 148a60b

File tree

6 files changed

+23
-27
lines changed

6 files changed

+23
-27
lines changed

etc/eslint/rules/stdlib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ rules[ 'stdlib/doctest-quote-props' ] = 'error';
201201
rules[ 'stdlib/empty-line-before-comment' ] = 'error';
202202

203203
/**
204-
* No spaces allowed between an opening parenthesis or bracket and a nested object or array expression.
204+
* Disallow spaces between an opening parenthesis or bracket and a nested object or array expression at the end of a line.
205205
*
206206
* @name eol-open-bracket-spacing
207207
* @memberof rules

lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# eol-open-bracket-spacing
2222

23-
> [ESLint rule][eslint-rules] to enforce that no spaces are present between an opening parenthesis or bracket and a nested object or array expression.
23+
> [ESLint rule][eslint-rules] to enforce that no spaces are present between an opening parenthesis or bracket and a nested object or array expression at the end of a line.
2424
2525
<section class="intro">
2626

@@ -97,10 +97,8 @@ var Linter = require( 'eslint' ).Linter;
9797
var rule = require( '@stdlib/_tools/eslint/rules/eol-open-bracket-spacing' );
9898

9999
var linter = new Linter();
100-
var result;
101-
var code;
102100

103-
code = [
101+
var code = [
104102
'function test() {',
105103
' var log = require( \'@stdlib/console/log\' );',
106104
' log( {',
@@ -115,7 +113,7 @@ code = [
115113

116114
linter.defineRule( 'eol-open-bracket-spacing', rule );
117115

118-
result = linter.verify( code, {
116+
var result = linter.verify( code, {
119117
'rules': {
120118
'eol-open-bracket-spacing': 'error'
121119
}
@@ -125,15 +123,15 @@ result = linter.verify( code, {
125123
{
126124
'ruleId': 'eol-open-bracket-spacing',
127125
'severity': 2,
128-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
126+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
129127
'line': 3,
130128
'column': 3,
131129
'nodeType': 'CallExpression'
132130
},
133131
{
134132
'ruleId': 'eol-open-bracket-spacing',
135133
'severity': 2,
136-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
134+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
137135
'line': 6,
138136
'column': 13,
139137
'nodeType': 'ArrayExpression'

lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/examples/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ console.log( result );
5151
{
5252
'ruleId': 'eol-open-bracket-spacing',
5353
'severity': 2,
54-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
54+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
5555
'line': 3,
5656
'column': 3,
5757
'nodeType': 'CallExpression'
5858
},
5959
{
6060
'ruleId': 'eol-open-bracket-spacing',
6161
'severity': 2,
62-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
62+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
6363
'line': 6,
6464
'column': 13,
6565
'nodeType': 'ArrayExpression'

lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* ESLint rule to enforce that no spaces are present between an opening parenthesis or bracket and a nested object or array expression.
22+
* ESLint rule to enforce that no spaces are present between an opening parenthesis or bracket and a nested object or array expression at the end of a line.
2323
*
2424
* @module @stdlib/_tools/eslint/rules/eol-open-bracket-spacing
2525
*

lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/lib/main.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,14 @@ var rule;
2626
// FUNCTIONS //
2727

2828
/**
29-
* Rule for validating that no spaces are present between an opening parenthesis or bracket and a nested object or array expression.
29+
* Rule for validating that no spaces are present between an opening parenthesis or bracket and a nested object or array expression at the end of a line.
3030
*
3131
* @private
3232
* @param {Object} context - ESLint context
3333
* @returns {Object} validators
3434
*/
3535
function main( context ) {
36-
var source;
37-
38-
source = context.getSourceCode();
36+
var source = context.getSourceCode();
3937

4038
/**
4139
* Reports the error message.
@@ -48,12 +46,12 @@ function main( context ) {
4846
function report( node, prevToken, tokenAfter ) {
4947
context.report({
5048
'node': node,
51-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
49+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
5250
'fix': fix
5351
});
5452

5553
/**
56-
* Fixes lint the error by removing the space before the object or array literal.
54+
* Fixes lint the error by removing the space before the object or array expression.
5755
*
5856
* @private
5957
* @param {Object} fixer - ESLint fixer
@@ -70,7 +68,7 @@ function main( context ) {
7068
}
7169

7270
/**
73-
* Checks whether there are spaces present between an opening parenthesis or bracket and a nested object or array expression.
71+
* Checks whether there are spaces present between an opening parenthesis or bracket and a nested object or array expression at the end of a line.
7472
*
7573
* @private
7674
* @param {ASTNode} node - node to examine
@@ -144,7 +142,7 @@ rule = {
144142
'meta': {
145143
'type': 'layout',
146144
'docs': {
147-
'description': 'enforce no spaces between an opening parenthesis or bracket and a nested object or array expression'
145+
'description': 'disallow spaces between an opening parenthesis or bracket and a nested object or array expression at the end of a line'
148146
},
149147
'schema': [],
150148
'fixable': 'whitespace'

lib/node_modules/@stdlib/_tools/eslint/rules/eol-open-bracket-spacing/test/fixtures/invalid.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test = {
2929
'}];'
3030
].join( '\n' ),
3131
'errors': [{
32-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
32+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
3333
'type': null
3434
}],
3535
'output': [
@@ -58,7 +58,7 @@ test = {
5858
']);'
5959
].join( '\n' ),
6060
'errors': [{
61-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
61+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
6262
'type': null
6363
}],
6464
'output': [
@@ -92,7 +92,7 @@ test = {
9292
'}]);'
9393
].join( '\n' ),
9494
'errors': [{
95-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
95+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
9696
'type': null
9797
}],
9898
'output': [
@@ -122,7 +122,7 @@ test = {
122122
'}]);'
123123
].join( '\n' ),
124124
'errors': [{
125-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
125+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
126126
'type': null
127127
}],
128128
'output': [
@@ -152,10 +152,10 @@ test = {
152152
'}]);'
153153
].join( '\n' ),
154154
'errors': [{
155-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
155+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
156156
'type': null
157157
}, {
158-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
158+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
159159
'type': null
160160
}],
161161
'output': [
@@ -186,7 +186,7 @@ test = {
186186
'*/'
187187
].join( '\n' ),
188188
'errors': [{
189-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
189+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
190190
'type': null
191191
}],
192192
'output': [
@@ -212,7 +212,7 @@ test = {
212212
'});'
213213
].join( '\n' ),
214214
'errors': [{
215-
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression',
215+
'message': 'No spaces allowed between an opening parenthesis or bracket and a nested object or array expression at the end of a line',
216216
'type': null
217217
}],
218218
'output': [

0 commit comments

Comments
 (0)