Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eslint-patch] Include a missing file and update the docs for @rushstack/eslint-patch. #4356

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');