-
Notifications
You must be signed in to change notification settings - Fork 28
Major refactor of plugin and support of rules selection #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
maybe could go further deleting the potentialy unessary anti duplicate mecanism
|
@AdrieanKhisbe thanks for the PR! Due to the size of the PR and some time constraints, it will take me couple of weeks to go through this PR. Hopefully that's okay for you. If everything looks good, would you be interested in maintaining (or helping maintain) this project as well? |
|
Your welcome @azeemba ! :) No hurry! Take the time needed :) (And yes, might be interested into giving a hand to main it) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks again for your PR!
I have added a suggestion for the integration test and also a question about how "allowComments" is configured right now.
Do you think you can also update the README.md with the information of the rules/config options that are supported?
Since the changes here are significant, I will make a new major release once we land this changeset.
example/samples/jsonc.json
Outdated
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "hello": "world" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file have comments?
| "hello": "world" | |
| "hello": "world" // this is a comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, that's the point. (jsonc for json comment, as it's used by some.
I can rename it to make it more clear if you want :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed a comment was missing 🤦♂
example/.eslintrc
Outdated
| { | ||
| "files": ["samples/jsonc.json"], | ||
| "rules": { | ||
| "json/json": ["warn", {"allowComments": true}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding a comment in jsonc.json, I had to make this change as well for comments to be allowed.
| "json/json": ["warn", {"allowComments": true}] | |
| "json/*": ["warn", {"allowComments": true}] |
Is it possible for the allow-comments to be just another rule though? Instead of an option on the base rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be specificaly set with json/comment-not-permitted.
By default, json/json (and it's alias json/*), activate this rules (as comments are not part of the json spec). the option allowComments allow user to activate everything but this rule.
But it's strange you had to made the change since json/json and json/* are supposed to be the same
I'm going to try to replicate
|
Sure I'll update the README accordingly :) |
c4532f9 to
bd7e35a
Compare
|
@azeemba I took care of the first adjustments, I'll update the documentation as soon as possible. :) |
|
@azeemba I updated the documentation. Tell me if it suits you :) Here is some things I'd like to do If you agree,
|
|
All those suggestions sound great! I think having integration tests like you have provided are super valuable but I think there is some bug in the script at the moment. Currently If its okay with you, I would like to add a commit to switch the integration test script to be in JS so the tests can be more structured. |
This allows us to do more clear checks on the errors returned from eslint. The sample projects eslintrc is also updated to "allowComments"
|
Let me know if you have any concerns with the switch in the integration tests! |
|
No problem @azeemba ! :) Will then do the suggestions you accepted, Will have a look of github actions. Sounds promising but haven't try it for now. This could be the opportunity :) |
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
=======================================
Coverage ? 100%
=======================================
Files ? 1
Lines ? 50
Branches ? 0
=======================================
Hits ? 50
Misses ? 0
Partials ? 0
Continue to review full report at Codecov.
|
|
Hey @azeemba :) We might be good to go :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your contributions!
Since you have merge privileges now, I will let you merge the PR. I will push out a new major release after that!
|
And here it is then :) |
Hello @azeemba :)
First thanks of all for this useful plugin!
Here is roughly what PR consist in:
json/the-error-code-in-kebab-caseBuilds of branch can be seen on travis, and library is available for test on npm under
eslint-plugin-json-betaas[email protected]Documentation needs to be updated, which I will do after the first feedbacks :)