Checklist
Currently, the parser does not resolve default values of properties.
Playground reproduction
Expected behavior
The analyser outputs the default values even if that is derived from somewhere else.
Example
// my-component.tsx
import { Component, Prop, h } from '@stencil/core';
const Position = {
LEFT: 'left',
RIGHT: 'right',
} as const;
type Position = (typeof Position)[keyof typeof Position];
@Component({
tag: 'my-greeting',
shadow: true
})
export class MyGreeting {
@Prop() position: Position = Position.LEFT; // 1. default value is set here
}
// custom-elements.json
{
"kind": "field",
"name": "position",
"type": {
"text": "Position"
},
"parsedType": {
"text": "'left' | 'right'"
},
"default": "'left'", // 2. this information is currently not provided
},
Related
Checklist
--devflag to get more information?Currently, the parser does not resolve default values of properties.
Playground reproduction
Expected behavior
The analyser outputs the default values even if that is derived from somewhere else.
Example
Related