Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lesslint

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lesslint - npm Package Compare versions

Comparing version 0.1.14 to 0.1.15

9

lib/rule/block-indent.js

@@ -43,2 +43,5 @@ /**

var lineContent = util.getLineContent(lineNum, me.fileData, true);
// 不去掉开头空格的 lineContent,目的是和 lineContent 的长度做比较,算出 lineContent 的缩进
var lineContent1 = util.getLineContent(lineNum, me.fileData);
var spacesNum = selector.selectorLevel * 4;

@@ -59,2 +62,3 @@ var reg;

line: lineNum,
col: lineContent.length - lineContent1.length + 1,
message: '`'

@@ -92,2 +96,6 @@ + lineContent

var lineContent = util.getLineContent(lineNum, me.fileData, true);
// 不去掉开头空格的 lineContent,目的是和 lineContent 的长度做比较,算出 lineContent 的缩进
var lineContent1 = util.getLineContent(lineNum, me.fileData);
var spacesNum;

@@ -114,2 +122,3 @@ if (realVal.selectors) {

line: lineNum,
col: lineContent.length - lineContent1.length + 1,
message: '`'

@@ -116,0 +125,0 @@ + lineContent

48

lib/rule/require-before-space.js

@@ -35,3 +35,3 @@ /**

lastLineNumCache = -1;
// lastLineNumCache = -1;

@@ -42,27 +42,25 @@ selectors.forEach(

var curLineNum = util.getLine(elem.index, fileData);
var lineContent = util.getLineContent(curLineNum, fileData);
if (lastLineNumCache !== curLineNum) {
lastLineNumCache = curLineNum;
// if (!/^[^\{]+(\s)\{$/g.test(lineContent)) {
if (/^([^\{]*)[^\s]\{$/g.test(lineContent)) {
me.invalidList.push({
uniqueFlag: ruleName + curLineNum,
ruleName: ruleName,
line: curLineNum,
message: '`'
+ lineContent
+ '` '
+ msg,
colorMessage: '`'
+ lineContent.replace(
'{',
chalk.magenta('{')
)
+ '` '
+ chalk.grey(msg)
});
}
var lineContent = util.getLineContent(curLineNum, fileData, true);
var match = lineContent.match(/[^\{]*[^\s](\{)$/);
if (match) {
var inputStr = match[0];
var matchStr = match[1];
me.invalidList.push({
uniqueFlag: ruleName + curLineNum + inputStr + matchStr,
ruleName: ruleName,
line: curLineNum,
col: lineContent.indexOf(matchStr) + 1,
message: '`'
+ lineContent
+ '` '
+ msg,
colorMessage: '`'
+ lineContent.replace(
'{',
chalk.magenta('{')
)
+ '` '
+ chalk.grey(msg)
});
}
});

@@ -69,0 +67,0 @@ }

{
"name": "lesslint",
"description": "lint your less code",
"version": "0.1.14",
"version": "0.1.15",
"maintainers": [

@@ -6,0 +6,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc