Eslint-plugin-sonarjs@3.0.1 type error with eslint@9.20.0

When using the these two plugins together, it results in a type error due to seemingly using out-of-date type information for eslint@8.x.x.

In types/plugin.d.ts:

configs: {
    recommended: Linter.FlatConfig<Linter.RulesRecord> & {
        rules: Linter.RulesRecord;
    };
    'recommended-legacy': Linter.Config<Linter.RulesRecord, Linter.RulesRecord>;
};

FlatConfig takes no template arguments and Config only takes one.

If I build the eslint plugin from the source repo, it does seem to build the proper types for eslint@9, so not sure if the package published on npm is behind from the master.

configs: {
    recommended: Linter.FlatConfig;
    'recommended-legacy': Linter.LegacyConfig<Linter.RulesRecord, Linter.RulesRecord>;
};

A similar issue seems to have been previously reported here:

However, given the package.json, it seems that eslint@9 is intended to be supported at this point, so not sure what the issue is.

Hello @kvbh ,

We just released v3.0.2 which should have proper types compatible with ESLint 9.

Can you please try and confirm it’s all good?

Cheers,
Victor

1 Like

Confirming that 3.0.2 has fixed the type issues I was seeing. Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.