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

ESLint plugin/rule #323

Open
webberwang opened this issue Aug 12, 2020 · 5 comments
Open

ESLint plugin/rule #323

webberwang opened this issue Aug 12, 2020 · 5 comments

Comments

@webberwang
Copy link

Is there a possibility to make this package an ESLint plugin or rule?

@tclindner
Copy link
Owner

Hey @webberwang I don't think so unfortunately. Eslint doesn't support AST for JSON. Do you have any ideas for that?

@scinos
Copy link

scinos commented Feb 17, 2021

https://github.com/leo-buneev/eslint-plugin-md solves this by having its own parser (https://www.npmjs.com/package/markdown-eslint-parser) that generates an "empty" AST to fool eslint, but adds an extra property with the content of the Markdown file.

Then they have a rule (https://github.com/leo-buneev/eslint-plugin-md/blob/master/lib/rules/remark.js#L82), that reads that content from the "fake" AST, and calls remark to do the actual linting.

I think a similar system could work? I'll experiment with that idea and raise a PR if it ends up working.

@einSelbst
Copy link

einSelbst commented May 12, 2021

I don't know anything about it but I had read something about eslint & AST and how to extend it in the typescript-eslint repo

@budiirawan-pp
Copy link

budiirawan-pp commented May 8, 2023

Hey @webberwang I don't think so unfortunately. Eslint doesn't support AST for JSON. Do you have any ideas for that?

Hey, first time here, thank you for creating this project! ❤️

I found this JSON parser that supports AST https://github.com/ota-meshi/jsonc-eslint-parser. It might be awesome if we could integrate the rules into ESLint.

@JoshuaKGoldberg
Copy link

FWIW I'm a maintainer on https://github.com/JoshuaKGoldberg/eslint-plugin-package-json now and would love to unify these tools. It's been a consistent user pain with devs I've talked to how there are so many different tools for linting various areas of code. Getting to unify within ESLint (especially considering eslint/eslint#16557) would be very nice.

@tclindner I couldn't find an email / other contact for you online, but I'd love to chat!

Tracking refs on my end: JoshuaKGoldberg/eslint-plugin-package-json#28 -> JoshuaKGoldberg/create-typescript-app#839

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

No branches or pull requests

6 participants