educastellano / jsonlint-tree Goto Github PK
View Code? Open in Web Editor NEWjsonlint a directory recursively
jsonlint a directory recursively
I think It could be really useful if an exit code is added so this can be used in CI environments :)
something like exit 0 for no errors and exit 1 whenever there are some failures. This way the this could be integrated into the npm scripts of a project for example.
I did this quick hack as a poc, if you like the idea I'll be glad to submit a PR :)
...
if (passed+failed === files.length) {
...
process.exit(failed)
}
...
What do you think?
Add an option to hide files passed validation. E.g. "--quiet" option.
Statistics is not always printed in some directory layouts
A
|- B
|- file.json
Now run the tool $ jstree-json A
Files array list length is 2, Analyzed files = 1. Condition does not pass.
Line 31 in 5d4a522
Exit code does not match count of invalid files if there are more than 255 erroneous files.
Exit code should not exceed 127 on most platforms.
See https://en.wikipedia.org/wiki/Exit_status
It's better to have a fixed error exit code.
Line 36 in 5d4a522
The first line of this utility is #!/usr/local/bin/node
, a path which is empty on OSX when using Node Version Manager.
Thus, this utility when run on OSX with Node installed via NVM produces--
-bash: /Users/chris/.nvm/versions/node/v4.5.0/bin/jsonlint-tree: /usr/local/bin/node: bad interpreter: No such file or directory
A solution which would help this utility run on the most platforms would be to use this shebang instead--
#!/usr/bin/env node
I typically need this kind of tool for linting json configurations of my project. The problem is that it also lints all json files within node_modules.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.