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

Make the ESLint plugin compatible with the last ESLint versions with flat configurations #50

Open
AMorgaut opened this issue Aug 21, 2024 · 4 comments · May be fixed by #51
Open

Make the ESLint plugin compatible with the last ESLint versions with flat configurations #50

AMorgaut opened this issue Aug 21, 2024 · 4 comments · May be fixed by #51
Assignees
Labels
🚀 enhancement New feature or request

Comments

@AMorgaut
Copy link

Current Behavior

The plugin ESLint plugin is not compatible with the latest ESLint versions which requires flat configuration

Expected Behavior

It should be possible to integrate the Ecocode ESLint config into projects using recent ESLint versions which don't support .eslintrc config file anymore but require an eslint.config.json file with flat configurations

Steps to Reproduce

  1. update a project to ESLint 8.23
  2. run ESLint

Failure Logs

No response

ecoCode-javascript Version

1.15

SonarQube Version

N/A

Additional Information

The plugin should follow the ESLint migration guide
https://eslint.org/docs/latest/extend/plugin-migration-flat-config

@AMorgaut AMorgaut added the 💉 bug: unconfirmed Potential bugs that need replicating to verify. label Aug 21, 2024
@AMorgaut
Copy link
Author

A working patch was made in ecocode dashboard

// patch ecocode plugin for flat config support
// see https://eslint.org/docs/latest/extend/plugin-migration-flat-config
if (!ecocode.configs['flat/recommended'])  {
    ecocode.meta = {
      name: "@ecocode/eslint-plugin",
      version: "1.5.0"
    }
    ecocode.configs['flat/recommended'] = {
      plugins: {
        '@ecocode': ecocode
      },
      rules: ecocode.configs.recommended.rules,
    };
}

https://github.com/green-code-initiative/ecoCode-dashboard/blob/bb845d5bc36f4ab8f12506fd998ba9720ed0a9df/eslint.config.js#L23

@AMorgaut AMorgaut linked a pull request Aug 21, 2024 that will close this issue
@AMorgaut
Copy link
Author

AMorgaut commented Aug 21, 2024

Created the pull request #51 which will need to be tested

@utarwyn utarwyn added 🚀 enhancement New feature or request and removed 💉 bug: unconfirmed Potential bugs that need replicating to verify. labels Sep 13, 2024
@hrenaud
Copy link

hrenaud commented Oct 9, 2024

Hello @utarwyn. Is this PR will be merged soon?

@utarwyn utarwyn linked a pull request Oct 14, 2024 that will close this issue
@utarwyn
Copy link
Member

utarwyn commented Oct 14, 2024

@hrenaud
Hello utarwyn. Is this PR will be merged soon?

Hello! Sorry for my lack of responsiveness on this topic, I've been really busy lately.
I have left comments on the associated PR 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants