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

completed-docs does not report any errors #2291

Closed
Rukenshia opened this issue Mar 3, 2017 · 2 comments · Fixed by #2322 or singapore/lint-condo#263
Closed

completed-docs does not report any errors #2291

Rukenshia opened this issue Mar 3, 2017 · 2 comments · Fixed by #2322 or singapore/lint-condo#263

Comments

@Rukenshia
Copy link

Bug Report

  • TSLint version: 4.5.1
  • TypeScript version: 2.0.2
  • Running TSLint via: CLI

TypeScript code being linted

export function x() {
    return 1;
}

with tslint.json configuration:

{
  "rules": {
    "completed-docs": true
  }
}

Actual behavior

$ node_modules/.bin/tslint --type-check src/test.ts
Warning: The 'completed-docs' rule requires type checking

Expected behavior

Shouldn't I get a message about documentation missing? Sadly https://palantir.github.io/tslint/rules/completed-docs/ just displays a white page for me. Maybe I'm just using or imagining it wrong but ideally, I'd like to enforce everything being documented.

@ajafff
Copy link
Contributor

ajafff commented Mar 3, 2017

For --type-check to work you also need to pass --project ./path/to/tsconfig.json as stated in the CLI documentation. Also the file you want to lint needs to be part of you project (included in tsconfig.json)

But maybe that should also be printed as error or warning ...

@Rukenshia
Copy link
Author

Okay, that solved it. In the actual script I am running I just passed -p tsconfig.json, but tslint needs --project. I assumed I could pass it as -p like with tsc.

@ajafff ajafff mentioned this issue Mar 9, 2017
4 tasks
nchen63 pushed a commit that referenced this issue Mar 10, 2017
[bugfix] exit with 0 on type check errors when `--force` is specified
Fixes: #2087
[bugfix] `--test` now correctly strips single quotes from patterns on windows
[enhancement] `--test` can handle multiple paths at once
[enhancement] added `-p` as shorthand for `--project` to be consistent with `tsc`
Kind of fixes: #2291
[enhancement] print error when `--type-check` is used without `--project`
[enhancement]  don't print stack trace on type check error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants