我刚刚在我的sass-lint编辑器中安装了VS Code,并且我继续为我在*.scss
文件中设置的每个属性(行)获取此错误:
[sass-lint] Mixed tabs and spaces
VS Code中的缩进类型设置为tabs(4),使用Tabs设置为缩进。
如何禁用sass-lint的标签和空格混合?
真正的原因是:SASS Lint无法识别您的缩进设置,并且正在使用默认缩进(2个空格)。它正在寻找2个空格并找到了标签。
您可以通过删除所有缩进并阅读提示来确认它。
正如Pull#725所指出的,正确的语法是:
indentation: - 1 - size: 'tab'
我发现Sublime Text 3中的sass-lint没有加载我的配置文件。
我读完这个GitHub issue后就开始工作了:
在SublimeLinter首选项中(首选项 - >包设置 - > SublimeLinter - >设置):
"linters": {
"sass": {
"working_dir": "${/home/myusername}"
}
},
将文件.sasslintrc添加到您的主文件夹:
{
"rules": {
"indentation": [
1,
{
"size": "tab"
}
]
}
}
为了关闭这一个,我后来发现使用EditorConfig文件预先设置所有工作流程设置是最佳做法。
这是一个插件类型设置文件,可预先配置所需的设置以适合您的工作流程。
就我而言,我使用EditorConfig for VScode。将其添加到您选择的编辑器后,只需在基本(根)目录中创建一个.editorconfig文件,并使用所需的设置填充它。
例如,我的基本设置如下所示:
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = tab
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false