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

Not converting tabs to spaces #165

Closed
jahvi opened this issue Feb 22, 2021 · 2 comments
Closed

Not converting tabs to spaces #165

jahvi opened this issue Feb 22, 2021 · 2 comments

Comments

@jahvi
Copy link

jahvi commented Feb 22, 2021

For some reason the module is not converting tabs to spaces when using the useTabs: false option, it does work the other way though (spaces to tabs work ok).

Input (it's hard to see but indentation is using tabs)

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<acl>
		<resources/>
	</acl>
</config>

Expected Result (spaces instead of tabs)

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <acl>
        <resources />
    </acl>
</config>

Actual Result (still tabs)

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<acl>
		<resources />
	</acl>
</config>

.prettierrc

{
    "printWidth": 120,
    "tabWidth": 4,
    "useTabs": false,
    "singleQuote": true
}
@kddnewton
Copy link
Member

If you set xmlWhitespaceSensitivity to "ignore" what happens? It looks like you're running with the default configuration which is that XML nodes are all whitespace sensitive.

@jahvi
Copy link
Author

jahvi commented Feb 22, 2021

Thanks that does fix the issue.

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

2 participants