Skip to content

Commit b049e35

Browse files
committed
feat: support the .scss extension
Signed-off-by: Joseph Kato <joseph@jdkato.io>
1 parent b678b8d commit b049e35

3 files changed

Lines changed: 71 additions & 13 deletions

File tree

‎internal/core/format.go‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ var FormatByExtension = map[string][]string{
5757
`\.(?:proto)$`: {".proto", "code"},
5858
`\.(?:ps1|psm1|psd1)$`: {".ps1", "code"},
5959
`\.(?:rb|Gemfile|Rakefile|Brewfile|gemspec)$`: {".rb", "code"},
60-
`\.(?:rs)$`: {".rs", "code"},
61-
`\.(?:rst|rest)$`: {".rst", "markup"},
62-
`\.(?:r|R)$`: {".r", "code"},
63-
`\.(?:sass|less)$`: {".c", "code"},
64-
`\.(?:scala|sbt)$`: {".c", "code"},
65-
`\.(?:swift)$`: {".c", "code"},
66-
`\.(?:ts|tsx)$`: {".ts", "code"},
67-
`\.(?:typ)$`: {".typ", "markup"},
68-
`\.(?:txt)$`: {".txt", "text"},
69-
`\.(?:xml|xsd)$`: {".xml", "markup"},
70-
`\.(?:yaml|yml)$`: {".yml", "data"},
71-
`\.(?:json)$`: {".json", "data"},
72-
`\.(?:toml)$`: {".toml", "data"},
60+
`\.(?:rs)$`: {".rs", "code"},
61+
`\.(?:rst|rest)$`: {".rst", "markup"},
62+
`\.(?:r|R)$`: {".r", "code"},
63+
`\.(?:sass|scss|less)$`: {".c", "code"},
64+
`\.(?:scala|sbt)$`: {".c", "code"},
65+
`\.(?:swift)$`: {".c", "code"},
66+
`\.(?:ts|tsx)$`: {".ts", "code"},
67+
`\.(?:typ)$`: {".typ", "markup"},
68+
`\.(?:txt)$`: {".txt", "text"},
69+
`\.(?:xml|xsd)$`: {".xml", "markup"},
70+
`\.(?:yaml|yml)$`: {".yml", "data"},
71+
`\.(?:json)$`: {".json", "data"},
72+
`\.(?:toml)$`: {".toml", "data"},
7373
}
7474

7575
// FormatFromExt takes a file extension and returns its [normExt, format]

‎testdata/e2e/lint.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,19 @@ cases:
159159
test.cc:20:5:vale.Annotations:'XXX' left in text
160160
test.cc:23:37:vale.Annotations:'XXX' left in text
161161
162+
- name: scss
163+
about: "#1019 -- SCSS lints like Sass: comments are prose, selectors,
164+
values, and strings are code"
165+
args: test.scss
166+
exit: 0
167+
want: |
168+
test.scss:1:4:vale.Annotations:'NOTE' left in text
169+
test.scss:8:4:vale.Annotations:'XXX' left in text
170+
test.scss:18:6:vale.Annotations:'TODO' left in text
171+
test.scss:37:50:vale.Annotations:'XXX' left in text
172+
absent:
173+
- FIXME
174+
162175
- name: clojure
163176
args: test.clj
164177
exit: 0
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// NOTE: shared design tokens live in _tokens.scss.
2+
3+
$primary: #4a90d9;
4+
$radius: 4px;
5+
$spacing: 8px;
6+
7+
/*
8+
XXX: these breakpoints predate the responsive refresh;
9+
keep them in sync with the JavaScript constants.
10+
*/
11+
$breakpoints: (
12+
"small": 480px,
13+
"medium": 768px,
14+
"large": 1024px,
15+
);
16+
17+
@mixin elevated($level: 1) {
18+
// TODO: derive the shadow from the elevation level.
19+
box-shadow: 0 ($level * 1px) ($level * 2px) rgba(0, 0, 0, 0.2);
20+
}
21+
22+
.card {
23+
padding: $spacing * 2;
24+
border-radius: $radius;
25+
background-color: lighten($primary, 40%);
26+
@include elevated(2);
27+
28+
&__title {
29+
font-weight: 700;
30+
31+
&::after {
32+
content: "FIXME is ignored inside a string";
33+
}
34+
}
35+
36+
&:hover {
37+
background-color: lighten($primary, 35%); // XXX: fails contrast on dark themes.
38+
}
39+
}
40+
41+
@media (min-width: 768px) {
42+
.card {
43+
max-width: 640px;
44+
}
45+
}

0 commit comments

Comments
 (0)