File tree Expand file tree Collapse file tree 2 files changed +23
-22
lines changed
_tools/eslint/rules/jsdoc-no-shortcut-reference-image/lib
datasets/cdc-nchs-us-infant-mortality-bw-1915-2013/scripts Expand file tree Collapse file tree 2 files changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,26 @@ var rule;
3939
4040// FUNCTIONS //
4141
42+ /**
43+ * Copies AST node location info.
44+ *
45+ * @private
46+ * @param {Object } loc - AST node location
47+ * @returns {Object } copied location info
48+ */
49+ function copyLocationInfo ( loc ) {
50+ return {
51+ 'start' : {
52+ 'line' : loc . start . line ,
53+ 'column' : loc . start . column
54+ } ,
55+ 'end' : {
56+ 'line' : loc . end . line ,
57+ 'column' : loc . end . column
58+ }
59+ } ;
60+ }
61+
4262/**
4363* Rule to prevent shortcut Markdown reference images from being used in JSDoc descriptions.
4464*
@@ -112,26 +132,6 @@ function main( context ) {
112132 }
113133 }
114134
115- /**
116- * Copies AST node location info.
117- *
118- * @private
119- * @param {Object } loc - AST node location
120- * @returns {Object } copied location info
121- */
122- function copyLocationInfo ( loc ) {
123- return {
124- 'start' : {
125- 'line' : loc . start . line ,
126- 'column' : loc . start . column
127- } ,
128- 'end' : {
129- 'line' : loc . end . line ,
130- 'column' : loc . end . column
131- }
132- } ;
133- }
134-
135135 /**
136136 * Reports an error message.
137137 *
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve;
2424var readFile = require ( '@stdlib/fs/read-file' ) . sync ;
2525var writeFile = require ( '@stdlib/fs/write-file' ) . sync ;
2626var RE_EOL = require ( '@stdlib/regexp/eol' ) . REGEXP ;
27+ var format = require ( '@stdlib/string/format' ) ;
2728
2829
2930// VARIABLES //
@@ -66,7 +67,7 @@ function main() {
6667 for ( i = 0 ; i < data . length ; i ++ ) {
6768 d = data [ i ] . split ( ',' ) ;
6869 if ( d . length !== fields . length ) {
69- throw new Error ( 'unexpected error. Number of row values (' + d . length + ' ) does not match the expected number of fields (' + fields . length + ').' ) ;
70+ throw new Error ( format ( 'unexpected error. Number of row values (%d ) does not match the expected number of fields (%d).' , d . length , fields . length ) ) ;
7071 }
7172 for ( j = 1 ; j < d . length ; j ++ ) {
7273 d [ j ] = parseFloat ( d [ j ] ) ;
@@ -86,7 +87,7 @@ function main() {
8687 } else if ( d [ 0 ] === 'white' ) {
8788 json . white . push ( d [ 2 ] ) ;
8889 } else {
89- throw new Error ( 'unexpected error. Unrecognized race: `' + d [ 2 ] + '`.' ) ;
90+ throw new Error ( format ( 'unexpected error. Unrecognized race: `%s`.' , d [ 0 ] ) ) ;
9091 }
9192 }
9293 if ( json . black . length !== json . white . length ) {
You can’t perform that action at this time.
0 commit comments