Skip to content

chore: use defineConfig and globalIgnores in ESLint config #93

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lumirlumir
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

Hello,

I've updated ESLint config file to use defineConfig and globalIgnores which was added recently, and I also bumped ESLint to the latest version.

What changes did you make? (Give an overview)

Related Issues

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

@lumirlumir lumirlumir mentioned this pull request Apr 26, 2025
17 tasks
@lumirlumir lumirlumir requested a review from mdjermanovic April 26, 2025 10:53
@@ -41,7 +40,7 @@ export default [
files: ["**/*.json"],
ignores: ["**/package-lock.json"],
language: "json/json",
...json.configs.recommended,
extends: [json.configs.recommended],
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the string version here.

Suggested change
extends: [json.configs.recommended],
extends: ["json/recommended"],

Copy link
Contributor Author

@lumirlumir lumirlumir Apr 30, 2025

Choose a reason for hiding this comment

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

@nzakas

import json from "./src/index.js";

Thank you for your suggestion! Unfortunately, however, json is imported directly from ./src/index.js, string version causes an error when running ESLint, as shown below:

TypeError: Plugin "json" not found.
    at findPluginConfig (path)
    at path
    at Array.map (<anonymous>)
    at processExtends (path)
    at path
    at Array.flatMap (<anonymous>)
    at processConfigList (path)
    at defineConfig (path)
    at path
    at ModuleJob.run (node:internal/modules/esm/module_job:234:25)

It seems like this error is happening because @eslint/json isn’t present in node_modules.

Would it be alright to leave it as it is?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, you'd also need to include:

{
    plugins: { json }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants