-
Notifications
You must be signed in to change notification settings - Fork 612
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
[api-extractor] Rename .api.ts to .api.md to prevent TypeScript tools from processing it #1123
Comments
Sounds related to this discussion: #1114 There we were talking about whether the On the other hand, if you think a couple code comments would clear things up, that seems like a reasonable solution, too. |
I think there should be a "This is a generated file" comment at the top of the files. It's a pretty standard practice for generated files. |
Sounds like a reasonable feature. |
We had to add to tslint.json
And to root .prettierignore
Apparently, there is no way to ignore the whole file in prettier by the comment. Not a big problem, but the different extension for API files would simplify setup for new users. |
Anyone have objections to changing the file extension to |
BTW I chatted some with @iclanton about this. We had some reservations about introducing a new file extension that is completely proprietary to API Extractor and has a fairly vague spec about the format of its content. In VS Code, I was able to restore syntax highlighting by adding this my settings.json: "files.associations": {
"*.tsapi": "typescript"
} But that causes VS Code to perform semantic analysis and add a ton of red underlines everywhere. We discussed two alternative approaches:
|
@daspek do you have an opinion on this one? :D Ian thought 1 is a more ideal solution, but 2 is simpler. A third opinion would be helpful. |
After a bunch of debate, the winning vote was for |
Implemented in PR #1150 |
Prettier definitely attacks ```ts blocks. |
Is it easy to configure it to ignore the .api.md file extension? |
Eeeh... probably easy enough for anyone using api extractor. {
"overrides": [
{
"files": "*.api.md",
"options": {
"requirePragma": true
}
}
]
} which would mean the file won't get formatted as it doesn't have a But, alternatively, you could put Or Oops, totally didn't see @vdanchenkov's comment, sorry. |
I feel like configuring Prettier to ignore |
Totally my opinion as well, should just be a note in the docs, as in many cases people just don't have a |
Good point. I'll make a note to include that in the docs. The web site content will continue to refer to AE6 until we finally remove the "beta" tag for AE7. We're so close... just a few more PRs heheh. |
This was published as API Extractor beta release 7.0.27 |
Hi,
Love the API extractor. Looks like a very powerful tool.
It would be great if we could add a big comment on top of the file "this file is generated, don't change it manually". Others might want to add "/* tslint:disable */" to it as well.
How do we get around doing this in our api.ts review files?
Thanks and great work!
Jakob
The text was updated successfully, but these errors were encountered: