万能大法
javascript
// eslint加入配置
indent: 0
一:冲突一
三元运算符Prettier的格式化

三元运算符Eslint的格式要求

解决办法
javascript
// eslint加入配置,屏蔽标红报错
indent: ['error', 2, { ignoredNodes: ['ConditionalExpression'] }]
效果

二:冲突二
表现

解决办法
javascript
// eslint加入配置,屏蔽标红报错(需要关闭vscode标红才会去掉,或者手动,将error改为0再改回error)
indent: ['error', 2, { offsetTernaryExpressions: true }]
效果
