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

sass-lint

Package Overview
Dependencies
Maintainers
3
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-lint - npm Package Compare versions

Comparing version 1.13.0 to 1.13.1

data/properties.yml

42

bin/sass-lint.js

@@ -19,9 +19,16 @@ #!/usr/bin/env node

var detectPattern = function (pattern) {
var detectPattern = function (pattern, userConfig) {
var detects = lint.lintFiles(pattern, configOptions, configPath);
if (program.verbose) {
lint.outputResults(detects, configOptions, configPath);
}
if (lint.errorCount(detects).count || tooManyWarnings(detects, userConfig)) {
exitCode = 1;
}
if (program.exit) {
lint.failOnError(detects, configOptions, configPath);
}
return detects;
};

@@ -69,27 +76,16 @@

(function () {
// load our config here so we only load it once for each file
config = lint.getConfig(configOptions, configPath);
var results = [];
// load our config here so we only load it once for each file
config = lint.getConfig(configOptions, configPath);
if (program.args.length === 0) {
results = results.concat(detectPattern(null));
}
else {
program.args.forEach(function (path) {
results = results.concat(detectPattern(path));
});
}
if (program.args.length === 0) {
detectPattern(null, config);
}
else {
program.args.forEach(function (path) {
detectPattern(path, config);
});
}
if (program.verbose) {
lint.outputResults(results, configOptions, configPath);
}
if (lint.errorCount(results).count || tooManyWarnings(results, config)) {
exitCode = 1;
}
}());
process.on('exit', function () {
process.exit(exitCode); // eslint-disable-line no-process-exit
});
# Sass Lint Changelog
## v1.13.1
**Fixes**
* Same as v1.12.1 - 1.13.0 was released by accident and contains many breaking changes - npm unpublishing failed so this unfortnately bumps our version a few spots -
## v1.13.0
**IGNORE ME - SORRY**
## v1.12.1

@@ -4,0 +14,0 @@

@@ -12,4 +12,3 @@ 'use strict';

fs = require('fs-extra'),
globule = require('globule'),
getFormatter = require('./lib/format/getFormatter');
globule = require('globule');

@@ -40,3 +39,3 @@ var getToggledRules = ruleToggler.getToggledRules,

*
* @param {Array} results our results Array
* @param {object} results our results object
* @returns {object} errors object containing the error count and paths for files incl. errors

@@ -64,3 +63,3 @@ */

*
* @param {Array} results our results array
* @param {object} results our results object
* @returns {object} warnings object containing the error count and paths for files incl. warnings

@@ -88,3 +87,3 @@ */

*
* @param {Array} results our results array
* @param {object} results our results object
* @returns {int} the cumulative count of errors and warnings detected

@@ -196,3 +195,3 @@ */

* @param {string} configPath path to a config file
* @returns {Array} results object containing all results
* @returns {object} results object containing all results
*/

@@ -254,11 +253,12 @@ sassLint.lintFiles = function (files, options, configPath) {

*
* @param {Array} results our results array
* @param {object} results our results object
* @param {object} options user specified rules/options passed in
* @param {string} configPath path to a config file
* @returns {string} results our results object in the user specified format
* @returns {object} results our results object in the user specified format
*/
sassLint.format = function (results, options, configPath) {
var config = this.getConfig(options, configPath);
var config = this.getConfig(options, configPath),
format = config.options.formatter.toLowerCase();
var formatted = getFormatter(config.options.formatter, config);
var formatted = require('eslint/lib/formatters/' + format);

@@ -272,6 +272,6 @@ return formatted(results);

*
* @param {Array} results our results array
* @param {object} results our results object
* @param {object} options user specified rules/options passed in
* @param {string} configPath path to a config file
* @returns {string} the formatted results string
* @returns {object} results our results object
*/

@@ -305,3 +305,3 @@ sassLint.outputResults = function (results, options, configPath) {

*
* @param {Array} results - our results array
* @param {object} results - our results object
* @param {object} [options] - extra options to use when running failOnError, e.g. max-warnings

@@ -308,0 +308,0 @@ * @param {string} [configPath] - path to the config file

@@ -6,13 +6,22 @@ //////////////////////////////

var gonzales = require('gonzales-pe');
var matter = require('gray-matter');
var gonzales = require('gonzales-pe-sl');
var fm = require('front-matter');
var helpers = require('./helpers');
module.exports = function (input, syntax, filename) {
module.exports = function (text, syntax, filename) {
var tree;
var result = matter(input, {});
var text = result.content;
if (result.matter) {
var emptyLines = new Array(result.matter.split('\n').length + 2).join('\n');
text = emptyLines + result.content;
// Run `.toString()` to allow Buffers to be passed in
text = helpers.stripBom(text.toString());
// if we're skipping front matter do it here, fall back to just our text in case it fails
if (fm.test(text)) {
var withFrontMatter = fm(text);
// Replace front matter by empty lines, so that line numbers are preserved
var numEmptyLines = 2;
if (withFrontMatter.frontmatter !== '') {
numEmptyLines += withFrontMatter.frontmatter.split('\r\n|\r|\n').length;
}
var emptyLines = new Array(numEmptyLines + 1).join('\n');
text = emptyLines + withFrontMatter.body || text;
}

@@ -19,0 +28,0 @@

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

yaml = require('js-yaml'),
gonzales = require('gonzales-pe');
gonzales = require('gonzales-pe-sl');

@@ -173,3 +173,3 @@ var helpers = {};

helpers.isStrictBEM = function (str) {
return /^[a-z](-?[a-z0-9]+)*(__[a-z0-9](-?[a-z0-9]+)*)?((_[a-z0-9](-?[a-z0-9]+)*){0,2})?$/.test(str);
return /^[a-z](\-?[a-z0-9]+)*(__[a-z0-9](\-?[a-z0-9]+)*)?((_[a-z0-9](\-?[a-z0-9]+)*){0,2})?$/.test(str);
};

@@ -422,41 +422,2 @@

/**
* Returns an escaped XML string
*
* @param {string} str The string to escape
* @returns {string} The escaped string
*/
helpers.escapeXML = function (str) {
return (str + '').replace(/[<>&"'\x00-\x1F\x7F\u0080-\uFFFF]/g, function (c) { // eslint-disable-line no-control-regex
switch (c) {
case '<':
return '&lt;';
case '>':
return '&gt;';
case '&':
return '&amp;';
case '"':
return '&quot;';
case '\'':
return '&apos;';
default:
return '&#' + c.charCodeAt(0) + ';';
}
});
};
/**
* Returns the severity of warning or error
* @param {Object} message message object to examine
* @returns {string} severity level
* @private
*/
helpers.getMessageType = function (message) {
if (message.severity === 2) {
return 'error';
}
return 'warning';
};
module.exports = helpers;

@@ -21,6 +21,6 @@ 'use strict';

regexSelector = !parser.options['allow-protocol-relative-urls'] ?
isUrlRegex : protocolRelativeRegex,
isUrlRegex : protocolRelativeRegex,
message = !parser.options['allow-protocol-relative-urls'] ?
'Protocols and domains in URLs are disallowed' :
'Protocols in URLS are disallowed';
'Protocols and domains in URLs are disallowed' :
'Protocols in URLS are disallowed';

@@ -27,0 +27,0 @@ if (stripped.match(regexSelector)) {

'use strict';
var helpers = require('../helpers');
var helpers = require('../helpers'),
yaml = require('js-yaml'),
fs = require('fs'),
path = require('path');
var propertyCheckList = yaml.safeLoad(fs.readFileSync(path.join(__dirname, '../../data', 'properties.yml'), 'utf8')).split(' ');
var orderPresets = {

@@ -107,5 +112,3 @@ 'recess': 'recess.yml',

if (parser.options['ignore-custom-properties']) {
// lazy load our css property list
const propertyList = require('known-css-properties').all;
if (propertyList.indexOf(name.content) !== -1) {
if (propertyCheckList.indexOf(name.content) !== -1) {
properties[name.content] = prop;

@@ -112,0 +115,0 @@ }

@@ -267,5 +267,5 @@ 'use strict';

if (
(previous && (previous.end.line >= previous.start.line) && (previous.end.column > previous.start.column))
(previous && (previous.end.line >= previous.start.line) && (previous.end.column > previous.start.column))
|| (next && (next.end.line >= next.start.line) && (next.end.column > next.start.column))
) {
) {
result = helpers.addUnique(result, {

@@ -272,0 +272,0 @@ 'ruleId': parser.rule.name,

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

var isVarRegex = /^[$]/;
var isVarRegex = /^[\$]/;

@@ -8,0 +8,0 @@ module.exports = {

@@ -199,5 +199,2 @@ 'use strict';

break;
case 'sass-lint:disable-next-line':
addDisableLine(toggledRules, rules, comment.start.line + 1);
break;
default:

@@ -204,0 +201,0 @@ return;

{
"name": "sass-lint",
"version": "1.13.0",
"version": "1.13.1",
"description": "All Node Sass linter!",

@@ -9,5 +9,4 @@ "main": "index.js",

"pretest": "eslint .",
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --opts mocha.opts --timeout 10000",
"coverage": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"semantic-release": "semantic-release"
"test": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec -t 3000 tests tests/rules tests/helpers",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
},

@@ -33,73 +32,24 @@ "bin": {

"dependencies": {
"autoprefixer": "^7.1.3",
"chalk": "^2.1.0",
"commander": "^2.8.1",
"fs-extra": "^5.0.0",
"eslint": "^2.7.0",
"front-matter": "2.1.2",
"fs-extra": "^3.0.1",
"glob": "^7.0.0",
"globule": "^1.0.0",
"gonzales-pe": "4.2.4",
"gray-matter": "^3.1.1",
"js-yaml": "^3.13.1",
"known-css-properties": "^0.5.0",
"gonzales-pe-sl": "^4.2.3",
"js-yaml": "^3.5.4",
"known-css-properties": "^0.3.0",
"lodash.capitalize": "^4.1.0",
"lodash.kebabcase": "^4.0.0",
"lodash.map": "^4.6.0",
"lodash.template": "^4.4.0",
"merge": "^1.2.1",
"merge": "^1.2.0",
"path-is-absolute": "^1.0.0",
"text-table": "^0.2.0",
"util": "^0.10.3"
},
"devDependencies": {
"@commitlint/cli": "^7.5.2",
"@commitlint/config-conventional": "^7.5.0",
"@semantic-release/git": "^7.0.8",
"chai": "^4.1.2",
"cheerio": "^1.0.0-rc.2",
"coveralls": "^3.0.0",
"coveralls": "^2.11.4",
"deep-equal": "^1.0.1",
"eslint": "^4.5.0",
"husky": "^2.1.0",
"istanbul": "^0.4.5",
"lint-staged": "^8.1.5",
"mocha": "^5.2.0",
"proxyquire": "^1.8.0",
"semantic-release": "^15.13.12",
"sinon": "^4.1.2",
"strip-ansi": "^4.0.0"
},
"engines": {
"node": ">=6"
},
"lint-staged": {
"**/*.js": [
"npm run pretest",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "npm run pretest",
"pre-push": "npm run preversion",
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
},
"release": {
"branch": "develop",
"verifyConditions": [
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
],
"prepare": [
"@semantic-release/npm",
{
"path": "@semantic-release/git",
"assets": [
"package.json",
"package-lock.json"
]
}
]
"istanbul": "^0.4.0",
"mocha": "^3.0.1",
"sinon": "^2.3.2"
}
}

@@ -35,3 +35,3 @@ # Sass Lint [![npm version](https://badge.fury.io/js/sass-lint.svg)](http://badge.fury.io/js/sass-lint) [![Build Status](https://travis-ci.org/sasstools/sass-lint.svg?branch=develop)](https://travis-ci.org/sasstools/sass-lint) [![Coverage Status](https://coveralls.io/repos/sasstools/sass-lint/badge.svg?branch=develop&service=github)](https://coveralls.io/github/sasstools/sass-lint?branch=develop) [![Dependency Status](https://david-dm.org/sasstools/sass-lint.svg)](https://david-dm.org/sasstools/sass-lint#info=dependencies&view=list) [![Dev Dependency Status](https://david-dm.org/sasstools/sass-lint/dev-status.svg)](https://david-dm.org/sasstools/sass-lint#info=devDependencies&view=list)

Use the [Sample Config (YAML)](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml) or [Sample Config (JSON)](https://github.com/sasstools/sass-lint/blob/develop/docs/.sasslintrc) as a guide to create your own config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml).
Use the [Sample Config (YAML)](https://github.com/sasstools/sass-lint/tree/master/docs/sass-lint.yml) or [Sample Config (JSON)](https://github.com/sasstools/sass-lint/tree/master/docs/sasslintrc) as a guide to create your own config file. The default configuration can be found [here](https://github.com/sasstools/sass-lint/blob/master/lib/config/sass-lint.yml).

@@ -48,3 +48,2 @@ ### [Configuration Documentation](https://github.com/sasstools/sass-lint/tree/master/docs/options)

* [config-file](https://github.com/sasstools/sass-lint/tree/master/docs/options/config-file.md) - Specify another config file to load
* [cwd](https://github.com/sasstools/sass-lint/tree/master/docs/options/cwd.md) - Specify a directory to treat as the current working directory - formatters only for now
* [formatter](https://github.com/sasstools/sass-lint/tree/master/docs/options/formatter.md) - Choose the format for any warnings/errors to be displayed

@@ -84,3 +83,3 @@ * [merge-default-rules](https://github.com/sasstools/sass-lint/tree/master/docs/options/merge-default-rules.md) - Allows you to merge your rules with the default config file included with sass-lint

Here is an example configuration of a rule, where we are specifying that breaking the [indentation rule](https://github.com/sasstools/sass-lint/blob/master/docs/rules/indentation.md) should be treated as an error (its severity set to two), and setting the `size` option of the rule to 2 spaces:
Here is an example configuration of a rule, where we are specifying that breaking the [indentation rule](https://github.com/sasstools/sass-lint/blob/master/docs/rules/indentation.md) should be treated as an error (its severity set to two), and setting the `size` option of the rule to 2 spaces:

@@ -133,11 +132,2 @@ ```yml

### Disable a rule for text next line
```scss
p {
// sass-lint:disable-next-line border-zero
border: none;
}
```
### Disable all lints within a block (and all contained blocks)

@@ -144,0 +134,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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