From 87a0c58f4df32979a323c35f9ccea803daf78988 Mon Sep 17 00:00:00 2001 From: Ian Clanton-Thuon Date: Mon, 25 Sep 2023 23:27:43 -0700 Subject: [PATCH] Include a missing file and update the docs for @rushstack/eslint-patch. --- .../eslint-patch/main_2023-09-26-06-27.json | 11 ++++++++++ eslint/eslint-patch/README.md | 20 ++++++++++++++++++- .../custom-config-package-names.js | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 common/changes/@rushstack/eslint-patch/main_2023-09-26-06-27.json create mode 100644 eslint/eslint-patch/custom-config-package-names.js diff --git a/common/changes/@rushstack/eslint-patch/main_2023-09-26-06-27.json b/common/changes/@rushstack/eslint-patch/main_2023-09-26-06-27.json new file mode 100644 index 00000000000..6a61cc13329 --- /dev/null +++ b/common/changes/@rushstack/eslint-patch/main_2023-09-26-06-27.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "", + "type": "none", + "packageName": "@rushstack/eslint-patch" + } + ], + "packageName": "@rushstack/eslint-patch", + "email": "iclanton@users.noreply.github.com" +} \ No newline at end of file diff --git a/eslint/eslint-patch/README.md b/eslint/eslint-patch/README.md index 623b88bff01..0b50bfc8b0d 100644 --- a/eslint/eslint-patch/README.md +++ b/eslint/eslint-patch/README.md @@ -55,7 +55,25 @@ This patch works by modifying the ESLint engine so that its module resolver will the referencing config file, rather than the project folder. The patch is compatible with ESLint 6, 7, and 8. It also works with any editor extensions that load ESLint as a library. -For an even leaner setup, `@your-company/eslint-config` can provide the patch as its own dependency. See +There is a second patch in this package that removes the restriction on eslint configuration package names. +Similarly to the first, this patch is applied by adding a `require()` call to the top of the **.eslintrc.js**, +for example: + +**.eslintrc.js** +```ts +require("@rushstack/eslint-patch/modern-module-resolution"); +require("@rushstack/eslint-patch/custom-config-package-names"); // <-- Add this line + +// Add your "extends" boilerplate here, for example: +module.exports = { + extends: [ + '@your-company/build-rig/profile/default/includes/eslint/node' // Notice the package name does not start with "eslint-config-" + ], + parserOptions: { tsconfigRootDir: __dirname } +}; +``` + +For an even leaner setup, `@your-company/eslint-config` can provide the patches as its own dependency. See [@rushstack/eslint-config](https://www.npmjs.com/package/@rushstack/eslint-config) for a real world example and recommended approach. diff --git a/eslint/eslint-patch/custom-config-package-names.js b/eslint/eslint-patch/custom-config-package-names.js new file mode 100644 index 00000000000..8897e869792 --- /dev/null +++ b/eslint/eslint-patch/custom-config-package-names.js @@ -0,0 +1 @@ +require('./lib/custom-config-package-names');