Skip to content

Commit 605a409

Browse files
committed
feat(rule): refactor alternatives
1 parent f9faa6f commit 605a409

File tree

16 files changed

+103
-154
lines changed

16 files changed

+103
-154
lines changed

Prim/RequiredAlternatives.yml renamed to Prim/Consistency.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
extends: substitution
2-
message: "Use '%s' instead of '%s'."
3-
level: error
2+
message: "Use '%s' over '%s'."
3+
level: warning
44
ignorecase: true
55
action:
66
name: replace
77
swap:
88
24/7: 24x7
99
3\-D: 3D
10-
Ajax: AJAX
1110
audio(?:-| )books?: audiobook|audiobooks
1211
autodetect: auto-detect
1312
back(?:-| )light: backlight
1413
back\s(slash|slashes): backslash|backslashes
15-
'[bB]asic [aA]uth': Basic HTTP authentication|Basic authentication
1614
bottle(?:-| )necks?: bottleneck|bottlenecks
17-
(?:cell ?phone|smart ?phone): phone|mobile phone
1815
chat(?:-| )bots?: chatbot|chatbots
1916
check lists?: checklist|checklists
2017
check marks?: checkmark|checkmarks
@@ -28,7 +25,9 @@ swap:
2825
(?:OAuth ?2|Oauth): OAuth 2.0
2926
ok: OK
3027
on demand: on-demand
28+
open-source: open source
3129
(?:file ?path|path ?name)s?: path|paths
30+
(?:cell ?phone|smart ?phone): phone|mobile phone
3231
(?:quote mark|quotemark)s?: quotation mark|quotation marks
3332
scroll(?:-| )bars?: scrollbar|scrollbars
3433
synch: sync
@@ -38,3 +37,4 @@ swap:
3837
an URL: a URL
3938
usecases?: use case|use cases
4039
(?:WiFi|wifi): Wi-Fi
40+
World Wide Web: web

Prim/PreferredAlternatives.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Prim/SimplerAlternatives.yml renamed to Prim/Simplifications.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ ignorecase: true
55
action:
66
name: replace
77
swap:
8+
0-days?: zero-day|zero-days
9+
12 am: midnight
10+
12 pm: noon
11+
adversely impact: hurt
812
approximately: about|around
913
state-of-the-art: modern|latest

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prim",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "A Vale-compatible prose style for non-native English speaker",
55
"type": "module",
66
"author": "Naiyer Asif (https://naiyerasif.com)",

test/fixtures/SimplerAlternatives/.vale.ini renamed to test/fixtures/Consistency/.vale.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ StylesPath = ../../../
33
MinAlertLevel = suggestion
44

55
[*.md]
6-
Prim.SimplerAlternatives = YES
6+
Prim.Consistency = YES

test/fixtures/RequiredAlternatives/test.md renamed to test/fixtures/Consistency/test.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
# Required Alternatives
1+
# Consistency
22

33
<!-- 24/7 -->
44
Our emergency hotline is staffed 24/7 for immediate assistance.
55

66
<!-- 3-D -->
77
The movie was stunning in 3-D.
88

9-
<!-- Ajax -->
10-
The web developer used Ajax to create a dynamic search feature on the website.
11-
129
<!-- audiobook -->
1310
I use audio-books to learn new languages.
1411
This audio book is several hours long.
@@ -24,19 +21,12 @@ This phone can automatically adjust the back-light brightness.
2421
Press back slash to reset the search.
2522
On Windows, we use back slashes to separate directories and files.
2623

27-
<!-- Basic authentication -->
28-
Basic Auth requires a username and password to authenticate requests.
29-
3024
<!-- bottleneck -->
3125
The bottle necks in production caused delays.
3226
The narrow hallway creates a bottle-neck during rush hours.
3327

34-
<!-- phone -->
35-
I use my cell phone to take pictures.
36-
Keep your smartphone on airplane mode during the flight.
37-
38-
<!-- chatbot -->
39-
A chat-bot is a conversational agent that simulates human conversation.
28+
<!-- chat bot -->
29+
She used a chat bot to proofread her paper.
4030
Chat bots can be trained to analyze data and provide insights.
4131

4232
<!-- check list -->
@@ -81,10 +71,17 @@ I prefer watching movies on demand.
8171
<!-- OK -->
8272
Is everything ok?
8373

74+
<!-- open-source -->
75+
I contributed a new feature to an open-source project.
76+
8477
<!-- path -->
8578
Check the file path to locate the document.
8679
Copy and paste the full path names to navigate to the desired folder.
8780

81+
<!-- phone -->
82+
Have you seen my cell phone?
83+
My smartphone is running low on battery.
84+
8885
<!-- quotation mark -->
8986
You can use quote marks to format in-text citations.
9087
Use quotemark to set off a quotation from the text.
@@ -112,3 +109,6 @@ We analyzed the usecases to identify potential improvements.
112109
<!-- wifi -->
113110
The cafe offers free wifi for customers.
114111
I can't finish my work without WiFi.
112+
113+
<!-- World Wide Web -->
114+
I'd better search the World Wide Web for a new recipe.

test/fixtures/PreferredAlternatives/.vale.ini

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/fixtures/PreferredAlternatives/test.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

test/fixtures/SimplerAlternatives/test.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/fixtures/RequiredAlternatives/.vale.ini renamed to test/fixtures/Simplifications/.vale.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ StylesPath = ../../../
33
MinAlertLevel = suggestion
44

55
[*.md]
6-
Prim.RequiredAlternatives = YES
6+
Prim.Simplifications = YES

0 commit comments

Comments
 (0)