Eslint-plugin-sonarjs v2 changes

Is there a secret decoder ring somewhere to the changes between eslint-plugin-sonarjs versions? Especially the changes between v1.0.4 and v2.0.0. This included moving to everything to the SonarJS repository, a major restructuring of the rules afterwards, and from examining the source code of the installed modules it adds several hundred new rules. But, all of this change was released to NPM without any tags or release notes in the repository (that I can find), which makes it pretty frustrating to sort out how to upgrade - is it just new rules, were there changes to existing rules, etc.

Hello @aarongoldenthal,

thank you for the feedback. Indeed the communication has been lacking, the only notice was in the old repository.

There are no changes in rules that already existed in the old repository. The main change is that the ESLint plugin will now include all rules from SonarJS instead, not only a subset as it was with v1. The full list of rules in available in the README of the SonarJS folder for ESLint plugin

We are aware of some issues with version 2, and we are working on them.

Sorry for the inconvenience.

Thanks for the clarification Victor

1 Like

Is there a specific plan to add a changelog to the new plugin home ? 2.0.3 was released 3 days ago and I have no idea what, if anything, it fixed.

Through the years this has been one of my favorite eslint plugins as the rules were well thought through and added actual value. But… this repository consolidation, issue move, SonarJS release process without any correlation to the eslint plugin releases, no changelog or release notes - is such a disaster that I’m pulling it from every config because I have lost all confidence.

Hello @Avasam and @aarongoldenthal,

2.0.3 was mainly fixing incompatibilities with ESLint v9 and typescript-eslint v8.

We know we are lacking in terms of changelog, so we will tackle this ASAP [ESLINTJS-55] - Jira

We are sorry for the problems this migration has created. We are still working on improving the situation for all users.

Cheers

2 Likes

Just for your info, these were the changes for version 2.0.3:

https://sonarsource.atlassian.net/issues/?jql=project%20=%2011227%20AND%20fixVersion=15978%20ORDER%20BY%20priority%20DESC,%20key%20ASC

2 Likes

Hello! Please update @typescript-eslint/type-utils to the latest 8.x.x version, as current version still relies on eslint v8 and cause incompatibility warnings.

Hello @Alex_Green,

sadly we cannot yet update to v8 as SonarJS still relies on ESLint 8. We are still blocked by some of our dependencies that have not yet migrated to Eslint 9.

Hopefully, we can update later this year. In the meantime, we are in this not-ideal middle ground between Eslint 8 and 9 (and typescript-eslint 7 and 8).

Cheers,
Victor

2 Likes

Hello!

I don’t think it’s blocking update because typescript-eslint V8 support eslint V8 and eslint V9 at the same time

Hello @Vadim_Goy1,

This will come, but the migration will be done when SonarJS moves to ESLint 9, it will be part of the same effort.

SonarJS (the SonarQube engine, not the eslint plugin) still uses ESLint 8 and typescript-eslint 7. Although you are correct that we could use typescript-eslint 8 and keep using ESLint 8, there are many links between them to make them independently without repeating the work. Some rules for which we modify their behavior have been removed from typescript-eslint 8, based on decisions made on ESLint 9, like the deprecation of formatting rules. We believe is better to tackle both upgrades at the same time.

Cheers

2 Likes