question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`validation.notDocumented` doesn't correctly handle some cases

See original GitHub issue

Search terms

function type definitions, methods with computed names, generated types

Expected Behavior

Enabling validation.notDocumented should correctly report on:

  • function type definitions (type Foo = () => void)
  • methods with computed names:
    const name = "foo";
    class SomeClass {
      [name]() { return "huh"; }
    }
    
  • methods inside generated definitions used by excluded methods:
    class SomeClass {
      doSomething() {
        return {
          foo() {}
        }
      }
    }
    

Actual Behavior

All of the above cases falsely report that they are undocumented.

Steps to reproduce the bug

  1. Clone the main branch of https://github.com/thislooksfun/typedoc-repros
  2. Install deps and run npm run gendoc
  3. The docs should be generated without any warning. Instead, it prints:
Warning: FunctionType, defined at index.ts:2, does not have any documentation.
Warning: [iterator], defined at index.ts:7, does not have any documentation.
Warning: index, defined at index.ts:10, does not have any documentation.
Warning: next, defined at index.ts:12, does not have any documentation.
Warning: next, defined at index.ts:28, does not have any documentation.

Environment

  • Typedoc version: HEAD (98841f5b6c79a2314f5bde6d328fe0b6f4e56bea)
  • TypeScript version: any
  • Node.js version: 16
  • OS: macOS

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
Gerrit0commented, Mar 27, 2022

Well, there’s that fixed… hopefully this lasts longer than the other one before horrible bugs are discovered 😉

0reactions
thislooksfuncommented, Mar 27, 2022

I can confirm that my project now passes without error when run against ea16a7b4885abd9ee3ee7ef28ded0e4293f1ee7c! I’m probably not using every possible reflected type, but I ran with requiredToBeDocumented set to everything other than "Project" and got 0 false matches.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS DMS data validation - AWS Database Migration Service
Suspended records—Some records in the table can't be validated. No primary key—The table can't be validated because it had no primary key. Table...
Read more >
Client-side form validation - Learn web development | MDN
Even if your form is validating correctly and preventing malformed input on the client-side, a malicious user can still alter the network ...
Read more >
Part 9, add validation to an ASP.NET Core MVC app
Run the app and navigate to the Movies controller. Select the Create New link to add a new movie. Fill out the form...
Read more >
How To Use Schema Validation in MongoDB - DigitalOcean
This schema document outlines certain requirements that certain parts of documents entered into the collection must follow. The root part of the ...
Read more >
Data Validation – How to Check User Input on HTML Forms ...
We need form validation anytime we are accepting user input. We must ensure that the data entered is in the correct format, lies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found