Giter Club home page Giter Club logo

Comments (4)

samhh avatar samhh commented on May 23, 2024 1

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.

gillchristian avatar gillchristian commented on May 23, 2024

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.

samhh avatar samhh commented on May 23, 2024

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.

gillchristian avatar gillchristian commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.