File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
oxc_linter/src/rules/jsdoc
oxc_semantic/src/jsdoc/parser Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1109,6 +1109,19 @@ fn test() {
11091109 None ,
11101110 None ,
11111111 ) ,
1112+ (
1113+ "
1114+ /**
1115+ * Has single quote ' in comment.
1116+ * @returns Foo.
1117+ */
1118+ function quux () {
1119+ return foo;
1120+ }
1121+ " ,
1122+ None ,
1123+ None ,
1124+ ) ,
11121125 ] ;
11131126
11141127 let fail = vec ! [
Original file line number Diff line number Diff line change @@ -229,6 +229,21 @@ mod test {
229229 "@k3 c3\n " ,
230230 ) ,
231231 ( "/** single line @k4 c4 */" , "@k4 c4 " ) ,
232+ (
233+ "
234+ /**
235+ * Has single quote ' in comment
236+ * @k5 c5
237+ */" ,
238+ "@k5 c5\n " ,
239+ ) ,
240+ (
241+ "
242+ /**
243+ * @import {T} from '@k6'
244+ */" ,
245+ "@import {T} from '@k6'\n " ,
246+ ) ,
232247 ] {
233248 let allocator = Allocator :: default ( ) ;
234249 let semantic = build_semantic ( & allocator, source_text) ;
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ pub fn parse_jsdoc(
7878 }
7979 '"' => in_double_quotes = !in_double_quotes,
8080 '\'' => in_single_quotes = !in_single_quotes,
81+ '\n' => {
82+ in_double_quotes = false ;
83+ in_single_quotes = false ;
84+ }
8185 '{' => curly_brace_depth += 1 ,
8286 '}' => curly_brace_depth = curly_brace_depth. saturating_sub ( 1 ) ,
8387 '(' => brace_depth += 1 ,
You can’t perform that action at this time.
0 commit comments