From 065eae1269b2534333138df7161cc110239d85f8 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Tue, 25 Jun 2024 07:18:13 -0700 Subject: [PATCH] docs: update setup instructions --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ea7a474..443eef4 100644 --- a/README.md +++ b/README.md @@ -13,32 +13,32 @@ npm i -D eslint-plugin-depend ## Usage -Add to your `.eslintrc.json`: - -```json -{ - "extends": [ - "plugin:depend/recommended" - ] -} -``` - -Or if you're using (flat) config files, add to your `eslint.config.js`: +If you're using the new flat config files, add to your `eslint.config.js`: ```ts -import {configs} from 'eslint-plugin-depend'; +import * as depend from 'eslint-plugin-depend'; export default [ - configs['flat/recommended'], + depend.configs['flat/recommended'], // or if you want to specify `files`, or other options { - ...configs['flat/recommended'], + ...depend.configs['flat/recommended'], files: ['test/**/*.js'] } ]; ``` +For older legacy projects, add to your `.eslintrc.json`: + +```json +{ + "extends": [ + "plugin:depend/recommended" + ] +} +``` + ### With `package.json` Some rules (e.g. `ban-dependencies`) can be used against your `package.json`.