Add mention of using "extends" in .markdownlint.json to reference installed packages (closes #1555).

This commit is contained in:
David Anson 2025-04-02 21:34:10 -07:00
parent a9417fdf67
commit a84f7c5b18

View file

@ -421,9 +421,9 @@ object.
See [ValidatingConfiguration.md](schema/ValidatingConfiguration.md) for ways to See [ValidatingConfiguration.md](schema/ValidatingConfiguration.md) for ways to
use the JSON Schema to validate configuration. use the JSON Schema to validate configuration.
For more advanced scenarios, styles can reference and extend other styles. For more advanced scenarios, styles can reference and build upon other styles
The `readConfig` and `readConfigSync` functions can be used to read such via the `extends` keyword and a file path or (installed) package name. The
styles. `readConfig` function can be used to read such aggregate styles from code.
For example, assuming a `base.json` configuration file: For example, assuming a `base.json` configuration file:
@ -678,9 +678,9 @@ uses rule aliases (ex: `no-hard-tabs`) instead of names (ex: `MD010`).
### Config ### Config
The `options.config` configuration object is simple and can be stored in a file The `options.config` configuration object is simple and can be stored in a file
for readability and easy reuse. The `readConfig` and `readConfigSync` functions for readability and easy reuse. The `readConfig` function loads configuration
load configuration settings and support the `extends` keyword for referencing settings and supports the `extends` keyword for referencing files or packages
other files (see above). (see above).
By default, configuration files are parsed as JSON (and named By default, configuration files are parsed as JSON (and named
`.markdownlint.json`). Custom parsers can be provided to handle other formats `.markdownlint.json`). Custom parsers can be provided to handle other formats