Skip to content

Commit

Permalink
Merge pull request #59 from anaxite/ak/vale-mdx-rules
Browse files Browse the repository at this point in the history
Vale rules update
  • Loading branch information
hawkeyexl authored Feb 12, 2025
2 parents ef457ed + 234dcab commit e702dcc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Vocab = Docs

MinAlertLevel = suggestion

Packages = Google, alex, Joblint
Packages = MDX, Google, alex, Joblint

[*.{md,mdx}]
BasedOnStyles = Vale, Google, alex, Joblint
Expand Down
21 changes: 21 additions & 0 deletions styles/.vale-config/0-MDX.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[formats]
mdx = md

[*.mdx]
CommentDelimiters = {/*, */}

# Exclude:
#
# `import ...`, `export ...`
# `<Component ... />`
# `<Component>...</Component>`
# `{ ... }`
TokenIgnores = (?sm)((?:import|export) .+?$), \
(?<!`)(<\w+ ?.+ ?\/>)(?!`), \
(<[A-Z]\w+>.+?<\/[A-Z]\w+>)

# Exclude:
#
# `<Component \n ... />`
BlockIgnores = (?sm)^(<\w+\n .*\s\/>)$, \
(?sm)^({.+.*})
6 changes: 3 additions & 3 deletions styles/Google/AMPM.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extends: existence
message: "Use 'AM' or 'PM' (preceded by a space)."
link: 'https://developers.google.com/style/word-list'
link: "https://developers.google.com/style/word-list"
level: error
nonword: true
tokens:
- '\d{1,2}[AP]M'
- '\d{1,2} ?[ap]m'
- '\d{1,2}[AP]M\b'
- '\d{1,2} ?[ap]m\b'
- '\d{1,2} ?[aApP]\.[mM]\.'
2 changes: 1 addition & 1 deletion styles/alex/Suicide.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
extends: substitution
message: When referring to a person, consider using '%s' instead of '%s'.
message: Consider using '%s' instead of '%s' (which may be insensitive).
ignorecase: true
level: warning
action:
Expand Down

0 comments on commit e702dcc

Please # to comment.