Skip to content
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

Tooling: consider switching to jsonc-eslint-parser #43

Closed
JoshuaKGoldberg opened this issue Sep 20, 2023 · 2 comments · Fixed by #40
Closed

Tooling: consider switching to jsonc-eslint-parser #43

JoshuaKGoldberg opened this issue Sep 20, 2023 · 2 comments · Fixed by #40

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Sep 20, 2023

@ota-meshi's https://github.com/ota-meshi/jsonc-eslint-parser looks excellent: well-documented, well-tested, and well-used by https://www.npmjs.com/package/eslint-plugin-jsonc.

I imagine this might unblock #40? At the very least, I like the idea of using the standard community method for working with JSON.

@ota-meshi
Copy link
Contributor

Hi, @JoshuaKGoldberg!
This may be off-topic, but please let me comment.
I have a plugin that only checks dependencies in package.json.
https://github.com/ota-meshi/eslint-plugin-node-dependencies
When using jsonc-eslint-parser, that plugin's rules can be used together.
However, in that case those rules check package.json, so I would like the rules for eslint-plugin-node-dependencies to be merged into eslint-plugin-package-json if possible.
What do you think?

@JoshuaKGoldberg
Copy link
Owner Author

JoshuaKGoldberg commented Sep 20, 2023

Yes, definitely - thanks for surfacing! That would be great. I hadn't seen eslint-plugin-node-dependencies but it has quite a few rules that look very good to have. Added it to the table in #42.

I'll take this as general confirmation that jsonc-eslint-parser is a good step forward for this package 🙂. Will try to get a draft PR up soon.

Edit: rolled into #40 👍

JoshuaKGoldberg added a commit that referenced this issue Oct 17, 2023
Fixes #39; fixes #43.

Moves to the external `jsonc-eslint-parser` because:

* #43: it's a good ecosystem standard
* ESLint's RuleTester doesn't support this usage of processors
(#40 (comment))

Also removes the `disparity` dependency, in favor of directly telling
users to run the auto-fixer. This is the strategy other plugins such as
[`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort)
take. It's simpler to implement, makes for easier-to-read error
messages, and reduces the size of `node_modules`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants