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

Suggestion: Check about tpescript is right or wrong in .d.ts files. #19524

Closed
linbingquan opened this issue Jun 1, 2020 · 6 comments
Closed

Comments

@linbingquan
Copy link
Contributor

I think we need a tool, like tsc. Sorry I don't know how to do it...

@linbingquan linbingquan changed the title Question: How to check about tpescript is right or wrong in .d.ts files Suggestion: Check about tpescript is right or wrong in .d.ts files. Jun 1, 2020
@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 1, 2020

The project is already doing this. Checkout how tsc is used in test-lint.

"test-lint": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json",

@linbingquan
Copy link
Contributor Author

The project is already doing this. Checkout how tsc is used in test-lint.

"test-lint": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json",

Thank you for your reply. I tried this script npm run test-lint, it doesn't work very well, it can't found any error/warning. May be I missed something.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 1, 2020

It works well on my system. Besides, I'm not sure why you refer to #11552. The discussion about TypeScript in this issue was off-topic and unrelated to ES6 classes.

@linbingquan
Copy link
Contributor Author

It works well on my system.

On my system is:
image

I'm not sure why you refer to #11552. The discussion about TypeScript in this issue was off-topic and unrelated to ES6 classes.

I am sorry, I deleted the related comment, It didn't unrelated with #11552

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 1, 2020

Well, right now the command does not produce an output since everything is clean. If you for example remove an import in a d.ts file, a respective error should be reported.

@donmccurdy
Copy link
Collaborator

Note that the tsc command is looking at the example and unit test code, and comparing that against the type definitions, to ensure that these uses of the three.js APIs match the uses that the type definitions would allow. This will catch many issues, but not all issues — it cannot guarantee that the type definitions match the actual JS source code completely.

Unfortunately, the TypeScript project has not provided any robust way to compare d.ts type definitions to JavaScript source code to detect mismatches more directly.

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

No branches or pull requests

3 participants