- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 709
 
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.15.0
What command did you run?
oxlint
What does your .oxlintrc.json config file look like?
What happened?
It looks like the JSDoc parser/checker breaks when a single quote (') is used inside a comment.
For example, this works fine:
/**
 * Test description.
 * 
 * @returns false
 */
function test() {
  return false;
}But this fails and it shouldn't.
/**
 * Test description, this shouldn't lint error.
 * 
 * @returns false
 */
function test() {
  return false;
}If I remove the single quote or replace it with another character (for example, a typographic apostrophe ’), the error goes away. It also disappears if I use two single quotes (e.g., shouldn''t). However, these are not acceptable solutions. A single quote (') should be valid grammar character for English contractions and should be supported correctly inside JSDoc comments.
Expected Behavior
- JSDoc should allow normal English contractions like 
shouldn'twithout breaking the parser if used before@returns 
Actual Behavior
- Using a single quote (or a single double quote) inside a JSDoc block causes the parser/checker to lint an error:
 
Missing JSDoc `@returns` declaration for function.
help: Add `@returns` tag to the JSDoc comment.oxc[eslint-plugin-jsdoc(require-returns)](https://oxc.rs/docs/guide/usage/linter/rules/jsdoc/require-returns.html)
It only breaks if the single (') or (") is used before the
@returnstag, inside that tag or after works.
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
{ "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json", "plugins": ["jsdoc"], "rules": { "jsdoc/require-returns": "error" } }