-
Notifications
You must be signed in to change notification settings - Fork 181
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
Conversation
This reverts commit 16e517f.
|
||
*/ | ||
|
||
// if (something) {} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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/
{ | ||
code: ` | ||
const awsCdk = 'aws-cdk-lib'; | ||
import cdk = require(awsCdk); // FN | ||
import module = cdk.aws_module; | ||
new module.Class(); | ||
`, | ||
}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
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
settings: { | ||
react: { | ||
version: '999.999.999', | ||
}, | ||
}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use this one?
There was a problem hiding this comment.
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
There was a problem hiding this 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
Quality Gate passedIssues Measures |
Fixes https://sonarsource.atlassian.net/browse/JS-236