📦 eslint-plugin
ESLint is a tool that statically analyzes your code and reports problems or suggests best practices through editor hints and command line. Docusaurus provides an ESLint plugin to enforce best Docusaurus practices.
Instalação
- npm
- Yarn
- pnpm
npm install --save-dev @docusaurus/eslint-plugin
yarn add --dev @docusaurus/eslint-plugin
pnpm add --save-dev @docusaurus/eslint-plugin
Utilização
Recommended config
Add plugin:@docusaurus/recommended
to the extends
section of your .eslintrc
configuration file:
.eslintrc
{
"extends": ["plugin:@docusaurus/recommended"]
}
This will enable the @docusaurus
eslint plugin and use the recommended
config. See Supported rules below for a list of rules that this will enable.
Manual config
For more fine-grained control, you can also enable the plugin manually and configure the rules you want to use directly:
.eslintrc
{
"plugins": ["@docusaurus"],
"rules": {
"@docusaurus/string-literal-i18n-messages": "error",
"@docusaurus/no-untranslated-text": "warn"
}
}