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

Idea: Support comments and whitespace #53

Open
colelawrence opened this issue May 12, 2021 · 2 comments
Open

Idea: Support comments and whitespace #53

colelawrence opened this issue May 12, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@colelawrence
Copy link

I'm not sure how hard it would be, but I have a use case to use this package as a tool for rewriting TOML files without affecting style and whitespaces. So, the first idea that I had would be to write a function which can take the toml eslint AST and generate the TOML source.

I'm not so sure how far away an idea like this is, but I feel like it's a small change to at the least maintain newlines and comments.

I'm not entirely sure, but I thought I'd throw this idea in here.

Cheers

– Cole

@ota-meshi
Copy link
Owner

Thank you for posting this issue.

For now, whitespaces information is not stored on the node as it is intended for use with the ESLint plugin.
However, all comment information is stored in the root node.

image

I don't know how your tool works, but could you open the PR if you have the information you need? Or could you write the details of the information you need here and wait for someone to work on it?
If that doesn't break the ESLint plugin, I'll probably accept the change.

@colelawrence
Copy link
Author

Thanks for the response. I'll take a closer look and post back with further info.

@ota-meshi ota-meshi added enhancement New feature or request help wanted Extra attention is needed labels Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants