Packages provide a means of sharing, extending, syncing, and updating Vale
configurations.
In the example above, projects 1 and 2 will have identical configurations
(as inherited from the upstream package). Any changes to the upstream package
will propagate to both projects.
A package is a .zip file that contains a .vale.ini file, a StylesPath folder, or both. You include a package by using the top-level Packages key
in your local .vale.ini file:
The StylesPath should be named “styles” and can contain any
typically-supported subfolder—such as styles and vocabularies. The .vale.ini file should reference the
included StylesPath:
ini
Copy
# This is subfolder included in our .zip archive.StylesPath = styles# Complete packages can include other, externally-defined# packages.Packages = proselint# Normal configuration ...[*.{md,adoc}]Test.Rule = YES
The packaged StylesPath will be merged with the active local StylesPath and any included configuration files will be added to the local StylesPath/.vale-config folder.
In the case of conflicting configuration, the order in which packages are
loaded is important:
ini
Copy
Packages = pkg1, pkg2# Local configuration ...[*.{md,adoc}]Test.Rule = YES
In the above example, pkg2 will override any conflicting configuration from pkg1. Similarly, local configuration will override any conflicting package.
You’ll want to add any packaged configuration components to your .gitignore (or equivalent) file.
While this can be as simple as ignoring your entire StylesPath, it’s likely
that you’ll also have some local components as well.
gitignore
Copy
# We want to ignore our StylesPath *except* for our local# `vocabularies/Base` directory..github/styles/*!.github/styles/config/.github/styles/config/*!.github/styles/config/vocabularies/.github/styles/config/vocabularies/*!.github/styles/config/vocabularies/Base
The above example ignores the entire .github/styles/ folder except for .github/styles/config/vocabularies/Base (which we want to track changes for).