@quartzds/retext-preset
Shareable retext preset for Quartz design system packages.
💿 Installation
npm install --save-dev @quartzds/retext-preset
📖 Usage
import { retext } from 'retext'
import retextPresetQuartz from '@quartzds/retext-preset'
import reporter from 'vfile-reporter'
const file = await retext()
.use(retextPresetQuartz)
.process('This and and that.')
console.error(reporter(file))
Yields:
1:6-1:13 warning Expected `and` once, not twice and retext-repeated-words
⚠ 1 warning
🔧 Configuration
@quartzds/retext-preset
searches up the directory hierarchy for the following files:
.config/quartzretextrc.cjs
.config/quartzretextrc.js
.config/quartzretextrc.json
.config/quartzretextrc.yaml
.config/quartzretextrc.yml
.config/quartzretextrc
.quartzretextrc.cjs
.quartzretextrc.js
.quartzretextrc.json
.quartzretextrc.yaml
.quartzretextrc.yml
.quartzretextrc
package.json
quartzretext.config.cjs
quartzretext.config.js
When searching package.json
files, the quartzretext
property will be
loaded. See the cosmiconfig documentation for more details about
configuration resolution.
The configuration loaded is expected to contain only the following options:
export type PresetConfig = {
spell: {
dictionary: Dictionary
ignore: string[]
ignoreDigits: boolean
ignoreLiteral: boolean
max: number
personal: string | Uint8Array
}
simplify: {
ignore: string[]
}
}
See the retext-spell and retext-simplify documentation for more information about these options.
⚖️ License
See the LICENSE file for license rights and limitations.