csshint
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -47,2 +47,14 @@ /** | ||
/** | ||
* 为 unifying-font-family-case-sensitive 做的一个文件路径缓存 | ||
* 因为在 fecs 官网上,连续验证同一个规则会有问题,例如 | ||
* body { | ||
* font-family: Arial, "Microsoft YaHei", sans-serif; | ||
* } | ||
* 然后把 Arial 改为 arial,如果不判断文件路径,那么 global.CSSHINT_FONTFAMILY_CASE_FLAG 里面会记录上首次的大写 Arial | ||
* | ||
* @type {String} | ||
*/ | ||
// var tmpFilePath = ''; | ||
/** | ||
* 检测 css 文件内容 | ||
@@ -58,2 +70,10 @@ * | ||
// if (tmpFilePath === filePath) { | ||
// global.CSSHINT_FONTFAMILY_CASE_FLAG = {}; | ||
// } | ||
// else { | ||
// tmpFilePath = filePath; | ||
// } | ||
global.CSSHINT_FONTFAMILY_CASE_FLAG = {}; | ||
// 如果 rcConfig 不存在,则用默认的配置,单独作为模块调用时用到 | ||
@@ -97,2 +117,3 @@ rcConfig = rcConfig || defaultConfig; | ||
fileContent: fileContent, | ||
filePath: filePath, | ||
maxError: maxError | ||
@@ -99,0 +120,0 @@ }) |
@@ -48,3 +48,2 @@ /** | ||
} | ||
var prop = decl.prop; | ||
@@ -51,0 +50,0 @@ var value = util.getPropertyValue(decl.value); |
@@ -29,3 +29,2 @@ /** | ||
return function (css, result) { | ||
if (!opts.ruleVal) { | ||
@@ -32,0 +31,0 @@ return; |
@@ -357,6 +357,8 @@ /** | ||
else if (/^["'][^"']*["']/.test(arr[i])) { | ||
// eval('"Microsoft Yahei",') has error | ||
temp = arr[i].replace(/,$/g, ''); | ||
part.type = 'string'; | ||
/* jshint evil: true */ | ||
/* eslint-disable fecs-no-eval, no-eval */ | ||
part.value = eval(arr[i]); | ||
part.value = eval(temp); | ||
/* eslint-enable fecs-no-eval, no-eval */ | ||
@@ -363,0 +365,0 @@ } |
{ | ||
"name": "csshint", | ||
"description": "lint your css code", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "csslint", |
@@ -817,3 +817,3 @@ /** | ||
postcss([plugin]).process(fileContent).then(function (result) { | ||
expect(2).toEqual(result.messages.length); | ||
expect(1).toEqual(result.messages.length); | ||
done(); | ||
@@ -820,0 +820,0 @@ }); |
Sorry, the diff of this file is not supported yet
398260
152
12460