- 解决stylelint Unexpected unknown t
- stylelint检查报错:Unexpected missing
- prettier+eslint+git hooks (husky
- thinkphp6:unexpected 'List' (T_L
- 解决syntax error near unexpected t
- Who Moved My Cheese 2
- 微信小程序微信小程序 Unexpected end of JSO
- 在webpack中使用stylelint(一) Quick St
- A busy, but nice, work day trip
- There was an unexpected error (t
当我们的项目配置 stylelint 后如果想要对自定义标签定义样式,就会出现 Unexpected unknown type selector "xxx"
这样的报错,这是因为 stylelint 不允许我们为规则内未知的标签定义样式。需要修改 stylelint 配置文件 stylelint.config.js 来兼容其他标签。
修改示例:
'selector-type-no-unknown': [true, {
'ignoreTypes': [
'/^page/'
]
}],
可以在 ignoreTypes 配置中添加我们想要兼容的标签,stylelint 允许我们添加字符串、stylelint 官方忽略规则以及正则表达式。
网友评论