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

feat: Add loadESLint() API method for v8 #18098

Merged
merged 7 commits into from
Feb 14, 2024
Merged

feat: Add loadESLint() API method for v8 #18098

merged 7 commits into from
Feb 14, 2024

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Feb 9, 2024

Note: Intentionally sent to v8.x branch.

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

  • Added the loadESLint() method to the public API.
  • Updated the shouldUseFlatConfig() function accept an optional cwd argument.
  • Added configType to both ESLint and FlatESLint.
  • Added tests for all of the above.
  • Added docs to the Node.js API document.

refs #18075

Is there anything you'd like reviewers to focus on?

@nzakas nzakas requested a review from a team as a code owner February 9, 2024 00:26
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Feb 9, 2024
Copy link

netlify bot commented Feb 9, 2024

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 96dedf2
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/65cbaa32153a0e00071ead38

@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Feb 9, 2024
Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I'll leave it open for others to review.

tests/lib/api.js Outdated Show resolved Hide resolved
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
tests/lib/api.js Outdated Show resolved Hide resolved
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 1120b9b into v8.x Feb 14, 2024
20 checks passed
@mdjermanovic mdjermanovic deleted the load-eslint-v8x branch February 14, 2024 08:49
Vylpes pushed a commit to Vylpes/Droplet that referenced this pull request Apr 10, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.56.0` -> `8.57.0`](https://renovatebot.com/diffs/npm/eslint/8.56.0/8.57.0) |
| [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`8.56.2` -> `8.56.6`](https://renovatebot.com/diffs/npm/@types%2feslint/8.56.2/8.56.6) |

---

### Release Notes

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v8.57.0`](https://github.com/eslint/eslint/releases/tag/v8.57.0)

[Compare Source](eslint/eslint@v8.56.0...v8.57.0)

#### Features

-   [`1120b9b`](eslint/eslint@1120b9b) feat: Add loadESLint() API method for v8 ([#&#8203;18098](eslint/eslint#18098)) (Nicholas C. Zakas)
-   [`dca7d0f`](eslint/eslint@dca7d0f) feat: Enable `eslint.config.mjs` and `eslint.config.cjs` ([#&#8203;18066](eslint/eslint#18066)) (Nitin Kumar)

#### Bug Fixes

-   [`2196d97`](eslint/eslint@2196d97) fix: handle absolute file paths in `FlatRuleTester` ([#&#8203;18064](eslint/eslint#18064)) (Nitin Kumar)
-   [`69dd1d1`](eslint/eslint@69dd1d1) fix: Ensure config keys are printed for config errors ([#&#8203;18067](eslint/eslint#18067)) (Nitin Kumar)
-   [`9852a31`](eslint/eslint@9852a31) fix: deep merge behavior in flat config ([#&#8203;18065](eslint/eslint#18065)) (Nitin Kumar)
-   [`4c7e9b0`](eslint/eslint@4c7e9b0) fix: allow circular references in config ([#&#8203;18056](eslint/eslint#18056)) (Milos Djermanovic)

#### Documentation

-   [`84922d0`](eslint/eslint@84922d0) docs: Show prerelease version in dropdown ([#&#8203;18139](eslint/eslint#18139)) (Nicholas C. Zakas)
-   [`5b8c363`](eslint/eslint@5b8c363) docs: Switch to Ethical Ads ([#&#8203;18117](eslint/eslint#18117)) (Milos Djermanovic)
-   [`77dbfd9`](eslint/eslint@77dbfd9) docs: show NEXT in version selectors ([#&#8203;18052](eslint/eslint#18052)) (Milos Djermanovic)

#### Chores

-   [`1813aec`](eslint/eslint@1813aec) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)[@&#8203;8](https://github.com/8).57.0 ([#&#8203;18143](eslint/eslint#18143)) (Milos Djermanovic)
-   [`5c356bb`](eslint/eslint@5c356bb) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`f4a1fe2`](eslint/eslint@f4a1fe2) test: add more tests for ignoring files and directories ([#&#8203;18068](eslint/eslint#18068)) (Nitin Kumar)
-   [`42c0aef`](eslint/eslint@42c0aef) ci: Enable CI for `v8.x` branch ([#&#8203;18047](eslint/eslint#18047)) (Milos Djermanovic)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/Droplet/pulls/295
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
Vylpes pushed a commit to Vylpes/card-drop that referenced this pull request Apr 10, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.56.0` -> `8.57.0`](https://renovatebot.com/diffs/npm/eslint/8.56.0/8.57.0) |

---

### Release Notes

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v8.57.0`](https://github.com/eslint/eslint/releases/tag/v8.57.0)

[Compare Source](eslint/eslint@v8.56.0...v8.57.0)

#### Features

-   [`1120b9b`](eslint/eslint@1120b9b) feat: Add loadESLint() API method for v8 ([#&#8203;18098](eslint/eslint#18098)) (Nicholas C. Zakas)
-   [`dca7d0f`](eslint/eslint@dca7d0f) feat: Enable `eslint.config.mjs` and `eslint.config.cjs` ([#&#8203;18066](eslint/eslint#18066)) (Nitin Kumar)

#### Bug Fixes

-   [`2196d97`](eslint/eslint@2196d97) fix: handle absolute file paths in `FlatRuleTester` ([#&#8203;18064](eslint/eslint#18064)) (Nitin Kumar)
-   [`69dd1d1`](eslint/eslint@69dd1d1) fix: Ensure config keys are printed for config errors ([#&#8203;18067](eslint/eslint#18067)) (Nitin Kumar)
-   [`9852a31`](eslint/eslint@9852a31) fix: deep merge behavior in flat config ([#&#8203;18065](eslint/eslint#18065)) (Nitin Kumar)
-   [`4c7e9b0`](eslint/eslint@4c7e9b0) fix: allow circular references in config ([#&#8203;18056](eslint/eslint#18056)) (Milos Djermanovic)

#### Documentation

-   [`84922d0`](eslint/eslint@84922d0) docs: Show prerelease version in dropdown ([#&#8203;18139](eslint/eslint#18139)) (Nicholas C. Zakas)
-   [`5b8c363`](eslint/eslint@5b8c363) docs: Switch to Ethical Ads ([#&#8203;18117](eslint/eslint#18117)) (Milos Djermanovic)
-   [`77dbfd9`](eslint/eslint@77dbfd9) docs: show NEXT in version selectors ([#&#8203;18052](eslint/eslint#18052)) (Milos Djermanovic)

#### Chores

-   [`1813aec`](eslint/eslint@1813aec) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)[@&#8203;8](https://github.com/8).57.0 ([#&#8203;18143](eslint/eslint#18143)) (Milos Djermanovic)
-   [`5c356bb`](eslint/eslint@5c356bb) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`f4a1fe2`](eslint/eslint@f4a1fe2) test: add more tests for ignoring files and directories ([#&#8203;18068](eslint/eslint#18068)) (Nitin Kumar)
-   [`42c0aef`](eslint/eslint@42c0aef) ci: Enable CI for `v8.x` branch ([#&#8203;18047](eslint/eslint#18047)) (Milos Djermanovic)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/186
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
Vylpes pushed a commit to Vylpes/random-bunny that referenced this pull request Apr 10, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.56.0` -> `8.57.0`](https://renovatebot.com/diffs/npm/eslint/8.56.0/8.57.0) |
| [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`8.56.2` -> `8.56.3`](https://renovatebot.com/diffs/npm/@types%2feslint/8.56.2/8.56.3) |

---

### Release Notes

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v8.57.0`](https://github.com/eslint/eslint/releases/tag/v8.57.0)

[Compare Source](eslint/eslint@v8.56.0...v8.57.0)

#### Features

-   [`1120b9b`](eslint/eslint@1120b9b) feat: Add loadESLint() API method for v8 ([#&#8203;18098](eslint/eslint#18098)) (Nicholas C. Zakas)
-   [`dca7d0f`](eslint/eslint@dca7d0f) feat: Enable `eslint.config.mjs` and `eslint.config.cjs` ([#&#8203;18066](eslint/eslint#18066)) (Nitin Kumar)

#### Bug Fixes

-   [`2196d97`](eslint/eslint@2196d97) fix: handle absolute file paths in `FlatRuleTester` ([#&#8203;18064](eslint/eslint#18064)) (Nitin Kumar)
-   [`69dd1d1`](eslint/eslint@69dd1d1) fix: Ensure config keys are printed for config errors ([#&#8203;18067](eslint/eslint#18067)) (Nitin Kumar)
-   [`9852a31`](eslint/eslint@9852a31) fix: deep merge behavior in flat config ([#&#8203;18065](eslint/eslint#18065)) (Nitin Kumar)
-   [`4c7e9b0`](eslint/eslint@4c7e9b0) fix: allow circular references in config ([#&#8203;18056](eslint/eslint#18056)) (Milos Djermanovic)

#### Documentation

-   [`84922d0`](eslint/eslint@84922d0) docs: Show prerelease version in dropdown ([#&#8203;18139](eslint/eslint#18139)) (Nicholas C. Zakas)
-   [`5b8c363`](eslint/eslint@5b8c363) docs: Switch to Ethical Ads ([#&#8203;18117](eslint/eslint#18117)) (Milos Djermanovic)
-   [`77dbfd9`](eslint/eslint@77dbfd9) docs: show NEXT in version selectors ([#&#8203;18052](eslint/eslint#18052)) (Milos Djermanovic)

#### Chores

-   [`1813aec`](eslint/eslint@1813aec) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)[@&#8203;8](https://github.com/8).57.0 ([#&#8203;18143](eslint/eslint#18143)) (Milos Djermanovic)
-   [`5c356bb`](eslint/eslint@5c356bb) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
-   [`f4a1fe2`](eslint/eslint@f4a1fe2) test: add more tests for ignoring files and directories ([#&#8203;18068](eslint/eslint#18068)) (Nitin Kumar)
-   [`42c0aef`](eslint/eslint@42c0aef) ci: Enable CI for `v8.x` branch ([#&#8203;18047](eslint/eslint#18047)) (Milos Djermanovic)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/random-bunny/pulls/150
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Aug 13, 2024
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion feature This change adds a new feature to ESLint
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants