From 3c8fffc064600bb384f4cdeac93bf2b33d97ae69 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Mon, 28 Mar 2022 10:42:45 -0400 Subject: [PATCH] docs: improve config example in README --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2257b493..614c637c 100644 --- a/README.md +++ b/README.md @@ -32,22 +32,22 @@ npm install eslint-plugin-eslint-plugin --save-dev ## Usage -Add `eslint-plugin` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: +Here's an example ESLint configuration that: -```json -{ - "plugins": [ - "eslint-plugin" - ] -} -``` - -Then configure the rules you want to use under the rules section. +* Sets `sourceType` to `script` for CJS plugins (most users) (use `module` for ESM/TypeScript) +* Enables the `recommended` configuration +* Enables an optional/non-recommended rule ```json { + "parserOptions": { + "sourceType": "script" + }, + "extends": [ + "plugin:eslint-plugin/recommended" + ], "rules": { - "eslint-plugin/no-deprecated-report-api": "error" + "eslint-plugin/require-meta-docs-description": "error" } } ```