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

JS-236 Add eslint-plugin-sonarjs compatibility with ESLint 9 #4758

Merged
merged 16 commits into from
Jul 23, 2024

Conversation

vdiez
Copy link
Contributor

@vdiez vdiez commented Jul 22, 2024


*/

// if (something) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

should you clean this up or is it part of S125? same for original file

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@@ -35,11 +35,12 @@
"@babel/preset-flow": "7.24.1",
"@babel/preset-react": "7.24.1",
"@eslint-community/regexpp": "4.10.0",
"@typescript-eslint/eslint-plugin": "7.7.1",
"@types/eslint": "8.56.10",
Copy link
Contributor

Choose a reason for hiding this comment

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

why move this from devDeps?

Copy link
Contributor

Choose a reason for hiding this comment

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

the exported type defintions bundled with the package depend on it

"@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.7.1",
"@typescript-eslint/utils": "7.7.1",
"@typescript-eslint/eslint-plugin": "7.16.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

it's a bit unfortunate that we have to maintain versions of @typescript-eslint/eslint-plugin and eslint-plugin-react here and in rules/

Comment on lines -63 to -70
{
code: `
const awsCdk = 'aws-cdk-lib';
import cdk = require(awsCdk); // FN
import module = cdk.aws_module;
new module.Class();
`,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

is it the result of the TSESlint update?

Copy link
Contributor

Choose a reason for hiding this comment

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

import A = require(B) is not supported anymore

@@ -22,4 +22,4 @@ import { Linter } from 'eslint';
/**
* ESLint core rules.
*/
export const eslintRules = Object.fromEntries(new Linter().getRules());
export const eslintRules = Object.fromEntries(new Linter({ configType: 'eslintrc' }).getRules());
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this do?

Copy link
Contributor

Choose a reason for hiding this comment

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

we need this when using the plugin through the Linter API

Comment on lines +686 to +690
settings: {
react: {
version: '999.999.999',
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a default value?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@@ -0,0 +1,33 @@
const { test } = require('node:test');
const assert = require('node:assert');
const spawn = require('cross-spawn');
Copy link
Contributor

Choose a reason for hiding this comment

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

why use this one?

Copy link
Contributor

Choose a reason for hiding this comment

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

needed to call npx from spawn in Windows

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the extensive explanations

@vdiez vdiez merged commit 1f76567 into master Jul 23, 2024
28 of 29 checks passed
@vdiez vdiez deleted the compat-eslint9 branch July 23, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants