Closed vmaark closed 1 year ago
This is not an issue with the template itself. You can refer to the Formatter section of the "Integrating with Foundry" guide of the Foundry Book for how to configure VSCode to not run Prettier on Solidity files. In short, you have to add this to your VSCode settings:
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.vscode-solidity"
},
That may be true, but it would still be better not to use different values for tabwidth.
This is a good point! Let me think about it - really the only reason for keeping 2 spaces for tab width is formatting for JSON files. I might just add an override for *.json
and set the default to 4.
I ended up doing something else - I have kept the default tabWidth
to 2 but I have also added an override for Solidity to use 4, like this:
overrides:
- files: ["*.sol"]
options:
tabWidth: 4
Otherwise, I would have had to add quite a few overrides:
- files: ["*.json", "*.md", "*.yml"]
Even if Prettier is not run over Solidity files, this should make the template more robust for end users, since it will prevent accidental re-formatting when the VSCode settings are not configured on a per-language basis.
Thanks for opening this issue, @vmaark.
tab size is configured differently for
sol
in the 2 tools, causing the linter to fail, if prettier was used for formatting. editorconfig also sets indent size to 2.