Skip to content

Commit

Permalink
feat: prevent newline insertion after closing brace in specific cases
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Feb 27, 2025
1 parent 8109181 commit 09c301a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ export class SassStyleTemplate {
return;
}

const cssResult = `\n${processedContent.replace(/^(?!\s*$)/gm, ' ')}\n`;
const cssWithLine = `\n${processedContent.replace(/^(?!\s*$)/gm, ' ')}\n`;
const cssResult = cssWithLine.replace(/}(?!(\n\s*\n|\s*[}]))/g, `}\n`);

this.fileInfo = {
fileNameWithoutExt: path.basename(fileName, '.scss'),
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockquote/sass-style-template",
"version": "5.0.0",
"version": "5.0.1",
"description": "A SCSS watcher with autoprefixer for building Web Components using Lit and SASS.",
"keywords": [
"lit",
Expand Down Expand Up @@ -36,10 +36,10 @@
"dependencies": {
"autoprefixer": "^10.4.20",
"chokidar": "^4.0.3",
"commander": "^13.0.0",
"postcss": "^8.5.1",
"sass": "^1.83.4",
"tinyglobby": "^0.2.10"
"commander": "^13.1.0",
"postcss": "^8.5.3",
"sass": "^1.85.1",
"tinyglobby": "^0.2.12"
},
"prettier": {
"bracketSpacing": false,
Expand All @@ -50,7 +50,6 @@
{
"files": "*.{scss,css}",
"options": {
"printWidth": 280,
"singleQuote": false
}
}
Expand Down

0 comments on commit 09c301a

Please sign in to comment.