If false, disables all active vocabularies for this rule (default: true).
exceptions
array
An array of strings to be ignored.
yaml
Copy
extends: conditionalmessage: "'%s' has no definition"level: errorscope: textignorecase: false# Ensures that the existence of 'first'# implies the existence of 'second'.first: '([A-Z]{3,5})'second: '(?:[A-Z][a-z]+ )+(([A-Z]{3,5}))'# ... with the exception of these:exceptions: - ABC - ADD
For example, consider the following text:
According to Wikipedia, the World Health Organization (WHO) is a
specialized agency of the United Nations that is concerned with international
public health. We can now use WHO because it has been defined, but we can’t
use DAFB because people may not know what it represents. We can use DAFB when it’s presented as code, though.
Using the above text with our example rule yields the following:
bash
Copy
test.md:1:224:style.UnexpandedAcronyms:'DAFB' has no definition
conditional also takes an optional exceptions list. Any token listed as an
exception won’t be flagged.
Regular expression lookarounds can be used to restrict the capture of the
rule, allowing for more complex conditional statements. For example, the
following rule will flag any MDX-style import that is not used:
yaml
Copy
extends: conditionalmessage: "'%s' has been imported but not used."level: errorscope: rawfirst: "(?<=import )(w+)(?= from)"second: '(?<=<)(w+)'