Comparing version 4.1.3 to 4.2.0
# Changelog | ||
## 4.2.0 (2017-10-24) | ||
* Updated `postcss-selector-parser` to `3.0.0`. ([6fac21a](https://github.com/lesshint/lesshint/commit/6fac21a404a8c8ff48564fa21e5357efaca9b94d)) | ||
* The `parseSelector` util can also accept PostCSS `Rule` nodes which gives better errors. ([6fac21a](https://github.com/lesshint/lesshint/commit/6fac21a404a8c8ff48564fa21e5357efaca9b94d)) | ||
* Updated `sinon` to `4.0.0`. | ||
([82ee2aa](https://github.com/lesshint/lesshint/commit/82ee2aa8c4bb2116dc7010375cec46483e506c3c)) | ||
## 4.1.3 (2017-09-25) | ||
@@ -3,0 +9,0 @@ * Fixed an issue where `finalNewline` would erroneously report files with CRLF line endings. ([5aff629](https://github.com/lesshint/lesshint/commit/5aff62999cb00dbf323a0001cefe640f3f48334c)) |
@@ -26,6 +26,7 @@ # Utils | ||
## `parseSelector(selector)` | ||
Parse a selector using [`postcss-selector-parser`](https://github.com/postcss/postcss-selector-parser). | ||
Parse a selector using [`postcss-selector-parser`](https://github.com/postcss/postcss-selector-parser). Accepts a selector string or a PostCSS `Rule` node. | ||
```js | ||
utils.parseSelector('.foo'); // Parser tree | ||
utils.parseSelector(ruleNode); // Parser tree | ||
``` | ||
@@ -32,0 +33,0 @@ |
@@ -15,3 +15,3 @@ 'use strict'; | ||
const selectors = parseSelector(node.selector); | ||
const selectors = parseSelector(node); | ||
const results = []; | ||
@@ -18,0 +18,0 @@ |
@@ -11,3 +11,3 @@ 'use strict'; | ||
lint: function idSelectorLinter (config, node) { | ||
const tree = parseSelector(node.selector); | ||
const tree = parseSelector(node); | ||
const excludes = config.exclude.map((id) => { | ||
@@ -14,0 +14,0 @@ // Remove # |
@@ -43,3 +43,3 @@ 'use strict'; | ||
lint: function qualifyingElementLinter (config, node) { | ||
const selectors = parseSelector(node.selector); | ||
const selectors = parseSelector(node); | ||
const selectorTypes = ['nesting', 'tag']; | ||
@@ -46,0 +46,0 @@ const results = []; |
@@ -12,3 +12,3 @@ 'use strict'; | ||
lint: function selectorNamingLinter (config, node) { | ||
const selectors = parseSelector(node.selector); | ||
const selectors = parseSelector(node); | ||
const selectorTypes = ['class', 'id']; | ||
@@ -15,0 +15,0 @@ const exclude = config.exclude || []; |
@@ -11,3 +11,3 @@ 'use strict'; | ||
lint: function singleLinePerSelectorLinter (config, node) { | ||
const tree = parseSelector(node.selector); | ||
const tree = parseSelector(node); | ||
const results = []; | ||
@@ -14,0 +14,0 @@ |
@@ -97,3 +97,3 @@ 'use strict'; | ||
default: | ||
tree = parseSelector(node.selector); | ||
tree = parseSelector(node); | ||
@@ -100,0 +100,0 @@ tree.walkAttributes((selector) => { |
@@ -11,3 +11,3 @@ 'use strict'; | ||
lint: function universalSelectorLinter (config, node) { | ||
const tree = parseSelector(node.selector); | ||
const tree = parseSelector(node); | ||
const results = []; | ||
@@ -14,0 +14,0 @@ |
@@ -6,9 +6,3 @@ 'use strict'; | ||
module.exports = function (selector) { | ||
let tree; | ||
parser((selectors) => { | ||
tree = selectors; | ||
}).process(selector); | ||
return tree; | ||
return parser().astSync(selector); | ||
}; |
{ | ||
"name": "lesshint", | ||
"description": "A tool to aid you in writing clean and consistent Less.", | ||
"version": "4.1.3", | ||
"version": "4.2.0", | ||
"main": "./lib/index.js", | ||
@@ -29,3 +29,3 @@ "author": { | ||
"postcss-less": "^1.0.0", | ||
"postcss-selector-parser": "^2.0.0", | ||
"postcss-selector-parser": "^3.0.0", | ||
"postcss-values-parser": "~1.2.2", | ||
@@ -44,3 +44,3 @@ "rcfinder": "^0.1.8", | ||
"rimraf": "^2.4.2", | ||
"sinon": "^3.0.0" | ||
"sinon": "^4.0.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
466505
152
9476
13
2
+ Addeddot-prop@5.3.0(transitive)
+ Addedis-obj@2.0.0(transitive)
+ Addedpostcss-selector-parser@3.1.2(transitive)
- Removedpostcss-selector-parser@2.2.3(transitive)