Configuration
The Starlight Spell Checker plugin can be configured inside the astro.config.mjs configuration file of your project:
import starlight from "@astrojs/starlight";import { defineConfig } from "astro/config";import starlightSpellChecker from "starlight-spell-checker";
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightSpellChecker({ // Configuration options go here. }), ], title: "My Docs", }), ],});Configuration options
Section titled “Configuration options”The Starlight Spell Checker plugin accepts the following configuration options:
exclude
Section titled “exclude”Type: string[]
Default: []
A list of page paths or glob patterns that should be excluded from validation.
In the following example, only the test.md page will be validated, and the exclude-pattern/* and exclude-manually/ paths will be ignored.
- astro.config.mjs
- package.json
Directorysrc
Directorycontent/docs/
- test.md
- exclude-manually.md
Directoryexclude-pattern/
- 1.md
- 2.md
- 3.md
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightSpellChecker({ exclude: ["exclude-manually/", "exclude-pattern/*"], }), ], }), ],})assuming
Section titled “assuming”Configuration parameters of the retext-assuming plugin.
Type:
{ enabled?: boolean, throwError?: boolean, phrases?: string[], ignore?: string[], verbose?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
phrases
Section titled “phrases”Type: string[]
Default: internal list
A list of phrases that the plugin should check against. In other words, a list of phrases to warn about.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
verbose
Section titled “verbose”Type: boolean
Default: false
Whether to also check for phrases that are probably fine, like "You should not simply assume".
casePolice
Section titled “casePolice”Configuration parameters of the retext-case-police plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
contractions
Section titled “contractions”Configuration parameters of the retext-contractions plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignoreLiterals?: boolean, mode?: "smart" | "straight"}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignoreLiterals
Section titled “ignoreLiterals”Type: boolean
Default: true
Whether to ignore contractions in literal strings.
If true, the plugin will ignore literal words.
If false, the plugin will check literal words.
Type: "smart" | "straight"
Default: "smart"
Whether to suggest smart (') or straight (’) apostrophes. See retext-quotes if you want to properly check apostrophes though.
diacritics
Section titled “diacritics”Configuration parameters of the retext-diacritics plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
equality
Section titled “equality”Configuration parameters of the retext-equality plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[], binary?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
binary
Section titled “binary”Type: boolean
Default: false
Whether to allow phrases like "he or she", "garbagemen and garbagewomen", etc.
indefiniteArticle
Section titled “indefiniteArticle”Configuration parameters of the retext-indefinite-article plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
intensify
Section titled “intensify”Configuration parameters of the retext-intensify plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
passive
Section titled “passive”Configuration parameters of the retext-passive plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
profanities
Section titled “profanities”Configuration parameters of the retext-profanities plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
sureness
Section titled “sureness”Type: 0 | 1 | 2
Default: 0
Minimum sureness level to warn about. See cuss for further information.
readability
Section titled “readability”Configuration parameters of the retext-readability plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
Type: number
Default: 22
Define the target age group. This will ensure that your text is readable for the specified age group.
minWords
Section titled “minWords”Type: number
Default: 5
Evaluate sentences containing at least this number of words. While most algorithms assess the reading level of an entire text, this plugin analyzes each sentence individually. Short sentences, however, can be disproportionately influenced by a single long or complex word.
threshold
Section titled “threshold”Type: number
Default: 4 / 7
Defines how many algorithms (out of 7) need to agree that something is hard to read.
The plugin uses these algorithms:
redundantAcronyms
Section titled “redundantAcronyms”Configuration parameters of the retext-redundant-acronyms plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
repeatedWords
Section titled “repeatedWords”Configuration parameters of the retext-repeated-words plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
simplify
Section titled “simplify”Configuration parameters of the retext-simplify plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
Configuration parameters of the retext-spell plugin.
Type:
{ enabled?: boolean, throwError?: boolean, ignore?: string[]}enabled
Section titled “enabled”Type: boolean
Default: true
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
ignore
Section titled “ignore”Type: string[]
Default: []
A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.
Configuration parameters of the retext-usage plugin.
Type:
{ enabled?: boolean, throwError?: boolean}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
quotes
Section titled “quotes”Configuration parameters of the retext-quotes plugin. This plugin knows about apostrophes as well and prefers ' when
preferred: 'straight', and ’ otherwise.
Type:
{ enabled?: boolean, throwError?: boolean, mode?: "smart" | "straight", smart?: string[] | Record<string, string[]>, straight?: string[] | Record<string, string[]>}enabled
Section titled “enabled”Type: boolean
Default: false
Whether to enable the assuming plugin.
throwError
Section titled “throwError”Type: boolean
Default: false
Whether to throw an error if the plugin detects mistakes.
If true, the plugin will throw an error and stop the build process.
If false, the plugin will log warnings and continue the build process.
Type: "smart" | "straight"
Default: "smart"
Whether to suggest smart (') or straight (’) apostrophes.
Type: string[] | Record<string, string[]>
Default: ["“”", "‘’"]
List of quotes to see as smart quotes.
Explaination:
The values in smart can be one or two characters.
When two, the first character determines the opening quote and the second
the closing quote at that level.
When one, both the opening and closing quote are that character.
The order in which the preferred quotes appear in their respective list
determines which quotes to use at which level of nesting.
So, to prefer ‘’ at the first level of nesting, and “” at the second,
pass: smart: ['‘’', '“”'].
If quotes are nested deeper than the given amount of quotes, the markers
wrap around: a third level of nesting when using smart: ['«»', '‹›']
should have double guillemets, a fourth single, a fifth double again, etc.
Multilingualism:
If you want to defined different quotes for different languages, you can pass a Record<string, string[]> type, like this:
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightSpellChecker({ quotes: { smart: { en: ['“”', '‘’'], de: ['„“', '‚‘'], fr: ["«»", "“”"], }, }, }), ], }), ],})straight
Section titled “straight”Type: string[] | Record<string, string[]>
Default: ['"', "'"]
List of quotes to see as straight quotes.
Explaination:
The values in straight can be one or two characters.
When two, the first character determines the opening quote and the second
the closing quote at that level.
When one, both the opening and closing quote are that character.
The order in which the preferred quotes appear in their respective list
determines which quotes to use at which level of nesting.
So, to prefer " at the first level of nesting, and ' at the second,
pass: straight: ['"', "'"].
If quotes are nested deeper than the given amount of quotes, the markers
wrap around: a third level of nesting when using straight: ['«»', '‹›']
should have double guillemets, a fourth single, a fifth double again, etc.
Multilingualism:
If you want to defined different quotes for different languages, you can pass a Record<string, string[]> type, like this:
export default defineConfig({ integrations: [ starlight({ plugins: [ starlightSpellChecker({ quotes: { straight: { en: ['“”', '‘’'], de: ['„“', '‚‘'], fr: ["«»", "“”"], }, }, }), ], }), ],})