Skip to content

Commit

Permalink
fix(check-line-alignment): prevent false never reporting where a sp…
Browse files Browse the repository at this point in the history
…ace is present (post tag) followed by missing space (from a wholly missing type) and then a space (but a space first preceded by content (a name); fixes #714
  • Loading branch information
brettz9 committed Apr 26, 2021
1 parent 06f0112 commit 2c31db1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2303,6 +2303,13 @@ function quux (options) {}
*/
function quux () {}
// "jsdoc/check-line-alignment": ["error"|"warn", "never",{"tags":["param"]}]

/**
* @param parameter Description.
*/
function func(parameter){

}
````


Expand Down
2 changes: 1 addition & 1 deletion src/rules/checkLineAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const checkNotAlignedPerTag = (utils, tag) => {
callbck(!ret, contentProp);
}

return ret;
return ret && (callbck || !contentProp);
});
};

Expand Down
10 changes: 10 additions & 0 deletions test/rules/assertions/checkLineAlignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -943,5 +943,15 @@ export default {
tags: ['param'],
}],
},
{
code: `
/**
* @param parameter Description.
*/
function func(parameter){
}
`,
},
],
};

0 comments on commit 2c31db1

Please sign in to comment.