在我的stylelintrc.js
中
module.exports = {
"extends": [
"stylelint-config-standard",
"stylelint-config-css-modules",
],
"plugins": [
"stylelint-performance-animation",
],
...
在codeclimat.yaml中我打开stylelint引擎并在codeclimete上接受此错误
••时间:.engineConfig:0.049s
错误:无法找到" stylelint-config-css-modules"。你需要configBasedir
吗?
有关详细信息,请参阅https://docs.codeclimate.com/docs/stylelint上的文档。
有人可以解释一下,如果它能够实现,插件和插件是如何扩展的?
答案 0 :(得分:0)
这是所有来自google的人的答案:
需要给style_lint足够的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,
},
}