chore(deps-dev): bump eslint-plugin-sonarjs from 2.0.4 to 3.0.0 (#10202)

* chore(deps-dev): bump eslint-plugin-sonarjs from 2.0.4 to 3.0.0

Bumps [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS) from 2.0.4 to 3.0.0.
- [Release notes](https://github.com/SonarSource/SonarJS/releases)
- [Commits](https://github.com/SonarSource/SonarJS/commits)

---
updated-dependencies:
- dependency-name: eslint-plugin-sonarjs
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2024-12-05 16:38:44 +01:00 committed by GitHub
parent 79d5e95e29
commit ac62514742
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 137 additions and 1399 deletions

View file

@ -155,7 +155,7 @@
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-redundant-undefined": "^1.0.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sonarjs": "^2.0.4",
"eslint-plugin-sonarjs": "^3.0.0",
"eslint-plugin-unicorn": "^56.0.1",
"fzstd": "^0.1.1",
"globals": "^15.13.0",

View file

@ -153,7 +153,7 @@ declare module '@podman-desktop/api' {
* @param disposables An array to which the resulting {@link Disposable} will be added.
* @return A disposable which unsubscribes the event listener.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, sonarjs/prefer-function-type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
}

View file

@ -2459,7 +2459,7 @@ test('when loading registry registerRegistry, do not push to disposables', async
source: 'fake',
serverUrl: 'http://fake',
username: 'foo',
// eslint-disable-next-line sonarjs/no-hardcoded-credentials
// eslint-disable-next-line sonarjs/no-hardcoded-passwords
password: 'bar',
secret: 'baz',
};

View file

@ -47,6 +47,7 @@ async function installExtension() {
const ociImage = imageName?.trim();
try {
const percentageMatchRegexp = RegExp(/(\d+)%/);
// download image
await window.extensionInstallFromImage(
ociImage,
@ -56,7 +57,7 @@ async function installExtension() {
// try to extract percentage from string like
// data Downloading sha256:e8d2c9e5c69499c41ba39b7828c00e55087572884cac466b4d1b47243b085c7d.tar - 11% - (55132/521578)
const percentageMatch = data.match(/(\d+)%/);
const percentageMatch = percentageMatchRegexp.exec(data);
if (percentageMatch) {
progressPercent = parseInt(percentageMatch[1]);
}

View file

@ -39,6 +39,7 @@ async function installExtension() {
}
try {
const percentageMatchRegexp = RegExp(/(\d+)%/);
// download image
await window.extensionInstallFromImage(
ociImage,
@ -48,7 +49,8 @@ async function installExtension() {
// try to extract percentage from string like
// data Downloading sha256:e8d2c9e5c69499c41ba39b7828c00e55087572884cac466b4d1b47243b085c7d.tar - 11% - (55132/521578)
const percentageMatch = data.match(/(\d+)%/);
const percentageMatch = percentageMatchRegexp.exec(data);
if (percentageMatch) {
percentage = percentageMatch[1] + '%';
}

View file

@ -87,6 +87,7 @@ function deleteBuildArg(index: number) {
}
function getTerminalCallback(): BuildImageCallback {
const imageRegexp = RegExp(/docker:\/\/(?<imageName>.*?):\s/);
return {
onStream: function (data: string): void {
logsTerminal.write(`${data}\r`);
@ -96,9 +97,9 @@ function getTerminalCallback(): BuildImageCallback {
// need to extract image from there
// it should match the pattern 'initializing source docker://registry.redhat.io/rhel9/postgresql-13:latest' and keep the value 'registry.redhat.io/rhel9/postgresql-13:latest'
const imageRegexp = buildError.match(/docker:\/\/(?<imageName>.*?):\s/);
const imageRegexpRes = imageRegexp.exec(buildError);
// if we found the image name, we should store it
const findingImageName = imageRegexp?.groups?.imageName;
const findingImageName = imageRegexpRes?.groups?.imageName;
if (findingImageName) {
buildParentImageName = findingImageName;
}

View file

@ -10,7 +10,7 @@ let moreDisplayed: boolean = false;
onMount(() => {
// add a newline before a tab or several spaces
formatted = command.replaceAll(/( +|\t+)/g, '\n$1') || '';
formatted = command.replaceAll(/( {2,}|\t+)/g, '\n$1') || '';
const lines = formatted.split('\n');
const headerLines = lines.slice(0, 2);
header = headerLines.join('\n');

View file

@ -74,7 +74,7 @@ export function isStepCompleted(
}
// check if cmp string is an onContext event, check the value from context
const matchesOnboardingPrefix = cmp.match(ONBOARDING_CONTEXT_PREFIX_REGEX);
const matchesOnboardingPrefix = RegExp(ONBOARDING_CONTEXT_PREFIX_REGEX).exec(cmp);
if (matchesOnboardingPrefix) {
if (!globalContext) {
return false;

View file

@ -40,8 +40,10 @@ let urls: Array<string> = [];
$: openingUrls = urls;
$: openingKubernetesUrls = new Map();
const portRegexp = RegExp(/:(\d+)/);
function extractPort(urlString: string) {
const match = urlString.match(/:(\d+)/);
const match = portRegexp.exec(urlString);
return match ? parseInt(match[1], 10) : undefined;
}

File diff suppressed because it is too large Load diff