vue3 + vite 项目中,使用 Stylelint 检查和格式化 css、less、scss 代码格式,遇到这个报错:Stylelint: Expected list.nth instead of nth (scss/no-global-function-names)。

在这个 @for 循环中使用了 sass 内置的 nth 函数,被 Stylelint 工具检查报错。
有两种方法能使 Stylelint 不标红报错。
.stylelintrc 配置文件中配置忽略规则scss 文件中加载使用 list 模块,以 list.nth 的形式使用 nth 函数。(推荐)欢迎访问:天问博客