Comments (7)
BTW when we chatted with the compiler owners, they cautioned us against fostering an unnecessary tribal boundary between "JavaScript files" and "TypeScript files". What if someone works in TypeScript but also has a lot of legacy JavaScript code that they can't migrate overnight? Should they really have to learn two different doc comment syntaxes (and possibly two different documentation tools), and constantly switch between them depending on which file they're editing? If TSDoc-in-JavaScript was modeled as a set of custom extensions for recording type information, then you could use one tool and syntax to work on both kinds of files.
This is probably out of scope for the first release. And I'm not sure to what extent someone would be authoring lots of new API documentation for their non-migrated files. But it made me think that where possible, the TSDoc design should try to anticipate and provide for this possible direction.
from tsdoc.
@mike-north pointed me to this listing of JSDoc tags that are supported by the TypeScript compiler for type analysis:
https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript
We should definitely include these in TSDoc's standard set of tags.
from tsdoc.
As I see TSDoc-in-JS this is out of scope of initial release but may be considered later.
Another pain point in JS files that can be addressed by upcoming standard - standardized way to write docs for function overloads. I've tried couple of examples for JSDoc, but non of them provided any meaningful info in VS Code or WebStorm editors.
Even if project can't migrate to TS at some point, but TS LanguageService will handle comments with overrides - devs will benefit from it.
And at would be great to have same doc generator that will be able to process both JS and TS files as well as unify format of comments which will be used across project.
from tsdoc.
What is the current thinking on this issue? I keep running into edge cases where I can express type information in a JSDoc comment (e.g. @param {someType} foo
), and using tsc's JSDoc-inJS feature, it works great for typechecking.... but JSDoc's notion of types is completely different, so I can't generate documentation for my project without jumping through hoops.
For example, tuples are easy to describe in a TypeScript type (e.g. [string, number]
, but impossible to describe in JSDoc.
I'd like to do away with JSDoc in my project, and replace it with something that was coordinated with tsc's type system.
from tsdoc.
Hey all, @sandersn will be able to help out if you have any questions about supported tags and behaviors.
from tsdoc.
Just as I pointed in #19, I think this functionality shouldn't be our primary concern. What we can do is consider whether it's viable at all and are there any considerations, just as you pointed out, but I think the main goal should be standardizing TypeScript documentation, ASAP. If so, supporting JavaScript is not fitting into that goal.
from tsdoc.
@typhonrt FYI
from tsdoc.
Related Issues (20)
- Upgrade Node.js and `node-sass` dependencies HOT 1
- Validate invalid params through tsdoc eslint plugin HOT 1
- This repo is missing important files
- Documentation coverage? HOT 1
- JSDoc/TSDoc `@inherit[dD]oc` mismatch HOT 1
- Is it dead? HOT 4
- VS Code unable to load Schema
- tsdoc-unnecessary-backslash false positive
- Weird warnings about multiple declarations HOT 1
- Grouping classes under the same index name
- Support for defining custom tag syntax HOT 1
- tsdoc-html-tag-missing-equals erroneously flagging boolean attributes
- tsdoc-malformed-html-name erroneously flagging use of less than symbol HOT 1
- Unable to load schema from 'https://json.schemastore.org/tsconfig HOT 1
- `tsdoc-reference-unquoted-identifier` is incorrectly reported for certain identifiers
- [ Question ][ Playground ] Intended Behaviour? HOT 2
- eslint-plugin-tsdoc: Missing rule to check for absence of a TSDoc comment HOT 1
- ESLint flat configurations? HOT 1
- "extends": "@rushstack/heft-node-rig/profiles/default/config/jest.config.json"
- Can inherit doc also copy the TSDoc when I hover?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsdoc.