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

Improvements to JSDoc and constructors #1120

Closed
wants to merge 1 commit into from

Conversation

shadowspawn
Copy link
Collaborator

Pull Request

Problem

We do not have any lint checks on the JSDoc, which is a bit arcane. We do not generate JSDoc based documentation any more, but it may be used by smart editors for autocomplete et al.

Solution

TypeScript supports processing javascript files. I ran the following command and fixed a number of issues it picked up. The two most common were properties missing from constructor (and so unrecognised as valid), and issues with JSDoc declarations being inaccurate compared with the code.

npx tsc --allowJS --checkJS index.js --noEmit

Lint-ish issues detected by TypeScript compiler.
@shadowspawn
Copy link
Collaborator Author

shadowspawn commented Dec 15, 2019

Can also turn on TypeScript checking in Visual Studio Code by adding line:

// @ts-check

but VSC does not currently support Command constructor function extending EventEmitter so multiple warnings about .on() and .listener(), and a couple of other problems. Down from 53 issues to 16 with this PR, but not down low enough to add the line permanently.

@shadowspawn
Copy link
Collaborator Author

I'll redo this without the code changes. Safer to leave the code alone until more compelling reason to change.

@shadowspawn shadowspawn deleted the feature/tidy-js branch January 11, 2020 00:45
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

Successfully merging this pull request may close these issues.

1 participant