Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSDoc to document attributes for camel case properties #1774

Closed
web-padawan opened this issue Jul 15, 2020 · 2 comments · Fixed by vaadin/magi-cli#117 or #1776
Closed

Add JSDoc to document attributes for camel case properties #1774

web-padawan opened this issue Jul 15, 2020 · 2 comments · Fixed by vaadin/magi-cli#117 or #1776
Labels
DX Developer experience issue typescript TypeScript definitions issue

Comments

@web-padawan
Copy link
Member

web-padawan commented Jul 15, 2020

Description

When using lit-analyzer for linting code that uses vaadin-grid, there are warnings for certain attributes.

Expected outcome

No warnings when using attributes corresponding to camel case properties.

Actual outcome

The following warnings are shown:

    Unknown attribute 'flex-grow'. Did you mean 'flexGrow'?
    37:  flex-grow="0"
    no-unknown-attribute


    Unknown attribute 'auto-width'. Did you mean '?autoWidth'?
    47:  auto-width
    no-unknown-attribute

Steps to reproduce

  1. Clone the repo: https://github.com/web-padawan/ts-vaadin-examples
  2. Run yarn to install dependencies
  3. Run `yarn lint:lit

Suggested fix

Add the following to JSDoc annotations for corresponding properties:

* @attr {number} flex-grow
* @attr {boolean} auto-width
@web-padawan web-padawan added DX Developer experience issue typescript TypeScript definitions issue labels Jul 15, 2020
@web-padawan
Copy link
Member Author

web-padawan commented Jul 15, 2020

Pushed a branch with some fixes https://github.com/vaadin/vaadin-grid/compare/attr-jsdoc

The problem is that @attr annotations are getting removed by gen-typescript-declarations 😕
And we need them in *.d.ts files in order to be picked up by web-component-analyzer.

@web-padawan
Copy link
Member Author

Submitted a PR to gen-typescript-declarations to address that: Polymer/tools#3508
While waiting for it to land, we might create a custom build and integrate it with magi-cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Developer experience issue typescript TypeScript definitions issue
Projects
None yet
1 participant