如何在PhpStorm中设置代码在4个空格中的缩进?
在我的PhpStorm 2019.2.5 with vue项目中,如何在4个空格中设置代码缩进(不带制表符)? 我在settings=>Edito=>Copyright=>Formatting=>Vue中有默认设置 和.eslintrc.js:如何在PhpStorm中设置代码在4个空格中的缩进?,phpstorm,Phpstorm,在我的PhpStorm 2019.2.5 with vue项目中,如何在4个空格中设置代码缩进(不带制表符)? 我在settings=>Edito=>Copyright=>Formatting=>Vue中有默认设置 和.eslintrc.js: module.exports = { root: true, env: { node: true }, extends: [ 'plugin:vue/vue3-essential', '@vue/standard'
module.exports = {
root: true,
env: {
node: true
},
extends: [
'plugin:vue/vue3-essential',
'@vue/standard'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'semi': 'off',
'promise/param-names': 'off',
'dot-notation': 'off',
'no-trailing-spaces': 'off',
'prefer-const': 'off',
'space-before-function-paren': 'off',
'space-in-parens': 'off',
'no-unused-vars': 'off',
'comma-dangle': 'off',
'object-curly-spacing': 'off',
'vue/no-unused-components': 'off',
'indent': 'off'
}
}
此选项也必须在中使用
Code=>Reformat Code
?
谢谢 你能澄清一下你提到的选项吗?PhpStorm 2019.2.5中没有Vue的代码样式设置(它使用HTML代码样式首选项设置Vue模板格式),设置中也没有编辑器|版权|格式页面…我指的是此选项。我描述的路径无效吗?这些设置只影响copywrite注释格式。。。您想格式化您的Vue模板,对吗?看起来这是“我的设置”下唯一的Vue项?我需要额外激活一些选项吗?正如我在上面所写的,PhpStorm 2019.2.5中没有Vue的代码样式设置,它使用HTML代码样式首选项(设置|编辑器|代码样式| HTML)对Vue模板进行格式化。Vue代码样式设置的专用部分自2020.2版起提供,请参阅