Comments (22)
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.
+1
from semistandard.
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.
Yes! Please do! PR to add flag will be accepted here too and collab added if you're so inclined!
from semistandard.
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.
We can just write a brand new cmd.js here and add the format flag.
from semistandard.
Sounds good, I can do the PR with the brand new cmd.js
from semistandard.
Sweet! Thanks sorry not sure why this got closed :)
from semistandard.
Cool :)
from semistandard.
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.
Hmm, have code somewhere?
from semistandard.
No, I will commit to my fork so you can see, in a sec.
from semistandard.
Take a look.
from semistandard.
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.
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.
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.
So we just need to change the expected output from 2 to 42? Does this affect anything ?
from semistandard.
yep! For now just change line 9 of api.js
t.equal(result.errorCount, 42, 'error count 42')
from semistandard.
Tests passed, thank you 😄, going to submit a PR now.
from semistandard.
Published as 4.2.0
. Thanks for contributing!
from semistandard.
@Flet cool 👍 !
So I hope it can be to reflected at Flet/SublimeLinter-contrib-semistandard#2 too.
from semistandard.
Ah yeah I think StandardFormat on package control will work, but I'll confirm and update that issue.
from semistandard.
Related Issues (20)
- Cannot use semistandard because of missing dependencies HOT 4
- development halted? HOT 3
- Semistandard 12.0.0 globals exclude doesn't work HOT 5
- Expected to call super on super.apply HOT 1
- Cannot read property 'ecmaFeatures' of undefined HOT 1
- Parsing error: Cannot find module '@babel/types' HOT 2
- RegExp invalid group error on named group HOT 2
- Travis CI failing with Node 6 and v13.0 HOT 6
- WebStorm (and JetBrains IDEs) HOT 1
- Add me as a collaborator? HOT 6
- Cannot find module '@typescript-eslint/parser' HOT 5
- Is this repository still maintained? HOT 1
- Badge link doesn't work HOT 1
- Semistandard broken on OS X starting in 14.2.1 HOT 4
- Exclude history from published package HOT 2
- Update standard to version 16.0.3 that disables the rule `Enforce default parameters to be last (default-param-last)` HOT 3
- Replace Travis CI with GitHub Actions HOT 1
- Usage of ESM imports instead of CommonJS
- Move semsistandard to standard HOT 2
- Parsing error for static class variables HOT 1
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 semistandard.