Skip to content

Commit

Permalink
docs: Document extending plugin with new config
Browse files Browse the repository at this point in the history
Document how to extend a plugin configuration using the new ESLint configuration file type system.

Fixes #16310
  • Loading branch information
bpmutter committed Oct 7, 2022
1 parent 8476a9b commit 0ab69e0
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion docs/src/user-guide/configuring/configuration-files-new.md
Expand Up @@ -329,7 +329,36 @@ For historical reasons, the boolean value `false` and the string value `"readabl

### Using plugins in your configuration

Plugins are used to share rules, processors, configurations, parsers, and more across ESLint projects. Plugins are specified in a configuration object using the `plugins` key, which is an object where the name of the plugin is the property name and the value is the plugin object itself. Here's an example:
Plugins are used to share rules, processors, configurations, parsers, and more across ESLint projects.

#### Using configurations included in plugins

You can use a configuration included in a plugin by adding that configuration
directly to the `eslint.config.js` configurations array.
Often, you do this for a plugin's recommended configuration. Here's an example:

```js
import jsdoc from "eslint-plugin-jsdoc";

export default [
jsdoc.configs.recommended,
// ... other configuration objects
];
/*
The above code is equivalent to the following configuration using the legacy .eslintrc
configuration system:
{
"extends": ["plugin:jsdoc/recommended"]
}
*/
```

#### Using plugin rules

You can use specific rules included in a plugin. To do this, specify the plugin
in a configuration object using the `plugins` key. The value for the `plugin` key
is an object where the name of the plugin is the property name and the value is the plugin object itself. Here's an example:

```js
import jsdoc from "eslint-plugin-jsdoc";
Expand Down

0 comments on commit 0ab69e0

Please sign in to comment.