Docusaurus specific linting rules for eslint
You'll first need to install ESLint:
npm i -D eslint
Next, install @docusaurus/eslint-plugin
:
npm i -D @docusaurus/eslint-plugin
Add @docusaurus
to the plugins section of your .eslintrc
configuration file:
{
"plugins": ["@docusaurus"]
}
Then, you can extend one of the configs (e.g. the recommended
config):
{
"extends": ["plugin:@docusaurus/recommended"]
}
For more fine-grained control, you can also configure the rules you want to use:
{
"rules": {
"@docusaurus/no-dynamic-i18n-messages": "error",
"@docusaurus/no-untranslated-text": "warn"
}
}
- recommended
- all
- no-dynamic-i18n-messages
- no-untranslated-text