Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdoc/require-param rule misaligns doc comment in --fix mode #607

Closed
lucaswerkmeister opened this issue Jul 9, 2020 · 1 comment
Closed

Comments

@lucaswerkmeister
Copy link

Expected behavior

Fixing code style issues does not change the indentation of unaffected lines and modified or newly added lines respect the indentation style of the surrounding code.

Actual behavior

The jsdoc/require-param rule partially realigns doc comments (including the */ line, but not the /* line), resulting in misaligned code.

ESLint Config

{
	"plugins": [
		"jsdoc"
	],
	"rules": {
		"jsdoc/require-param": "error"
	}
}

ESLint sample

Input:

(function() {
	/**
	 * A function.
	 */
	function f(param) {
		return !param;
	}
})();

Result of node_modules/.bin/eslint --fix index.js:

(function() {
	/**
		* A function.
		* @param param
		*/
	function f(param) {
		return !param;
	}
})();

Environment

  • Node version: 14.5.0
  • ESLint version 7.4.0
  • eslint-plugin-jsdoc version: 29.1.2

The sample code, config, and package-lock.json may also be found at https://github.com/lucaswerkmeister/eslint-plugin-jsdoc-require-param-issue.

@gajus
Copy link
Owner

gajus commented Jul 9, 2020

🎉 This issue has been resolved in version 29.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants