Skip to content

Commit 12161fc

Browse files
committed
feat(rule): en dash
1 parent 2602657 commit 12161fc

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-0
lines changed

Crystal/EnDash.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: existence
2+
message: "Remove the spaces around '%s'."
3+
level: error
4+
ignorecase: true
5+
nonword: true
6+
action:
7+
name: edit
8+
params:
9+
- remove
10+
- ' '
11+
tokens:
12+
- '(?:\s?–|–\s?)'

fixtures/EnDash/.vale.ini

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
StylesPath = ../../
2+
3+
MinAlertLevel = suggestion
4+
5+
[*.md]
6+
Crystal.EnDash = YES

fixtures/EnDash/test.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# en dash
2+
3+
It was just one of many changes in this post ⁠– ⁠New Deal era.
4+
She is a National Book Award ⁠–⁠winning novelist.
5+
He submitted his manuscript to an e-book⁠– ⁠only publisher.

test/parameters/EnDash/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default [
2+
"EnDash",
3+
`
4+
test.md:3:47:Crystal.EnDash:Remove the spaces around '–'.
5+
test.md:4:31:Crystal.EnDash:Remove the spaces around '–'.
6+
test.md:5:42:Crystal.EnDash:Remove the spaces around '–'.
7+
`
8+
];

test/parameters/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import EnDash from "./EnDash/index.js";
12
import Latin from "./Latin/index.js";
23

34
export default [
5+
EnDash,
46
Latin
57
];

0 commit comments

Comments
 (0)