重现该问题的步骤:
$ yarn create nuxt-app nuxt-project1
$ cd nuxt-project1
$ yarn dev
这是错误:
在配置中找不到规则。您提供了“规则”属性吗?
答案 0 :(得分:2)
您需要向function createLazyRuleEvaluator(rulesEngine, settings) {
const dummyObj = Object.freeze({});
Object.preventExtensions(dummyObj);
const valueCache = new Map();
const handlers = {
get(baseValue, prop, target) {
if (valueCache.has(prop))
return valueCache.get(prop);
const value = rulesEngine.resolveValue(settings, prop);
valueCache.set(prop, value);
return value;
},
getOwnPropertyDescriptor(baseValue, prop) {
return !propIsInSettings(prop, settings) ? undefined : {
configurable: false,
enumerable: true,
get() {
return handlers.get(baseValue, prop, null);
}
};
},
};
return new Proxy(dummyObj, handlers);
}
// This throws
Object.getOwnPropertyDescriptor(createLazyRuleEvaluator(/*...*/), 'foo');
文件中添加一些规则
例如:取自https://stylelint.io/user-guide/configuration网站
stylelint.config.js
答案 1 :(得分:0)
我解决了向rules
添加styleling.config.js
属性的问题。
之前
之后
module.exports = {
// add your custom config here
// https://stylelint.io/user-guide/configuration
rules: {},
};