So Prettier is behaving quite weirdly for me. I have this simplified interface in a language called solidity:
interface Token {
function getTotalSupply(address _market, TokenType _tokenType) external view returns (uint256);
function mint(address _to, uint256 _amount, TokenType _tokenType) external;
}
After formatting it gets formatted to this:
interface Token {
function getTotalSupply(address _market, TokenType _tokenType) external view returns (uint256);
function mint(
address _to,
uint256 _amount,
TokenType _tokenType
) external;
}
I want both functions to stay on one line. The printWidth option does not seem to be the issue here, as the first function is actually longer than the second one and does not line break. The difference seems to be that the second function has more arguments and that every function with more than 2 arguments gets split up. Here is my .prettierrc
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 160,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
]
}
How can I fix this?
question from:https://stackoverflow.com/questions/65876455/weird-behaviour-with-prettier-in-vs-code