From 3cac07a242aebbebfd6a3aa20809c9ced1475e04 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Mon, 11 Oct 2021 11:56:25 -0400 Subject: [PATCH] docs: add example of using rule/test presets in overrides to README --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index ee5a8523..f8255661 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,23 @@ Presets are enabled by adding a line to the `extends` list in your config file. } ``` +Or to apply linting only to the appropriate rule or test files: + +```json +{ + "overrides": [ + { + "files": ["lib/rules/*.{js,ts}"], + "extends": ["plugin:eslint-plugin/rules-recommended"] + }, + { + "files": ["tests/lib/rules/*.{js,ts}"], + "extends": ["plugin:eslint-plugin/tests-recommended"] + }, + ] +} +``` + * `recommended` enables all recommended rules from this plugin. * `rules-recommended` enables all recommended rules that are aimed at linting ESLint rule files. * `tests-recommended` enables all recommended rules that are aimed at linting ESLint test files.