Giter VIP home page Giter VIP logo

Comments (14)

bcomnes avatar bcomnes commented on May 17, 2024

For example, it would be great to have some kind of interface that lets me pass in a file or string to standard, and get back an array of error objects or something. Right now there is a runner that uses spawn: https://github.com/maxogden/standard-format/blob/master/test/standard-runner.js

from standard.

feross avatar feross commented on May 17, 2024

There is some documentation here: https://github.com/feross/standard/blob/master/index.js#L37-L47

Right now require('standard') doesn't let you test strings. Only stdin, or a list of file paths. I'd accept a PR that makes it support testing strings, though you'd need to get this working with eslint and jscs.

Also, index.js currently prints to stdout instead of returning an array of errors. We should change this to do the printing in cmd.js.

PRs welcome!

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

I'll see what I can do sometime soon.

from standard.

feross avatar feross commented on May 17, 2024

If you get this done in the next day or two, we can include this in the v3.0.0 release.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

I'm going to try and look at it in the morning tomorrow. Don't wait around for me though ;)

Bret Comnes
http://bret.io
Sent from my mobile

On Mar 11, 2015, at 8:41 PM, Feross Aboukhadijeh [email protected] wrote:

If you get this done in the next day or two, we can include this in the v3.0.0 release.


Reply to this email directly or view it on GitHub.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

I have checking of strings working in jscs here: https://github.com/bcomnes/standard/blob/dev/lib/checkString.js Ill try for eslint tomorrow.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

Arg... getting distracted over here. I think im going to finish up https://github.com/bcomnes/sublime-standard-format before I can get to this issue so please dont wait for me.

from standard.

feross avatar feross commented on May 17, 2024

This is done! But it's currently on the speed branch. We'll merge into master soon, but feel free to give it a try now and confirm that it works for your purposes 👍

standard now exports two functions: lintText and lintFiles. They are documented inline in the source.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

Thanks maaan! Sorry I couldn't pull through on this. Will help with writing standard-format tests.

from standard.

feross avatar feross commented on May 17, 2024

No problem 👍

from standard.

feross avatar feross commented on May 17, 2024

Let's leave this open until speed is merged into master.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

Oh derp. Good point

from standard.

feross avatar feross commented on May 17, 2024

This is released as 3.3.0.

from standard.

bcomnes avatar bcomnes commented on May 17, 2024

Boo ya!

from standard.

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.