Comments (4)
Ideally I'd be able to granularly ignore on a line-by-line basis a la eslint-disable[-next]-line
as I have a few exports that don't need examples e.g. newtypes. I'd suggest that's the best place to start as that's the most flexible approach. Something like docs-ts-ignore-next-export example, version
.
Certainly file-level directives would be nice as well a la eslint-disable
.
I've mentioned ESLint a lot as it's what I use most regularly. Not sure how other ecosystems handle this.
from docs-ts.
In an ideal world docs-ts would allow you to specify exclusions or otherwise ignore certain files or pieces of code.
How do you think this discriminated enforce could be implemented? And allow/exclude list of globs? Or a directive per export?
There's @ignore
, for specific exports. But that ignores the whole thing not just the required example.
The index
example from fp-ts you mentioned could be handle by ignoring the file directly. But again, that ignores the whole thing.
One thing I should ask is, is the complexity this would introduce worth the control we gain?
from docs-ts.
For the reasons I've posed I believe it would be, else the enforcement isn't practicable. It's the same reason linters et al always have opt-out directives.
As for implementation, as an end user, I don't really mind.
from docs-ts.
It's the same reason linters et al always have opt-out directives.
Makes sense!
As for implementation, as an end user, I don't really mind.
Sorry, I explained my self poorly. I didn't mean the internal implementation of the feature but what do you suggest in terms of how to opt-out of the enforced examples.
I think it could be inline directives to opt-out of the enforced examples for specific imports or a list in the configuration to enforce/opt-out on files.
We might want to do both, or at least a directive that allows opt-out for a whole file. Otherwise the index
example you mentioned would require every single export to have the opt-out directive.
from docs-ts.
Related Issues (20)
- [discussion] Why use ts-morph over tsc? HOT 3
- Error when compiling docs HOT 2
- `@types/node` is needed HOT 2
- Horizontal scrolling in rendered code blocks HOT 4
- @example imports still buggy HOT 1
- Incorrect return type for `toNullable` and `toUndefined` HOT 1
- "Missing examples" when examples are enforced in fp-ts-std HOT 10
- View rendered docs locally HOT 4
- Omit `.ts` in sidebar HOT 2
- Can't ignore private methods from being generated HOT 1
- Modules with only exports from other modules result in empty ToC
- Feature request: Forward options to ts-morph
- ts-morph needs updating
- tsx support
- "Why" section of the readme seems incomplete HOT 1
- Consider migrating to vitepress
- Bug: getter documentation is skipped
- Document how to make use of & debug the example type checking? HOT 2
- Prettier as peer dependency prevents upgrading it in consumers projects HOT 2
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 docs-ts.