hapijs / hapijs/eslint-plugin

Missing @hapi/scope-start enforcement for comments

Open
#32 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
22
Forks
10
PR merge metrics
No merged PRs in 30d

Description

#### 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:

```js
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.