Open webberwang opened 4 years ago
Hey @webberwang I don't think so unfortunately. Eslint doesn't support AST for JSON. Do you have any ideas for that?
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.
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
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.
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 https://github.com/eslint/eslint/discussions/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: https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/28 -> https://github.com/JoshuaKGoldberg/create-typescript-app/issues/839
Is there a possibility to make this package an ESLint plugin or rule?