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

lesshint

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lesshint - npm Package Compare versions

Comparing version 0.7.0-beta to 0.7.0-beta2

10

lib/lesshint.js

@@ -62,3 +62,11 @@ 'use strict';

Lesshint.prototype.checkString = function (input, checkPath) {
return linter.lint(input, checkPath, this.config);
var result;
try {
result = linter.lint(input, checkPath, this.config);
} catch (e) {
result = [];
}
return result;
};

@@ -65,0 +73,0 @@

4

lib/linters/hex_notation.js

@@ -29,3 +29,3 @@ 'use strict';

case 'lowercase':
if (!/^#[0-9a-f]+$/.test(color)) {
if (!/^#[0-9a-z]+$/.test(color)) {
message = color + ' should be written in lowercase.';

@@ -36,3 +36,3 @@ }

case 'uppercase':
if (!/^#[0-9A-F]+$/.test(color)) {
if (!/^#[0-9A-Z]+$/.test(color)) {
message = color + ' should be written in uppercase.';

@@ -39,0 +39,0 @@ }

{
"name": "lesshint",
"description": "A tool to aid you in writing clean and consistent Less.",
"version": "0.7.0-beta",
"version": "0.7.0-beta2",
"main": "./lib/lesshint.js",

@@ -6,0 +6,0 @@ "author": {

@@ -124,2 +124,15 @@ var assert = require('assert');

});
it('should return an empty array on invalid input', function () {
var string = '.foo{';
var lesshint = new Lesshint();
var errors;
lesshint.configure();
errors = lesshint.checkString(string);
assert.ok(errors.length === 0);
});
});

@@ -126,0 +139,0 @@

@@ -227,3 +227,3 @@ var assert = require('assert');

it('should ignore invalid colors', function () {
it('should ignore colors with invalid length', function () {
var source = 'color: #abc1;';

@@ -248,2 +248,22 @@ var ast;

it('should ignore colors with invalid characters', function () {
var source = 'color: #abck;';
var ast;
var options = {
hexNotation: {
enabled: true,
style: 'lowercase'
}
};
ast = linter.parseAST(source);
ast = ast.first('declaration').first('value').first('color');
assert.strictEqual(true, hexNotation({
config: options,
node: ast
}));
});
it('should return null when disabled', function () {

@@ -250,0 +270,0 @@ var source = 'color: #abc;';

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