Skip to content

Commit eaa99d2

Browse files
committed
build: enable doctest-annotation-spacing lint rule
--- 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: na - 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: na - task: lint_javascript_tests status: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent fdbe637 commit eaa99d2

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

etc/eslint/rules/stdlib.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,35 @@ rules[ 'stdlib/capitalized-comments' ] = [ 'warn', {
9797
*/
9898
rules[ 'stdlib/doctest' ] = 'off';
9999

100+
/**
101+
* Enforce spacing in return annotations in single-line comments.
102+
*
103+
* @name doctest-annotation-spacing
104+
* @memberof rules
105+
* @type {string}
106+
* @default 'error'
107+
*
108+
* @example
109+
* // Bad...
110+
* var v = 3.14;
111+
* // returns 3.14
112+
*
113+
* console.log( 'beep' );
114+
* //=> 'beep'
115+
*
116+
* var x = true;
117+
* // returns true
118+
*
119+
* @example
120+
* // Good...
121+
* var v = 3.14;
122+
* // returns 3.14
123+
*
124+
* console.log( 'beep' );
125+
* // => 'beep'
126+
*/
127+
rules[ 'stdlib/doctest-annotation-spacing' ] = 'error';
128+
100129
/**
101130
* Enforce marker style conventions for return annotations.
102131
*

0 commit comments

Comments
 (0)