Skip to content

Commit 5059a5d

Browse files
committed
Add Vale prose linting to feature descriptions
1 parent 0485b78 commit 5059a5d

16 files changed

+46
-10
lines changed

.github/workflows/pull_request.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ jobs:
2929
cache: npm
3030
- run: npm ci
3131
- run: npm test
32+
vale:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: errata-ai/vale-action@d89dee975228ae261d22c15adcd03578634d429c # v2.1.1
37+
with:
38+
fail_on_error: true
39+
version: 3.12.0
3240

3341
env:
3442
FORCE_COLOR: 3

.vale.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
StylesPath = .vale
2+
3+
[features/*.yml]
4+
View = features
5+
BasedOnStyles = Vale, web-features-styles
6+
Vale.Spelling = NO

.vale/config/views/features.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
engine: dasel
2+
scopes:
3+
- name: description
4+
expr: description
5+
type: md

.vale/web-features-styles/Avoid.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extends: existence
2+
message: Consider removing '%s'
3+
level: warning
4+
ignorecase: true
5+
tokens:
6+
- is used to
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
extends: substitution
2+
message: Consider using '%s' instead of '%s'
3+
level: warning
4+
ignorecase: false
5+
# swap maps tokens in form of bad: good
6+
swap:
7+
defines: sets
8+
specifies: sets
9+
determines: sets

docs/guidelines.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ Omit "is used" where there's no loss in meaning.
195195
For example, prefer "The feature reads…" over "The feature is used to read…"
196196
([#727](https://github.com/web-platform-dx/web-features/pull/727#discussion_r1537635981))
197197

198+
✅ Linted with vale: [`avoid.yml`](.vale/web-features-styles/avoid.yml)
199+
198200
#### longhands and shorthands
199201

200202
Use the terms "shorthand" and "longhand" to describe the relationship between CSS properties that combine multiple properties into a single declaration and the individual properties.

features/beforeunload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: beforeunload
2-
description: "The `beforeunload` event is fired when the current window is about to be unloaded. Typically this is used to display a dialog to confirm if users really want to leave the page when there is unsaved data that would be lost."
2+
description: "The `beforeunload` event is fired when the current window is about to be unloaded. Typically you use this to display a dialog to confirm if users really want to leave the page when there is unsaved data that would be lost."
33
spec: https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-beforeunloadevent-interface
44
status:
55
compute_from: api.Window.beforeunload_event

features/charset.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "@charset"
2-
description: The `@charset` CSS at-rule specifies the character encoding of an external style sheet.
2+
description: The `@charset` CSS at-rule specifies the character encoding of an external style sheet.
33
spec: https://drafts.csswg.org/css2/#charset
44
group: css
55
compat_features:

features/del.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: <del>
2-
description: The `<del>` element element represents a range of text that has been deleted from a document, styling text as strikethrough by default.
2+
description: The `<del>` element element represents a range of text that has been deleted from a document, styling text as strikethrough by default.
33
spec: https://html.spec.whatwg.org/multipage/edits.html#the-del-element
44
group: html-elements
55
compat_features:

features/font-kerning.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: font-kerning
2-
description: The `font-kerning` CSS property sets whether kerning data from a font is used to adjust the space between letters.
2+
description: The `font-kerning` CSS property sets whether to use kerning data from a font to adjust the space between letters.
33
spec: https://drafts.csswg.org/css-fonts-4/#font-kerning-prop
44
group: font-features
55
caniuse: font-kerning

0 commit comments

Comments
 (0)