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

eslint的无法识别ts全局type解决方案 | NIKO'S BLOG #2

Open
nikolausliu opened this issue Jul 6, 2021 · 1 comment
Open

Comments

@nikolausliu
Copy link
Owner

https://nikolausliu.github.io/2021-06-28/eslint%E6%97%A0%E6%B3%95%E8%AF%86%E5%88%ABts%E5%85%A8%E5%B1%80type%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88.html

我在ts项目中声明了一个全局type,在使用这个type的时候,可以获得类型提示,但是eslint的no-undef规则无法校验通过 123declare global { type IdLike = number | string | null} 查阅eslint官方文档得知,需要配置eslint配置文件(.eslintrc.*文件或package.json文件的esli

@nikolausliu
Copy link
Owner Author

测试gitalk评论

测试引用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant