gpt4 book ai didi

code-climate - 我可以使用自己的插件或使用 CodeClimate 在 stylelint 引擎中扩展吗

转载 作者:行者123 更新时间:2023-12-02 01:11:56 25 4
gpt4 key购买 nike

在我的 stylelintrc.js 中


模块. 导出 = {
“延伸”:[
“stylelint-配置-标准”,
“stylelint-config-css-modules”,
],
“插件”:[
“stylelint-性能动画”,
],
...

在 codeclimat.yaml 中,我打开 stylelint 引擎并在 codeclimete 上出现此错误

•• 时间:.engineConfig:0.049s错误:找不到“stylelint-config-css-modules”。您需要 configBasedir 吗?请参阅我们的文档:https://docs.codeclimate.com/docs/stylelint了解更多信息。

有人可以解释一下如何启用插件和扩展(如果可能的话)吗?

最佳答案

这是给任何从谷歌来到这里的人的答案:

奇怪的是,需要为 stylelint 提供 node_modules 文件夹的绝对路径。以下是一个可行的解决方案:

const { resolve } = require('path')

const basePath = resolve(__dirname, 'node_modules')
const groupSelectors = `${basePath}/stylelint-group-selectors`
const cssTreeValidator = `${basePath}/stylelint-csstree-validator`

module.exports = {
plugins: [groupSelectors, cssTreeValidator],
extends: [
'stylelint-config-recommended-scss',
'stylelint-config-recess-order',
'stylelint-prettier/recommended',
'stylelint-scss',
'stylelint-a11y/recommended',
],
rules: {
'no-empty-source': null,
//check and add avaialble rules here: https://github.com/kristerkari/stylelint-scss
'scss/selector-no-redundant-nesting-selector': true,
'plugin/stylelint-group-selectors': true,
'csstree/validator': true,
},
}

关于code-climate - 我可以使用自己的插件或使用 CodeClimate 在 stylelint 引擎中扩展吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43457091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com