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

Missing @hapi/scope-start enforcement for comments

Open kanongil opened this issue 3 years ago • 1 comments
trafficstars

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): yes

Context

  • node version: any
  • module version with issue: 6.0.0
  • last module version without issue: unknown
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): eslint
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

Enable standardised linting syntax using the @hapi/scope-start rule for comments at the start of a function scope:

const ok = function () {
    // This line should create a linter warning

    return true;
};

What was the result you got?

Pass.

What result did you expect?

A warning due to missing empty line at start of function, similar to when any statement / expression is there.

As an aside, it would be nice if the generated warning only marks the line that needs to be moved, rather than the full function block.

kanongil avatar Aug 06 '22 10:08 kanongil

Thank you for the report @kanongil.

Nargonath avatar Aug 08 '22 08:08 Nargonath