Skip to content

Commit

Permalink
Add support for Sass syntax (#4306)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource authored Oct 23, 2023
1 parent 24d4b86 commit 5a2a1c3
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
57 changes: 56 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"module-alias": "2.2.3",
"postcss-html": "0.36.0",
"postcss-less": "6.0.0",
"postcss-sass": "0.5.0",
"postcss-scss": "4.0.6",
"postcss-syntax": "0.36.2",
"postcss-value-parser": "4.2.0",
Expand Down Expand Up @@ -130,6 +131,7 @@
"module-alias",
"postcss-html",
"postcss-less",
"postcss-sass",
"postcss-scss",
"postcss-syntax",
"postcss-value-parser",
Expand Down
17 changes: 17 additions & 0 deletions packages/css/tests/analysis/analyzer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ describe('analyzeCSS', () => {
});
});

it('should analyze sass syntax', async () => {
const filePath = path.join(__dirname, 'fixtures', 'file.sass');
await expect(
analyzeCSS(
await input(filePath, undefined, [
{ key: 'selector-pseudo-element-no-unknown', configurations: [] },
]),
),
).resolves.toEqual({
issues: [
expect.objectContaining({
ruleId: 'selector-pseudo-element-no-unknown',
}),
],
});
});

it('should analyze less syntax', async () => {
const filePath = path.join(__dirname, 'fixtures', 'file.less');
await expect(analyzeCSS(await input(filePath, undefined, rules))).resolves.toEqual({
Expand Down
3 changes: 3 additions & 0 deletions packages/css/tests/analysis/fixtures/file.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a
&::pseudo
color: red

0 comments on commit 5a2a1c3

Please sign in to comment.