Skip to content

Commit

Permalink
Include a missing file and update the docs for @rushstack/eslint-patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
iclanton committed Sep 26, 2023
1 parent 3eaac21 commit 87a0c58
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
11 changes: 11 additions & 0 deletions common/changes/@rushstack/eslint-patch/main_2023-09-26-06-27.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "",
"type": "none",
"packageName": "@rushstack/eslint-patch"
}
],
"packageName": "@rushstack/eslint-patch",
"email": "[email protected]"
}
20 changes: 19 additions & 1 deletion eslint/eslint-patch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions eslint/eslint-patch/custom-config-package-names.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('./lib/custom-config-package-names');

0 comments on commit 87a0c58

Please sign in to comment.