如何解决带有@ stencil / eslint-plugin的eslint抛出“无法读取未定义的属性'typeAnnotation'
将@stencil/plugin-eslint
添加到我的eslint配置extends
部分后,eslint已开始引发以下错误:
Oops! Something went wrong! :(
ESLint: 7.11.0
TypeError: Cannot read property 'typeAnnotation' of undefined
解决方法
在我的媒体资源中添加类型注释可以解决此问题:
@Component({
tag: 'my-component',shadow: true,})
export class MyComponent implements ComponentWillLoad {
// @Element() host; // before
@Element() host: HTMLMyComponentElement; // after
另外,将其添加到我的tsconfig.json
-> compilerOptions
中会导致这种情况以早期错误的形式出现:
"noImplicitAny": true,
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。