Giter VIP home page Giter VIP logo

Comments (22)

Flet avatar Flet commented on July 28, 2024

Cool, will get something going in the next few days.
Its been requested here too:
Flet/SublimeLinter-contrib-semistandard#2

a quick workaround is to use https://github.com/maxogden/standard-format and add semicolons...

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

+1

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

I did a fork(it's published as well) of maxodgen standard-format with the semicolons, I was about to add a issue to add support to --format, what a coincidence 😄

from semistandard.

Flet avatar Flet commented on July 28, 2024

Yes! Please do! PR to add flag will be accepted here too and collab added if you're so inclined!

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

But from what I understand to add --format support it should be on standard-engine, or can I extend it on cmd.js ?

from semistandard.

Flet avatar Flet commented on July 28, 2024

We can just write a brand new cmd.js here and add the format flag.

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

Sounds good, I can do the PR with the brand new cmd.js

from semistandard.

Flet avatar Flet commented on July 28, 2024

Sweet! Thanks sorry not sure why this got closed :)

from semistandard.

gsklee avatar gsklee commented on July 28, 2024

Cool :)

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

I did a new cmd.js, but the tests are failing:

⨯ api usage
  not ok 3 error count 2
    ---
      operator: equal
      expected: 2
      actual:   42
      at: zalgoSafe (/Users/rbarros/Desktop/github/semistandard/node_modules/standard-engine/node_modules/dezalgo/dezalgo.js:20:10)
    ...
# clone repos from github
Cloning into '/Users/rbarros/Desktop/github/semistandard/tmp/cursorfun'...
Cloning into '/Users/rbarros/Desktop/github/semistandard/tmp/scenevr'...
✓ clone repos from githubros/Desktop/github/semistandard/tmp/acetate'...
✓ lint repos
# tests 10
# pass  9
⨯ fail  1

Something related to the zalgo protection you have on standard-engine? Now I'm going to ask again shouldn't we tackle this issue in standard-engine ? adding a new arg to options to pass a formatter.

from semistandard.

Flet avatar Flet commented on July 28, 2024

Hmm, have code somewhere?

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

No, I will commit to my fork so you can see, in a sec.

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

Take a look.

from semistandard.

Flet avatar Flet commented on July 28, 2024

Regarding standard-engine, sure we can add it to the cmd.js there, but it should not necessary to accomplish this for semistandard.

If we want to change standard-engine to take a formatter things start to get weird/complicated. Right now the only input required for is a plain old config object. We would have to also pass it a formatter and possibly set some kind of api that all formatters would be required to follow and possibly field other ways to call a formatter. This additional complexity is not worth it right now in my opinion.

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

I do agree with you that it may bring some unnecessary complexity to standard-engine, but only if we get too picky on what kind api the formatters must have so standard-engine understand it.

But the API of the maxodgen/standard-formatter is pretty simple and straightforward, 2 methods .load(opts, cb) and .transform(file), in which the standard-engine only will be using transform, so for compatibility of the formatter API we should only check for 1 method. Seems pretty simple, I dunno that is my opinion. I just don't understand how to solve that error without messing with the tests case 😭

from semistandard.

Flet avatar Flet commented on July 28, 2024

OK, so part of this was me getting cheeky with the api.js test. What its doing is testing bin/cmd.js, which before only had two lines (and is in standard format). So, its expecting 2 "missing semicolon" errors, but its getting 42 of them now since the file is now a lot larger :)

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

So we just need to change the expected output from 2 to 42? Does this affect anything ?

from semistandard.

Flet avatar Flet commented on July 28, 2024

yep! For now just change line 9 of api.js

t.equal(result.errorCount, 42, 'error count 42')

from semistandard.

ricardofbarros avatar ricardofbarros commented on July 28, 2024

Tests passed, thank you 😄, going to submit a PR now.

from semistandard.

Flet avatar Flet commented on July 28, 2024

Published as 4.2.0. Thanks for contributing!

from semistandard.

joseluisq avatar joseluisq commented on July 28, 2024

@Flet cool 👍 !
So I hope it can be to reflected at Flet/SublimeLinter-contrib-semistandard#2 too.

from semistandard.

Flet avatar Flet commented on July 28, 2024

Ah yeah I think StandardFormat on package control will work, but I'll confirm and update that issue.

from semistandard.

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.