eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Empty line is required if the first line is a comment

Open constgen opened this issue 5 years ago • 0 comments

Checklist

  • [x] I have tried restarting my IDE and the issue persists.
  • [x] I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 7.11.0
  • eslint-plugin-vue version: 7.0.1
  • Node version: 12
  • Operating System: Windows 10

Please show your full configuration:

The rule that is reported

"lines-around-comment": ["warn", {
   "beforeBlockComment": true,
   "afterBlockComment": false,
   "beforeLineComment": true,
   "afterLineComment": false,
   "allowBlockStart": true,
   "allowBlockEnd": true,
   "allowClassStart": true,
   "allowClassEnd": true,
   "allowObjectStart": true,
   "allowObjectEnd": true,
   "allowArrayStart": true,
   "allowArrayEnd": true,
   "ignorePattern": "^\\s*?import\\s|require\\s*?\\([\\s\\S]+?\\)|^\\s*?(let|const|var)\\s"
}],

What did you do?

Testing component

<script>
// coment
export default ({ props, listeners, children }) => {
	let onClick = listeners.click || function () {};

	return (
		<h1 id={props.id}>
			<a href="##" onClick={onClick}>
				{children}
			</a>
		</h1>
	);
};
</script>

What did you expect to happen?

No ESLint errors to be reported on the Line:2

What actually happened?

The very first line with coment // coment after

Expected line before comment. eslint(lines-around-comment)

The same configuration doesn't report a violation of comments at the first line of *.js files

Repository to reproduce this issue

No

constgen avatar Oct 10 '20 15:10 constgen