eslint-plugin-etc
Version:
More general-purpose ESLint rules
34 lines (23 loc) • 782 B
Markdown
out code by effecting failures for comment blocks can be parsed without error.
The rule uses a relatively simple heuristic and if a comment is mistakenly deemed to be commented out code, using `/// ...` or `/*/ ... */` will function as a workaround.
Examples of **incorrect** code for this rule:
```ts
// const answer = 54;
const answer = 42;
```
Examples of **correct** code for this rule:
```ts
// This comment is not code.
const answer = 42;
```
```ts
// This comment includes code as an example:
// const answer = 54;
// However, the comment - treated as a block - won't parse, so it won't effect
// a failure.
const answer = 42;
```
This rule has no options.
This rule forbids commented-