1
I am creating an application using Vscode as IDE and, to do the lint of the code, I’m using the Eslint and the GTS (Google Typescript Style) where in a code location I have something similar to that:
const sampleTernaryResult = 2 + 2 === 4
? "it's not an even number"
: "não é um numero impar";
In the Eslint file, I set it so that it always puts the ternary as multi-line, like this:
{
"extends": "./node_modules/gts/",
"rules": {
"@typescript-eslint/no-explicit-any": 0,
"max-len": ["warn", {"code": 160}],
"multiline-ternary": ["error", "always"]
}
}
When saving the file Eslint does the formatting for the multiline ternary. In doing so, Prettier detects that it is incorrect and if I save it again it returns the ternary to a single line. What do I need to do to make Prettier not make this fix? Is there a setting to make Prettier ignore this?
I wanted to use Gts (Google Typescript Style) and he himself uses prettier. After all I reset my project and put the "standard-with-typescript" preset that solved my problem.
– LeandroLuk