stylelint-prettier
Advanced tools
Comparing version 4.0.2 to 4.1.0
# Changelog | ||
## 4.1.0 (2023-11-24) | ||
- Added end indexes for violations - the squiggly line in vscode will now cover more than one character. (#341) | ||
- Do not trigger prettier for .astro files. (#340) | ||
## 4.0.2 (2023-07-27) | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "stylelint-prettier", | ||
"version": "4.0.2", | ||
"version": "4.1.0", | ||
"description": "Runs prettier as an stylelint rule", | ||
@@ -44,3 +44,3 @@ "keywords": [ | ||
"jest": "^29.6.1", | ||
"jest-preset-stylelint": "^6.1.0", | ||
"jest-preset-stylelint": "^6.3.2", | ||
"postcss": "^8.4.25", | ||
@@ -53,2 +53,3 @@ "postcss-html": "^1.5.0", | ||
"prettier": "^3.0.0", | ||
"prettier-plugin-astro": "^0.12.1", | ||
"prettier-plugin-svelte": "^3.0.0", | ||
@@ -55,0 +56,0 @@ "strip-ansi": "^6.0.0", |
@@ -98,2 +98,3 @@ const stylelint = require('stylelint'); | ||
'svelte', | ||
'astro', | ||
]; | ||
@@ -154,3 +155,3 @@ if (parserBlockList.indexOf(prettierFileInfo.inferredParser) !== -1) { | ||
const report = (message, index) => { | ||
const report = (message, index, endIndex) => { | ||
return stylelint.utils.report({ | ||
@@ -162,2 +163,3 @@ ruleName, | ||
index, | ||
endIndex, | ||
}); | ||
@@ -219,8 +221,17 @@ }; | ||
differences.forEach((difference) => { | ||
const {offset, deleteText = ''} = difference; | ||
switch (difference.operation) { | ||
case INSERT: | ||
report(messages.insert(difference.insertText), difference.offset); | ||
report( | ||
messages.insert(difference.insertText), | ||
offset, | ||
offset + deleteText.length | ||
); | ||
break; | ||
case DELETE: | ||
report(messages.delete(difference.deleteText), difference.offset); | ||
report( | ||
messages.delete(difference.deleteText), | ||
difference.offset, | ||
offset + deleteText.length | ||
); | ||
break; | ||
@@ -230,3 +241,4 @@ case REPLACE: | ||
messages.replace(difference.deleteText, difference.insertText), | ||
difference.offset | ||
difference.offset, | ||
offset + deleteText.length | ||
); | ||
@@ -233,0 +245,0 @@ break; |
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
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
20694
239
19