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

no-unused-vars 设置 ‘error’,无效 #623

Closed
Span134 opened this issue Aug 11, 2022 · 3 comments
Closed

no-unused-vars 设置 ‘error’,无效 #623

Span134 opened this issue Aug 11, 2022 · 3 comments
Labels

Comments

@Span134
Copy link

Span134 commented Aug 11, 2022

问题的具体描述

image

项目命令 npx react-native init AwesomeTSProject --template react-native-template-typescript 生成,
然后App.tsx添加了未使用的变量,tsconfig与eslintrc分别添加配置,启动项目

预期结果 : 希望编译失败,模拟器直接提示 'abc' is decleared but value never read !
实际结果 : 项目编译成功

请描述完整的环境/版本信息

win10
node 16.16.0
"eslint": "^7.32.0",
"typescript": "^4.4.4"
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",

@sunnylqm
Copy link

rn是通过babel来支持ts的,而babel是不做类型检查的
https://babeljs.io/docs/en/babel-plugin-transform-typescript#impartial-namespace-support
image

一般来说,我们在npm scripts中添加tsc命令来做额外的检查,但也只在提交代码或者pr,或者发布版本前做检查,平时依靠编辑器做检查就行了,编译前做检查纯粹是浪费时间

@github-actions
Copy link

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 10, 2022
@github-actions
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

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

No branches or pull requests

2 participants