Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

javascript - 漂亮和EsLint选项卡问题-Vue中的curiouse登录(Prettier and EsLint Tab Problem - curiouse sign in Vue)

I have a little problem with Prettier my code in .vue.(我在.vue中的代码更漂亮时有一些问题。)

From some time, when I save my files I get problem like this:(从某些时候开始,当我保存文件时,会出现如下问题:)

Code and problems screenshot(代码和问题截图)

This is my .prettierrc.js file:(这是我的.prettierrc.js文件:)

module.exports = {
  bracketSpacing: true,
  trailingComma: "es5",
  tabWidth: 2,
  semi: false,
  singleQuote: false,
}
  ask by kuba1pie translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Somehow prettier is using tabs to format your code, this is not happening frequently?(更漂亮的方式是使用制表符来格式化代码,这种情况不会经常发生吗?)

It looks you have an eslint or some sort of linting rule running in vscode that is expecting the format to use spaces and not tabs.(看来您在vscode中运行了一种eslint或某种linting规则,期望该格式使用空格而不是制表符。)

Are you sure you don't have any other prettier configuration with useTabs prettier flag set to true?(您确定没有其他将useTabs漂亮标志设置为true的漂亮配置吗?)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...