Giter Site home page Giter Site logo

Comments (6)

davidtheclark avatar davidtheclark commented on May 31, 2024 2

I imagine this as a separate project. I think it makes sense to keep cosmiconfig strictly focused on loading and parsing. What you do with the parsed config is not cosmiconfig's concern.

It would definitely be cool to have another library shared by open source projects that validates the parsed config, so each project doesn't have to implement that on its own! It might be pretty hard, though, to make something generic that will meet the different validation needs of different projects. Fun problem.

from cosmiconfig.

sudo-suhas avatar sudo-suhas commented on May 31, 2024

Hey @aladdin-add, could you elaborate your use-case? What would be the advantage of adding this functionality to cosmiconfig instead of letting the client implement it themselves? If the client were to implement it, they would have the freedom to choose the validation library of their choice. Another option would be to implement a external wrapper module which would use the transform hook to perform the validation.

from cosmiconfig.

aladdin-add avatar aladdin-add commented on May 31, 2024

thanks for the quick response!

I'm considering using cosmiconfig in eslint (eslint/eslint#9637). config validation is so common, so I think providing an optional implement but can be customized can be handy for users, and no harm to flexibility. you recon?

from cosmiconfig.

sudo-suhas avatar sudo-suhas commented on May 31, 2024

@davidtheclark, @azz, @okonet Do you mind sharing your opinion on this?

from cosmiconfig.

azz avatar azz commented on May 31, 2024

There's already at least two really good libs for this that I'm aware of:

from cosmiconfig.

sudo-suhas avatar sudo-suhas commented on May 31, 2024

Based on feedback, we won't be developing this feature in cosmiconfig. Closing the issue for now.

from cosmiconfig.

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.