Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

completed-docs false positive #4398

Closed
buu700 opened this issue Dec 19, 2018 · 1 comment
Closed

completed-docs false positive #4398

buu700 opened this issue Dec 19, 2018 · 1 comment

Comments

@buu700
Copy link
Contributor

buu700 commented Dec 19, 2018

Bug Report

  • TSLint version: 5.12.0
  • TypeScript version: 3.1.6
  • Running TSLint via: CLI

TypeScript code being linted

/** Waits for iterable value to exist and have at least minLength elements. */
export const waitForIterable	= async <T> (
	f: () => T&{length: number}|undefined,
	minLength: number = 1
) : Promise<T> => {
	return waitForValue<T&{length: number}>(f, value => value.length >= minLength);
};

with tslint.json configuration:

{
	"rules": {
		"completed-docs": [true, {
			"classes": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"enums": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"functions": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"interfaces": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"methods": {
				"privacies": ["protected", "public"],
				"tags": {"existence": ["inheritDoc", "see"]}
			},
			"namespaces": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"properties": {
				"privacies": ["protected", "public"],
				"tags": {"existence": ["inheritDoc", "see"]}
			},
			"types": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			},
			"variables": {
				"tags": {"existence": ["inheritDoc", "see"]},
				"visibilities": ["exported"]
			}
		}]
	}
}

Actual behavior

ERROR: balls.ts:3:14 - Documentation must exist for properties.
ERROR: balls.ts:6:25 - Documentation must exist for properties.

Expected behavior

Should pass.


Edit: Adding "locations": "all" to "methods" and "properties" fixed this. Is this expected?

@JoshuaKGoldberg
Copy link
Contributor

Duplicate of the timely #4396. Good find on locations, I'll mention it there...

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

No branches or pull requests

2 participants