Skip to content
⚠️ This project is depricated and will be deleted and removed from NPM in 2026. 🚨

Configuration

The Starlight Spell Checker plugin can be configured inside the astro.config.mjs configuration file of your project:

astro.config.mjs
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",
}),
],
});

The Starlight Spell Checker plugin accepts the following configuration options:

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/*"],
}),
],
}),
],
})

Configuration parameters of the retext-assuming plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
phrases?: string[],
ignore?: string[],
verbose?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: string[]
Default: internal list

A list of phrases that the plugin should check against. In other words, a list of phrases to warn about.

Type: string[]
Default: []

A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.

Type: boolean
Default: false

Whether to also check for phrases that are probably fine, like "You should not simply assume".

Configuration parameters of the retext-case-police plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[]
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: 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-contractions plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignoreLiterals?: boolean,
mode?: "smart" | "straight"
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: 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.

Configuration parameters of the retext-diacritics plugin.

Type:

{
enabled?: boolean,
throwError?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

Configuration parameters of the retext-equality plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[],
binary?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: string[]
Default: []

A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.

Type: boolean
Default: false

Whether to allow phrases like "he or she", "garbagemen and garbagewomen", etc.

Configuration parameters of the retext-indefinite-article plugin.

Type:

{
enabled?: boolean,
throwError?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

Configuration parameters of the retext-intensify plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[]
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: 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-passive plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[]
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: 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-profanities plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[]
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: string[]
Default: []

A list of words that the plugin should ignore. In other words, a list of phrases not to warn about.

Type: 0 | 1 | 2
Default: 0

Minimum sureness level to warn about. See cuss for further information.

Configuration parameters of the retext-readability plugin.

Type:

{
enabled?: boolean,
throwError?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

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.

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:

Configuration parameters of the retext-redundant-acronyms plugin.

Type:

{
enabled?: boolean,
throwError?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

Configuration parameters of the retext-repeated-words plugin.

Type:

{
enabled?: boolean,
throwError?: boolean
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

Configuration parameters of the retext-simplify plugin.

Type:

{
enabled?: boolean,
throwError?: boolean,
ignore?: string[]
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: 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[]
}

Type: boolean
Default: true

Whether to enable the assuming plugin.

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: 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
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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.

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[]>
}

Type: boolean
Default: false

Whether to enable the assuming plugin.

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: ["«»", "“”"],
},
},
}),
],
}),
],
})

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: ["«»", "“”"],
},
},
}),
],
}),
],
})