From 1954ba4b8a1bb2377bae4b6341848c99d9bdea8d Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 16 Nov 2023 16:56:52 +0100 Subject: [PATCH 1/8] Add prettier as pre-commit hook --- .cirrus.yml | 8 +- .husky/pre-commit | 4 + .prettierignore | 4 + docs/CONTRIBUTING.md | 12 +- docs/RELEASING.md | 6 +- docs/rules/cognitive-complexity.md | 2 +- docs/rules/elseif-without-else.md | 3 +- docs/rules/no-all-duplicated-branches.md | 7 +- docs/rules/no-collection-size-mischeck.md | 2 +- docs/rules/no-duplicate-string.md | 5 +- docs/rules/no-element-overwrite.md | 8 +- docs/rules/no-empty-collection.md | 6 +- docs/rules/no-extra-arguments.md | 4 +- docs/rules/no-gratuitous-expressions.md | 3 +- docs/rules/no-identical-conditions.md | 12 +- docs/rules/no-identical-expressions.md | 21 +- docs/rules/no-identical-functions.md | 3 +- docs/rules/no-inverted-boolean-check.md | 2 +- docs/rules/no-nested-switch.md | 16 +- docs/rules/no-nested-template-literals.md | 6 +- docs/rules/no-one-iteration-loop.md | 2 +- docs/rules/no-redundant-boolean.md | 25 +- docs/rules/no-redundant-jump.md | 6 +- docs/rules/no-same-line-conditional.md | 8 +- docs/rules/no-unused-collection.md | 2 +- docs/rules/no-use-of-empty-return-value.md | 4 +- docs/rules/no-useless-catch.md | 3 +- docs/rules/non-existent-operator.md | 10 +- docs/rules/prefer-immediate-return.md | 2 +- docs/rules/prefer-object-literal.md | 16 +- docs/rules/prefer-single-boolean-return.md | 2 +- docs/rules/prefer-while.md | 10 +- package-lock.json | 1147 +++++++++++--------- package.json | 17 +- ruling/.eslintrc.js | 21 +- ruling/index.ts | 81 +- scripts/generate-rules-sonar-meta.ts | 35 +- 37 files changed, 870 insertions(+), 655 deletions(-) create mode 100644 .husky/pre-commit create mode 100644 .prettierignore diff --git a/.cirrus.yml b/.cirrus.yml index 15f502ef..5d500ce8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,8 +5,8 @@ env: SONAR_TOKEN: VAULT[development/kv/data/sonarcloud data.token] ARTIFACTORY_URL: https://repox.jfrog.io/ - ARTIFACTORY_DEPLOY_ACCESS_TOKEN : VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token] - ARTIFACTORY_PROMOTE_ACCESS_TOKEN : VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token] + ARTIFACTORY_DEPLOY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token] + ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token] # Use bash (instead of sh on linux or cmd.exe on windows) CIRRUS_SHELL: bash @@ -75,7 +75,7 @@ ws_scan_task: folder: ${CIRRUS_WORKING_DIR}/.m2/repository whitesource_script: - ./scripts/run_ws_scan.sh - allow_failures: "true" + allow_failures: 'true' always: ws_artifacts: - path: "whitesource/**/*" + path: 'whitesource/**/*' diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 00000000..3e1cef88 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run precommit diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..2d4945a5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +.github +coverage +lib +javascript-test-sources diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 95694cb9..63299bd1 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -8,12 +8,12 @@ Report bugs and suggest improvements. If something doesn't work well for you or ## Create New Rule -* Create a new file for the rule implementation in `src/rules`. File name should be lowercased, words must be separated by dashes (`-`). -* Create a test file `.test.ts` in `test/rules`. -* Add the rule to `src/index.ts`. -* In folder `docs/rules` create a rule documentation file `.md` -* In `README.md` add a reference to this documentation file. -* Run [Ruling](#ruling) test. +- Create a new file for the rule implementation in `src/rules`. File name should be lowercased, words must be separated by dashes (`-`). +- Create a test file `.test.ts` in `test/rules`. +- Add the rule to `src/index.ts`. +- In folder `docs/rules` create a rule documentation file `.md` +- In `README.md` add a reference to this documentation file. +- Run [Ruling](#ruling) test. ## Testing diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 09e12b6d..4f6c7012 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -1,5 +1,5 @@ ## Releasing npm package -* [Create a Jira release ticket](https://jira.sonarsource.com/projects/REL) like [this one](https://sonarsource.atlassian.net/browse/REL-2313) -* [Publish a new GitHub release](https://github.com/SonarSource/eslint-plugin-sonarjs/releases/new) -* [Bump the package version for the next development iteration](https://github.com/SonarSource/eslint-plugin-sonarjs/pull/418/files) +- [Create a Jira release ticket](https://jira.sonarsource.com/projects/REL) like [this one](https://sonarsource.atlassian.net/browse/REL-2313) +- [Publish a new GitHub release](https://github.com/SonarSource/eslint-plugin-sonarjs/releases/new) +- [Bump the package version for the next development iteration](https://github.com/SonarSource/eslint-plugin-sonarjs/pull/418/files) diff --git a/docs/rules/cognitive-complexity.md b/docs/rules/cognitive-complexity.md index b4acf5f5..653818f3 100644 --- a/docs/rules/cognitive-complexity.md +++ b/docs/rules/cognitive-complexity.md @@ -4,7 +4,7 @@ Cognitive Complexity is a measure of how hard the control flow of a function is ## See -* [Cognitive Complexity](http://redirect.sonarsource.com/doc/cognitive-complexity.html) +- [Cognitive Complexity](http://redirect.sonarsource.com/doc/cognitive-complexity.html) ## Configuration diff --git a/docs/rules/elseif-without-else.md b/docs/rules/elseif-without-else.md index 9e9e693a..ce0009a6 100644 --- a/docs/rules/elseif-without-else.md +++ b/docs/rules/elseif-without-else.md @@ -15,6 +15,7 @@ if (x == 0) { doSomethingElse(); } ``` + ## Compliant Solution ```javascript @@ -23,7 +24,7 @@ if (x == 0) { } else if (x == 1) { doSomethingElse(); } else { - throw "Unexpected value for x"; + throw 'Unexpected value for x'; } ``` diff --git a/docs/rules/no-all-duplicated-branches.md b/docs/rules/no-all-duplicated-branches.md index c11a8328..8e691dd5 100644 --- a/docs/rules/no-all-duplicated-branches.md +++ b/docs/rules/no-all-duplicated-branches.md @@ -8,7 +8,8 @@ or there shouldn't be a `switch`/`if` chain at all. Note that this rule does not ## Noncompliant Code Example ```javascript -if (b == 0) { // Noncompliant +if (b == 0) { + // Noncompliant doOneMoreThing(); } else { doOneMoreThing(); @@ -16,7 +17,9 @@ if (b == 0) { // Noncompliant let a = b === 0 ? getValue() : getValue(); // Noncompliant -switch (i) { // Noncompliant +switch ( + i // Noncompliant +) { case 1: doSomething(); break; diff --git a/docs/rules/no-collection-size-mischeck.md b/docs/rules/no-collection-size-mischeck.md index 20040e2a..e60b63cb 100644 --- a/docs/rules/no-collection-size-mischeck.md +++ b/docs/rules/no-collection-size-mischeck.md @@ -1,6 +1,6 @@ # no-collection-size-mischeck -:wrench: *fixable* +:wrench: _fixable_ The size of a collection and the length of an array are always greater than or equal to zero. So testing that a size or length is greater than or equal to zero doesn't make sense, since the result is always `true`. Similarly testing that it is less than zero will always return `false`. Perhaps the intent was to check the non-emptiness of the collection or array instead. diff --git a/docs/rules/no-duplicate-string.md b/docs/rules/no-duplicate-string.md index 65a3964f..71949415 100644 --- a/docs/rules/no-duplicate-string.md +++ b/docs/rules/no-duplicate-string.md @@ -1,9 +1,11 @@ # no-duplicate-string + Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences. On the other hand, constants can be referenced from many places, but only need to be updated in a single place. ## Exceptions -To prevent generating some false-positives, literals having less than 10 characters are excluded as well as literals matching /^\w*$/. String literals inside import/export statements are also ignored. The same goes for statement-like string literals, e.g. `'use strict';` + +To prevent generating some false-positives, literals having less than 10 characters are excluded as well as literals matching /^\w\*$/. String literals inside import/export statements are also ignored. The same goes for statement-like string literals, e.g. `'use strict';` ## Configuration @@ -23,3 +25,4 @@ Comma-separated list of strings that must be ignored. Default is `"application/j "no-duplicate-string": "error", "no-duplicate-string": ["error", { "ignoreStrings": "foo,bar,baz" }] } +``` diff --git a/docs/rules/no-element-overwrite.md b/docs/rules/no-element-overwrite.md index 264e0339..e870ee13 100644 --- a/docs/rules/no-element-overwrite.md +++ b/docs/rules/no-element-overwrite.md @@ -5,11 +5,11 @@ It is highly suspicious when a value is saved for a key or index and then uncond ## Noncompliant Code Example ```javascript -fruits[1] = "banana"; -fruits[1] = "apple"; // Noncompliant - value on index 1 is overwritten +fruits[1] = 'banana'; +fruits[1] = 'apple'; // Noncompliant - value on index 1 is overwritten -myMap.set("key", 1); -myMap.set("key", 2); // Noncompliant - value for key "key" is replaced +myMap.set('key', 1); +myMap.set('key', 2); // Noncompliant - value for key "key" is replaced mySet.add(1); mySet.add(1); // Noncompliant - element is already in the set diff --git a/docs/rules/no-empty-collection.md b/docs/rules/no-empty-collection.md index af541917..f4380c21 100644 --- a/docs/rules/no-empty-collection.md +++ b/docs/rules/no-empty-collection.md @@ -7,9 +7,11 @@ When a collection is empty it makes no sense to access or iterate it. Doing so a ```javascript let strings = []; -if (strings.includes("foo")) {} // Noncompliant +if (strings.includes('foo')) { +} // Noncompliant -for (str of strings) {} // Noncompliant +for (str of strings) { +} // Noncompliant strings.forEach(str => doSomething(str)); // Noncompliant ``` diff --git a/docs/rules/no-extra-arguments.md b/docs/rules/no-extra-arguments.md index 862fb75a..e287142e 100644 --- a/docs/rules/no-extra-arguments.md +++ b/docs/rules/no-extra-arguments.md @@ -6,10 +6,10 @@ You can easily call a JavaScript function with more arguments than the function ```javascript function say(a, b) { - print(a + " " + b); + print(a + ' ' + b); } -say("hello", "world", "!"); // Noncompliant; last argument is not used +say('hello', 'world', '!'); // Noncompliant; last argument is not used ``` ## Exceptions diff --git a/docs/rules/no-gratuitous-expressions.md b/docs/rules/no-gratuitous-expressions.md index db8abbd4..0c2b540f 100644 --- a/docs/rules/no-gratuitous-expressions.md +++ b/docs/rules/no-gratuitous-expressions.md @@ -7,7 +7,8 @@ because it does not match the programmer’s intent, then it’s a bug and the e ```javascript if (a) { - if (a) { // Noncompliant + if (a) { + // Noncompliant doSomething(); } } diff --git a/docs/rules/no-identical-conditions.md b/docs/rules/no-identical-conditions.md index 9081239c..8c2f9029 100644 --- a/docs/rules/no-identical-conditions.md +++ b/docs/rules/no-identical-conditions.md @@ -14,7 +14,8 @@ if (param == 1) { openWindow(); } else if (param == 2) { closeWindow(); -} else if (param == 1) { // Noncompliant +} else if (param == 1) { + // Noncompliant moveWindowToTheBackground(); } @@ -34,12 +35,9 @@ switch (param) { ## Compliant Solution ```javascript -if (param == 1) - openWindow(); -else if (param == 2) - closeWindow(); -else if (param == 3) - moveWindowToTheBackground(); +if (param == 1) openWindow(); +else if (param == 2) closeWindow(); +else if (param == 3) moveWindowToTheBackground(); switch (param) { case 1: diff --git a/docs/rules/no-identical-expressions.md b/docs/rules/no-identical-expressions.md index 4db93663..05cf9854 100644 --- a/docs/rules/no-identical-expressions.md +++ b/docs/rules/no-identical-expressions.md @@ -1,9 +1,9 @@ # no-identical-expressions -Using the same value on either side of a binary operator is almost always a mistake. In the case -of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted -code, and should be simplified. In the case of bitwise operators and most binary mathematical -operators, having the same value on both sides of an operator yields predictable results, and +Using the same value on either side of a binary operator is almost always a mistake. In the case +of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted +code, and should be simplified. In the case of bitwise operators and most binary mathematical +operators, having the same value on both sides of an operator yields predictable results, and should be simplified. This rule ignores `*`, `+`, and `=`. @@ -11,10 +11,12 @@ This rule ignores `*`, `+`, and `=`. ## Noncompliant Code Example ```javascript -if (a == b && a == b) { // if the first one is true, the second one is too +if (a == b && a == b) { + // if the first one is true, the second one is too doX(); } -if (a > a) { // always false +if (a > a) { + // always false doW(); } @@ -31,10 +33,11 @@ Similarly, left-shifting 1 onto 1 is common in the construction of bit masks, an Moreover comma operator , and `instanceof` operator are ignored as there are use-cases when there usage is valid. ```javascript -if (f !== f) { // test for NaN value - console.log("f is NaN"); +if (f !== f) { + // test for NaN value + console.log('f is NaN'); } var i = 1 << 1; // Compliant var j = a << a; // Noncompliant -``` \ No newline at end of file +``` diff --git a/docs/rules/no-identical-functions.md b/docs/rules/no-identical-functions.md index a88e628e..a1287368 100644 --- a/docs/rules/no-identical-functions.md +++ b/docs/rules/no-identical-functions.md @@ -12,7 +12,8 @@ function calculateCode() { return code; } -function getName() { // Noncompliant +function getName() { + // Noncompliant doTheThing(); doOtherThing(); return code; diff --git a/docs/rules/no-inverted-boolean-check.md b/docs/rules/no-inverted-boolean-check.md index 8c7e6fd7..249e8a88 100644 --- a/docs/rules/no-inverted-boolean-check.md +++ b/docs/rules/no-inverted-boolean-check.md @@ -1,6 +1,6 @@ # no-inverted-boolean-check -:wrench: *fixable* +:wrench: _fixable_ It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead. diff --git a/docs/rules/no-nested-switch.md b/docs/rules/no-nested-switch.md index 6a314663..7b09f063 100644 --- a/docs/rules/no-nested-switch.md +++ b/docs/rules/no-nested-switch.md @@ -10,13 +10,15 @@ Specifically, you should structure your code to avoid the need for nested `switc function foo(n, m) { switch (n) { case 0: - switch (m) { // Noncompliant; nested switch + switch ( + m // Noncompliant; nested switch // ... + ) { } case 1: - // ... + // ... default: - // ... + // ... } } ``` @@ -29,15 +31,17 @@ function foo(n, m) { case 0: bar(m); case 1: - // ... + // ... default: - // ... + // ... } } function bar(m) { - switch(m) { + switch ( + m // ... + ) { } } ``` diff --git a/docs/rules/no-nested-template-literals.md b/docs/rules/no-nested-template-literals.md index 2f1848ec..eb5a0858 100644 --- a/docs/rules/no-nested-template-literals.md +++ b/docs/rules/no-nested-template-literals.md @@ -9,7 +9,7 @@ In such situations, it’s preferable to move the nested template into a separat ## Noncompliant Code Example ```javascript -let color = "red"; +let color = 'red'; let count = 3; let message = `I have ${color ? `${count} ${color}` : count} apples`; // Noncompliant; nested template strings not easy to read ``` @@ -17,7 +17,7 @@ let message = `I have ${color ? `${count} ${color}` : count} apples`; // Noncomp ## Compliant Solution ```javascript -let color = "red"; +let color = 'red'; let count = 3; let apples = color ? `${count} ${color}` : count; let message = `I have ${apples} apples`; @@ -28,7 +28,7 @@ let message = `I have ${apples} apples`; Nested template is ignored when the nesting one starts and ends on a different line. ```javascript -let color = "red"; +let color = 'red'; let count = 3; let message = `I have ${color ? `${count} ${color}` : count} diff --git a/docs/rules/no-one-iteration-loop.md b/docs/rules/no-one-iteration-loop.md index a79da1ac..3160dee9 100644 --- a/docs/rules/no-one-iteration-loop.md +++ b/docs/rules/no-one-iteration-loop.md @@ -1,7 +1,7 @@ # no-one-iteration-loop A loop with at most one iteration is equivalent to the use of an `if` statement to conditionally execute one piece of code. No developer expects to find such a use of a loop statement. If the initial intention of the author was really to conditionally execute one piece of code, an `if` statement should be used instead. - + At worst that was not the initial intention of the author and so the body of the loop should be fixed to use the nested `return`, `break` or `throw` statements in a more appropriate way. ## Noncompliant Code Example diff --git a/docs/rules/no-redundant-boolean.md b/docs/rules/no-redundant-boolean.md index 8b6b2647..8c247fe3 100644 --- a/docs/rules/no-redundant-boolean.md +++ b/docs/rules/no-redundant-boolean.md @@ -5,9 +5,15 @@ Redundant Boolean literals should be removed from expressions to improve readabi ## Noncompliant Code Example ```javascript -if (booleanMethod() == true) { /* ... */ } -if (booleanMethod() == false) { /* ... */ } -if (booleanMethod() || false) { /* ... */ } +if (booleanMethod() == true) { + /* ... */ +} +if (booleanMethod() == false) { + /* ... */ +} +if (booleanMethod() || false) { + /* ... */ +} doSomething(!false); doSomething(booleanMethod() == true); ``` @@ -15,10 +21,15 @@ doSomething(booleanMethod() == true); ## Compliant Solution ```javascript -if (booleanMethod()) { /* ... */ } -if (!booleanMethod()) { /* ... */ } -if (booleanMethod()) { /* ... */ } +if (booleanMethod()) { + /* ... */ +} +if (!booleanMethod()) { + /* ... */ +} +if (booleanMethod()) { + /* ... */ +} doSomething(true); doSomething(booleanMethod()); ``` - diff --git a/docs/rules/no-redundant-jump.md b/docs/rules/no-redundant-jump.md index 2262193b..217826ce 100644 --- a/docs/rules/no-redundant-jump.md +++ b/docs/rules/no-redundant-jump.md @@ -1,6 +1,6 @@ # no-redundant-jump -:wrench: *fixable* +:wrench: _fixable_ Jump statements, such as `return`, `break` and `continue` let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes. @@ -9,7 +9,7 @@ Jump statements, such as `return`, `break` and `continue` let you change the def ```javascript function redundantJump(x) { if (x == 1) { - console.log("x == 1"); + console.log('x == 1'); return; // Noncompliant } } @@ -20,7 +20,7 @@ function redundantJump(x) { ```javascript function redundantJump(x) { if (x == 1) { - console.log("x == 1"); + console.log('x == 1'); } } ``` diff --git a/docs/rules/no-same-line-conditional.md b/docs/rules/no-same-line-conditional.md index 12bb672c..a5f4afad 100644 --- a/docs/rules/no-same-line-conditional.md +++ b/docs/rules/no-same-line-conditional.md @@ -1,15 +1,17 @@ # no-same-line-conditional -:wrench: *fixable* +:wrench: _fixable_ -Code is clearest when each statement has its own line. Nonetheless, it is a common pattern to combine on the same line an `if` and its resulting *then* statement. However, when an `if` is placed on the same line as the closing `}` from a preceding *then*, *else* or *else if* part, it is either an error - `else` is missing - or the invitation to a future error as maintainers fail to understand that the two statements are unconnected. +Code is clearest when each statement has its own line. Nonetheless, it is a common pattern to combine on the same line an `if` and its resulting _then_ statement. However, when an `if` is placed on the same line as the closing `}` from a preceding _then_, _else_ or _else if_ part, it is either an error - `else` is missing - or the invitation to a future error as maintainers fail to understand that the two statements are unconnected. ## Noncompliant Code Example ```javascript if (condition1) { // ... -} if (condition2) { // Noncompliant +} +if (condition2) { + // Noncompliant //... } ``` diff --git a/docs/rules/no-unused-collection.md b/docs/rules/no-unused-collection.md index 705be1fb..aec8e297 100644 --- a/docs/rules/no-unused-collection.md +++ b/docs/rules/no-unused-collection.md @@ -8,7 +8,7 @@ This rule raises an issue when no methods are called on a collection other than ```javascript function getLength(a, b, c) { - const strings = []; // Noncompliant + const strings = []; // Noncompliant strings.push(a); strings.push(b); strings.push(c); diff --git a/docs/rules/no-use-of-empty-return-value.md b/docs/rules/no-use-of-empty-return-value.md index 2abe57dc..e368b972 100644 --- a/docs/rules/no-use-of-empty-return-value.md +++ b/docs/rules/no-use-of-empty-return-value.md @@ -6,7 +6,7 @@ If a function does not return anything, it makes no sense to use its output. Spe ```javascript function foo() { - console.log("Hello, World!"); + console.log('Hello, World!'); } a = foo(); @@ -16,7 +16,7 @@ a = foo(); ```javascript function foo() { - console.log("Hello, World!"); + console.log('Hello, World!'); } foo(); diff --git a/docs/rules/no-useless-catch.md b/docs/rules/no-useless-catch.md index 00f151b9..6deea7ea 100644 --- a/docs/rules/no-useless-catch.md +++ b/docs/rules/no-useless-catch.md @@ -9,7 +9,8 @@ Such clauses should either be eliminated or populated with the appropriate logic ```javascript try { doSomething(); -} catch (ex) { // Noncompliant +} catch (ex) { + // Noncompliant throw ex; } ``` diff --git a/docs/rules/non-existent-operator.md b/docs/rules/non-existent-operator.md index 678eec43..b1880688 100644 --- a/docs/rules/non-existent-operator.md +++ b/docs/rules/non-existent-operator.md @@ -1,6 +1,6 @@ # non-existent-operator -:wrench: *fixable* +:wrench: _fixable_ The use of operators pairs (`=+`, `=-` or `=!`) where the reversed, single operator was meant (`+=`, `-=` or `!=`) will compile and run, but not produce the expected results. @@ -9,11 +9,11 @@ This rule raises an issue when `=+`, `=-` and `=!` are used without any space be ## Noncompliant Code Example ```javascript -let target =-5; +let target = -5; let num = 3; -target =- num; // Noncompliant; target = -3. Is that really what's meant? -target =+ num; // Noncompliant; target = 3 +target = -num; // Noncompliant; target = -3. Is that really what's meant? +target = +num; // Noncompliant; target = 3 ``` ## Compliant Solution @@ -22,6 +22,6 @@ target =+ num; // Noncompliant; target = 3 let target = -5; let num = 3; -target = -num; // Compliant; intent to assign inverse value of num is clear +target = -num; // Compliant; intent to assign inverse value of num is clear target += num; ``` diff --git a/docs/rules/prefer-immediate-return.md b/docs/rules/prefer-immediate-return.md index e5d8a4fc..41df936b 100644 --- a/docs/rules/prefer-immediate-return.md +++ b/docs/rules/prefer-immediate-return.md @@ -1,6 +1,6 @@ # prefer-immediate-return -:wrench: *fixable* +:wrench: _fixable_ Declaring a variable only to immediately return or throw it is a bad practice. diff --git a/docs/rules/prefer-object-literal.md b/docs/rules/prefer-object-literal.md index cb0ab9e5..6729635c 100644 --- a/docs/rules/prefer-object-literal.md +++ b/docs/rules/prefer-object-literal.md @@ -4,24 +4,24 @@ Object literal syntax, which initializes an object's properties inside the objec An issue is raised when the following pattern is met: -* An empty object is created. -* A consecutive single-line statement adds a property to the created object. +- An empty object is created. +- A consecutive single-line statement adds a property to the created object. ## Noncompliant Code Example ```javascript var person = {}; // Noncompliant -person.firstName = "John"; -person.middleInitial = "Q"; -person.lastName = "Public"; +person.firstName = 'John'; +person.middleInitial = 'Q'; +person.lastName = 'Public'; ``` ## Compliant Solution ```javascript var person = { - firstName: "John", - middleInitial: "Q", - lastName: "Public", + firstName: 'John', + middleInitial: 'Q', + lastName: 'Public', }; ``` diff --git a/docs/rules/prefer-single-boolean-return.md b/docs/rules/prefer-single-boolean-return.md index 786bebd6..15ee404f 100644 --- a/docs/rules/prefer-single-boolean-return.md +++ b/docs/rules/prefer-single-boolean-return.md @@ -1,6 +1,6 @@ # prefer-single-boolean-return -:wrench: *fixable* +:wrench: _fixable_ Return of boolean literal statements wrapped into `if-then-else` flow should be simplified. diff --git a/docs/rules/prefer-while.md b/docs/rules/prefer-while.md index 927bbd53..0dc6689e 100644 --- a/docs/rules/prefer-while.md +++ b/docs/rules/prefer-while.md @@ -1,17 +1,21 @@ # prefer-while -:wrench: *fixable* +:wrench: _fixable_ When only the condition expression is defined in a `for` loop, and the initialization and increment expressions are missing, a `while` loop should be used instead to increase readability. ## Noncompliant Code Example ```javascript -for (;condition;) { /*...*/ } +for (; condition; ) { + /*...*/ +} ``` ## Compliant Solution ```javascript -while (condition) { /*...*/ } +while (condition) { + /*...*/ +} ``` diff --git a/package-lock.json b/package-lock.json index ab8ac2df..db19c2b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,12 +28,14 @@ "eslint-plugin-import": "2.26.0", "eslint-plugin-notice": "0.9.10", "eslint-plugin-sonarjs": "0.23.0", + "husky": "8.0.3", "jest": "29.5.0", "jest-sonar-reporter": "2.0.0", - "lint-staged": "13.0.3", + "lint-staged": "15.1.0", "lodash": "4.17.21", "minimist": "1.2.6", "prettier": "2.7.1", + "pretty-quick": "3.1.3", "rimraf": "3.0.2", "ts-jest": "29.1.1", "ts-node": "10.9.1", @@ -3221,6 +3223,12 @@ "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", "dev": true }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/@types/minimist/-/minimist-1.2.2.tgz", @@ -3442,19 +3450,6 @@ "node": ">=0.4.0" } }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ajv/-/ajv-6.12.6.tgz", @@ -3535,6 +3530,15 @@ "is-array-buffer": "^3.0.1" } }, + "node_modules/array-differ": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array-includes": { "version": "3.1.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/array-includes/-/array-includes-3.1.6.tgz", @@ -3592,10 +3596,10 @@ "node": ">= 0.4" } }, - "node_modules/astral-regex": { - "version": "2.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true, "engines": { "node": ">=8" @@ -3833,25 +3837,16 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cli-cursor": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "dependencies": { - "restore-cursor": "^3.1.0" + "restore-cursor": "^4.0.0" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/cli-truncate": { @@ -3948,12 +3943,12 @@ "dev": true }, "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "11.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=16" } }, "node_modules/concat-map": { @@ -4210,6 +4205,15 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/error-ex/-/error-ex-1.3.2.tgz", @@ -4808,6 +4812,12 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-5.1.1.tgz", @@ -5374,6 +5384,18 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "8.0.3", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/ignore": { "version": "5.2.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ignore/-/ignore-5.2.4.tgz", @@ -5421,15 +5443,6 @@ "node": ">=0.8.19" } }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/inflight/-/inflight-1.0.6.tgz", @@ -7738,9 +7751,9 @@ } }, "node_modules/lilconfig": { - "version": "2.0.5", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.0.5.tgz", - "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", + "version": "2.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true, "engines": { "node": ">=10" @@ -7753,59 +7766,74 @@ "dev": true }, "node_modules/lint-staged": { - "version": "13.0.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-13.0.3.tgz", - "integrity": "sha512-9hmrwSCFroTSYLjflGI8Uk+GWAwMB4OlpU4bMJEAT5d/llQwtYKoim4bLOyLCuWFAhWEupE0vkIFqtw/WIsPug==", - "dev": true, - "dependencies": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.17", - "commander": "^9.3.0", - "debug": "^4.3.4", - "execa": "^6.1.0", - "lilconfig": "2.0.5", - "listr2": "^4.0.5", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "object-inspect": "^1.12.2", - "pidtree": "^0.6.0", - "string-argv": "^0.3.1", - "yaml": "^2.1.1" + "version": "15.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-15.1.0.tgz", + "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", + "dev": true, + "dependencies": { + "chalk": "5.3.0", + "commander": "11.1.0", + "debug": "4.3.4", + "execa": "8.0.1", + "lilconfig": "2.1.0", + "listr2": "7.0.2", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.4" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { - "node": "^14.13.1 || >=16.0.0" + "node": ">=18.12.0" + } + }, + "node_modules/lint-staged/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" } }, "node_modules/lint-staged/node_modules/execa": { - "version": "6.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "version": "8.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=16.17" + } + }, + "node_modules/lint-staged/node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" } }, "node_modules/lint-staged/node_modules/human-signals": { - "version": "3.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "version": "5.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true, "engines": { - "node": ">=12.20.0" + "node": ">=16.17.0" } }, "node_modules/lint-staged/node_modules/is-stream": { @@ -7859,6 +7887,15 @@ "node": ">=12" } }, + "node_modules/lint-staged/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/lint-staged/node_modules/strip-final-newline": { "version": "3.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -7869,116 +7906,64 @@ } }, "node_modules/listr2": { - "version": "4.0.5", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-4.0.5.tgz", - "integrity": "sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==", + "version": "7.0.2", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", "dev": true, "dependencies": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", + "cli-truncate": "^3.1.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^5.0.1", "rfdc": "^1.3.0", - "rxjs": "^7.5.5", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "enquirer": ">= 2.3.0 < 3" - }, - "peerDependenciesMeta": { - "enquirer": { - "optional": true - } - } - }, - "node_modules/listr2/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/listr2/node_modules/cli-truncate": { - "version": "2.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "dependencies": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" + "wrap-ansi": "^8.1.0" }, "engines": { - "node": ">=8" + "node": ">=16.0.0" } }, - "node_modules/listr2/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/listr2/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=12" } }, - "node_modules/listr2/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/listr2/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/listr2/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/listr2/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/listr2/node_modules/slice-ansi": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "node_modules/listr2/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/listr2/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/locate-path": { @@ -8018,105 +8003,84 @@ "dev": true }, "node_modules/log-update": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "version": "5.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, "dependencies": { - "ansi-escapes": "^4.3.0", - "cli-cursor": "^3.1.0", - "slice-ansi": "^4.0.0", - "wrap-ansi": "^6.2.0" + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" }, "engines": { - "node": ">=10" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/log-update/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/log-update/node_modules/ansi-escapes": { + "version": "5.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "type-fest": "^1.0.2" }, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/log-update/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/log-update/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, "engines": { - "node": ">=7.0.0" + "node": ">=12" } }, - "node_modules/log-update/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/log-update/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/log-update/node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/log-update/node_modules/slice-ansi": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "node_modules/log-update/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-regex": "^6.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, - "node_modules/log-update/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/log-update/node_modules/type-fest": { + "version": "1.4.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/log-update/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "8.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" } }, "node_modules/lru-cache": { @@ -8249,12 +8213,37 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/multimatch": { + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8412,18 +8401,6 @@ "node": ">=6" } }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/p-try/-/p-try-2.2.0.tgz", @@ -8594,17 +8571,155 @@ "node": ">=10" } }, - "node_modules/prompts": { - "version": "2.4.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/prompts/-/prompts-2.4.2.tgz", - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "node_modules/pretty-quick": { + "version": "3.1.3", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pretty-quick/-/pretty-quick-3.1.3.tgz", + "integrity": "sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==", "dev": true, "dependencies": { - "kleur": "^3.0.3", - "sisteransi": "^1.0.5" + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + }, + "bin": { + "pretty-quick": "bin/pretty-quick.js" }, "engines": { - "node": ">= 6" + "node": ">=10.13" + }, + "peerDependencies": { + "prettier": ">=2.0.0" + } + }, + "node_modules/pretty-quick/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-quick/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-quick/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/pretty-quick/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/pretty-quick/node_modules/execa": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pretty-quick/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-quick/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pretty-quick/node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/pretty-quick/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "node_modules/punycode": { @@ -8782,16 +8897,16 @@ } }, "node_modules/restore-cursor": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "dependencies": { "onetime": "^5.1.0", "signal-exit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/reusify": { @@ -8831,15 +8946,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "dependencies": { - "tslib": "^2.1.0" - } - }, "node_modules/safe-array-concat": { "version": "1.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/safe-array-concat/-/safe-array-concat-1.0.0.tgz", @@ -9169,12 +9275,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tmpl/-/tmpl-1.0.5.tgz", @@ -9354,12 +9454,6 @@ "node": ">=4" } }, - "node_modules/tslib": { - "version": "2.6.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tslib/-/tslib-2.6.1.tgz", - "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==", - "dev": true - }, "node_modules/tsutils": { "version": "3.21.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tsutils/-/tsutils-3.21.0.tgz", @@ -9744,9 +9838,9 @@ "dev": true }, "node_modules/yaml": { - "version": "2.3.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true, "engines": { "node": ">= 14" @@ -12179,6 +12273,12 @@ "integrity": "sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==", "dev": true }, + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, "@types/minimist": { "version": "1.2.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/@types/minimist/-/minimist-1.2.2.tgz", @@ -12341,16 +12441,6 @@ "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ajv/-/ajv-6.12.6.tgz", @@ -12419,6 +12509,12 @@ "is-array-buffer": "^3.0.1" } }, + "array-differ": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "dev": true + }, "array-includes": { "version": "3.1.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/array-includes/-/array-includes-3.1.6.tgz", @@ -12464,10 +12560,10 @@ "is-shared-array-buffer": "^1.0.2" } }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "arrify": { + "version": "2.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", "dev": true }, "available-typed-arrays": { @@ -12657,19 +12753,13 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, "cli-cursor": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", "dev": true, "requires": { - "restore-cursor": "^3.1.0" + "restore-cursor": "^4.0.0" } }, "cli-truncate": { @@ -12752,9 +12842,9 @@ "dev": true }, "commander": { - "version": "9.5.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "11.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true }, "concat-map": { @@ -12953,6 +13043,15 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/error-ex/-/error-ex-1.3.2.tgz", @@ -13429,6 +13528,12 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "eventemitter3": { + "version": "5.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, "execa": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-5.1.1.tgz", @@ -13890,6 +13995,12 @@ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", "dev": true }, + "husky": { + "version": "8.0.3", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/husky/-/husky-8.0.3.tgz", + "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "dev": true + }, "ignore": { "version": "5.2.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ignore/-/ignore-5.2.4.tgz", @@ -13922,12 +14033,6 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, "inflight": { "version": "1.0.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/inflight/-/inflight-1.0.6.tgz", @@ -15748,9 +15853,9 @@ } }, "lilconfig": { - "version": "2.0.5", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.0.5.tgz", - "integrity": "sha512-xaYmXZtTHPAw5m+xLN8ab9C+3a8YmV3asNSPOATITbtwrfbwaLJj8h66H1WMIpALCkqsIzK3h7oQ+PdX+LQ9Eg==", + "version": "2.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true }, "lines-and-columns": { @@ -15760,47 +15865,56 @@ "dev": true }, "lint-staged": { - "version": "13.0.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-13.0.3.tgz", - "integrity": "sha512-9hmrwSCFroTSYLjflGI8Uk+GWAwMB4OlpU4bMJEAT5d/llQwtYKoim4bLOyLCuWFAhWEupE0vkIFqtw/WIsPug==", + "version": "15.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-15.1.0.tgz", + "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", "dev": true, "requires": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.17", - "commander": "^9.3.0", - "debug": "^4.3.4", - "execa": "^6.1.0", - "lilconfig": "2.0.5", - "listr2": "^4.0.5", - "micromatch": "^4.0.5", - "normalize-path": "^3.0.0", - "object-inspect": "^1.12.2", - "pidtree": "^0.6.0", - "string-argv": "^0.3.1", - "yaml": "^2.1.1" + "chalk": "5.3.0", + "commander": "11.1.0", + "debug": "4.3.4", + "execa": "8.0.1", + "lilconfig": "2.1.0", + "listr2": "7.0.2", + "micromatch": "4.0.5", + "pidtree": "0.6.0", + "string-argv": "0.3.2", + "yaml": "2.3.4" }, "dependencies": { + "chalk": { + "version": "5.3.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true + }, "execa": { - "version": "6.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-6.1.0.tgz", - "integrity": "sha512-QVWlX2e50heYJcCPG0iWtf8r0xjEYfz/OYLGDYH+IyjWezzPNxz63qNFOu0l4YftGWuizFVZHHs8PrLU5p2IDA==", + "version": "8.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", "dev": true, "requires": { "cross-spawn": "^7.0.3", - "get-stream": "^6.0.1", - "human-signals": "^3.0.1", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", "is-stream": "^3.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^5.1.0", "onetime": "^6.0.0", - "signal-exit": "^3.0.7", + "signal-exit": "^4.1.0", "strip-final-newline": "^3.0.0" } }, + "get-stream": { + "version": "8.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true + }, "human-signals": { - "version": "3.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-3.0.1.tgz", - "integrity": "sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==", + "version": "5.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", "dev": true }, "is-stream": { @@ -15839,6 +15953,12 @@ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", "dev": true }, + "signal-exit": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true + }, "strip-final-newline": { "version": "3.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-final-newline/-/strip-final-newline-3.0.0.tgz", @@ -15848,87 +15968,49 @@ } }, "listr2": { - "version": "4.0.5", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-4.0.5.tgz", - "integrity": "sha512-juGHV1doQdpNT3GSTs9IUN43QJb7KHdF9uqg7Vufs/tG9VTzpFphqF4pm/ICdAABGQxsyNn9CiYA3StkI6jpwA==", + "version": "7.0.2", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-7.0.2.tgz", + "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", "dev": true, "requires": { - "cli-truncate": "^2.1.0", - "colorette": "^2.0.16", - "log-update": "^4.0.0", - "p-map": "^4.0.0", + "cli-truncate": "^3.1.0", + "colorette": "^2.0.20", + "eventemitter3": "^5.0.1", + "log-update": "^5.0.1", "rfdc": "^1.3.0", - "rxjs": "^7.5.5", - "through": "^2.3.8", - "wrap-ansi": "^7.0.0" + "wrap-ansi": "^8.1.0" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "cli-truncate": { - "version": "2.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "slice-ansi": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-regex": "^6.0.1" } }, - "string-width": { - "version": "4.2.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "wrap-ansi": { + "version": "8.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" } } } @@ -15967,84 +16049,63 @@ "dev": true }, "log-update": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-4.0.0.tgz", - "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "version": "5.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-5.0.1.tgz", + "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", "dev": true, "requires": { - "ansi-escapes": "^4.3.0", - "cli-cursor": "^3.1.0", - "slice-ansi": "^4.0.0", - "wrap-ansi": "^6.2.0" + "ansi-escapes": "^5.0.0", + "cli-cursor": "^4.0.0", + "slice-ansi": "^5.0.0", + "strip-ansi": "^7.0.1", + "wrap-ansi": "^8.0.1" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "ansi-escapes": { + "version": "5.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-escapes/-/ansi-escapes-5.0.0.tgz", + "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", "dev": true, "requires": { - "color-convert": "^2.0.1" + "type-fest": "^1.0.2" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", "dev": true }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true }, - "slice-ansi": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-4.0.0.tgz", - "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" + "ansi-regex": "^6.0.1" } }, - "string-width": { - "version": "4.2.3", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } + "type-fest": { + "version": "1.4.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "dev": true }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "version": "8.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dev": true, "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" } } } @@ -16157,12 +16218,31 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, + "mri": { + "version": "1.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true + }, "ms": { "version": "2.1.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "multimatch": { + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/multimatch/-/multimatch-4.0.0.tgz", + "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==", + "dev": true, + "requires": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/natural-compare/-/natural-compare-1.4.0.tgz", @@ -16292,15 +16372,6 @@ } } }, - "p-map": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, "p-try": { "version": "2.2.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/p-try/-/p-try-2.2.0.tgz", @@ -16422,6 +16493,103 @@ } } }, + "pretty-quick": { + "version": "3.1.3", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pretty-quick/-/pretty-quick-3.1.3.tgz", + "integrity": "sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "execa": "^4.0.0", + "find-up": "^4.1.0", + "ignore": "^5.1.4", + "mri": "^1.1.5", + "multimatch": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "execa": { + "version": "4.1.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "prompts": { "version": "2.4.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/prompts/-/prompts-2.4.2.tgz", @@ -16432,6 +16600,16 @@ "sisteransi": "^1.0.5" } }, + "pump": { + "version": "3.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.3.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/punycode/-/punycode-2.3.0.tgz", @@ -16575,9 +16753,9 @@ "dev": true }, "restore-cursor": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "version": "4.0.0", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", "dev": true, "requires": { "onetime": "^5.1.0", @@ -16614,15 +16792,6 @@ "queue-microtask": "^1.2.2" } }, - "rxjs": { - "version": "7.8.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "requires": { - "tslib": "^2.1.0" - } - }, "safe-array-concat": { "version": "1.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/safe-array-concat/-/safe-array-concat-1.0.0.tgz", @@ -16889,12 +17058,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "through": { - "version": "2.3.8", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true - }, "tmpl": { "version": "1.0.5", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tmpl/-/tmpl-1.0.5.tgz", @@ -17008,12 +17171,6 @@ } } }, - "tslib": { - "version": "2.6.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tslib/-/tslib-2.6.1.tgz", - "integrity": "sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig==", - "dev": true - }, "tsutils": { "version": "3.21.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/tsutils/-/tsutils-3.21.0.tgz", @@ -17320,9 +17477,9 @@ "dev": true }, "yaml": { - "version": "2.3.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.1.tgz", - "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "version": "2.3.4", + "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", "dev": true }, "yargs": { diff --git a/package.json b/package.json index 7d42c6f4..0e8b4b13 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,10 @@ "ruling": "ts-node --files ruling/index.ts", "typecheck": "tsc -p tsconfig.json", "lint": "eslint --ext js,ts src tests ruling/index.ts", - "precommit": "lint-staged && npm run typecheck", + "precommit": "lint-staged && npm run typecheck && pretty-quick --staged", + "prepare": "husky install .husky", "prepack": "npm run build", - "format": "prettier --write \"{src,tests}/**/*.ts\"", + "format": "prettier --write .", "check-format": "prettier --list-different \"{src,tests}/**/*.ts\"" }, "peerDependencies": { @@ -52,12 +53,14 @@ "eslint-plugin-import": "2.26.0", "eslint-plugin-notice": "0.9.10", "eslint-plugin-sonarjs": "0.23.0", + "husky": "8.0.3", "jest": "29.5.0", "jest-sonar-reporter": "2.0.0", - "lint-staged": "13.0.3", + "lint-staged": "15.1.0", "lodash": "4.17.21", "minimist": "1.2.6", "prettier": "2.7.1", + "pretty-quick": "3.1.3", "rimraf": "3.0.2", "ts-jest": "29.1.1", "ts-node": "10.9.1", @@ -97,13 +100,7 @@ }, "lint-staged": { "*.{ts,tsx,js}": [ - "eslint", - "prettier --write", - "git add" - ], - "*.json": [ - "prettier --write", - "git add" + "eslint --fix" ] } } diff --git a/ruling/.eslintrc.js b/ruling/.eslintrc.js index f79180c1..8054c7bf 100644 --- a/ruling/.eslintrc.js +++ b/ruling/.eslintrc.js @@ -1,5 +1,24 @@ +/* + * eslint-plugin-sonarjs + * Copyright (C) 2018-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ module.exports = { rules: { - "no-console": "off", + 'no-console': 'off', }, }; diff --git a/ruling/index.ts b/ruling/index.ts index b8e7fb59..b0a4c70a 100644 --- a/ruling/index.ts +++ b/ruling/index.ts @@ -17,48 +17,48 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as fs from "fs"; -import * as path from "path"; -import { ESLint } from "eslint"; -import * as lodash from "lodash"; -import * as minimist from "minimist"; +import * as fs from 'fs'; +import * as path from 'path'; +import { ESLint } from 'eslint'; +import lodash from 'lodash'; +import minimist from 'minimist'; -const rulesPath = path.join(__dirname, "../lib/rules"); +const rulesPath = path.join(__dirname, '../lib/rules'); run(); async function run() { const argv = minimist(process.argv.slice(2), { - string: ["rule"], - boolean: ["update"], + string: ['rule'], + boolean: ['update'], }); const rules = getRules(argv.rule); if (!rules.length) { - console.error("No rules found!"); + console.error('No rules found!'); process.exit(1); } - console.log("Found rules:"); + console.log('Found rules:'); rules.forEach(rule => { - console.log(" *", rule); + console.log(' *', rule); }); - console.log(""); + console.log(''); - const sourcesPath = path.join(__dirname, "javascript-test-sources/src"); + const sourcesPath = path.join(__dirname, 'javascript-test-sources/src'); if (!fs.existsSync(sourcesPath)) { - console.error("No sources found!"); + console.error('No sources found!'); process.exit(1); } const eslint = new ESLint({ overrideConfig: { - parser: "@babel/eslint-parser", + parser: '@babel/eslint-parser', parserOptions: { ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true }, ecmaVersion: 2018, - sourceType: "module", + sourceType: 'module', requireConfigFile: false, babelOptions: { babelrc: false, @@ -66,16 +66,19 @@ async function run() { parserOpts: { allowReturnOutsideFunction: true, }, - presets: ["@babel/preset-env", "@babel/preset-flow", "@babel/preset-react"], - plugins: ["@babel/plugin-proposal-function-bind", "@babel/plugin-proposal-export-default-from"] - } + presets: ['@babel/preset-env', '@babel/preset-flow', '@babel/preset-react'], + plugins: [ + '@babel/plugin-proposal-function-bind', + '@babel/plugin-proposal-export-default-from', + ], + }, }, rules: getEslintRules(rules), }, rulePaths: [rulesPath], useEslintrc: false, allowInlineConfig: false, - ignorePath: path.join(__dirname, ".eslintignore"), + ignorePath: path.join(__dirname, '.eslintignore'), }); const reportResults = await eslint.lintFiles([sourcesPath]); @@ -113,8 +116,8 @@ async function run() { function getRules(rule?: string) { const rules = fs .readdirSync(rulesPath) - .filter(file => file.endsWith(".js")) - .map(file => file.substring(0, file.indexOf(".js"))); + .filter(file => file.endsWith('.js')) + .map(file => file.substring(0, file.indexOf('.js'))); if (rule) { return rules.includes(rule) ? [rule] : []; @@ -124,9 +127,9 @@ function getRules(rule?: string) { } function getEslintRules(rules: string[]) { - const eslintRules: { [rule: string]: "error" } = {}; + const eslintRules: { [rule: string]: 'error' } = {}; rules.forEach(rule => { - eslintRules[rule] = "error"; + eslintRules[rule] = 'error'; }); return eslintRules; } @@ -142,7 +145,7 @@ function addToResults(results: Results, filePath: string, ruleId: string, line: } function getFileNameForSnapshot(path: string): string { - const marker = "/javascript-test-sources/"; + const marker = '/javascript-test-sources/'; const unixPath = path.replace(/\\+/g, '/'); const pos = unixPath.indexOf(marker); return unixPath.substr(pos + marker.length); @@ -165,7 +168,7 @@ function writeResults(results: Results) { content.push(`${file}: ${lines.join()}`); }); - writeSnapshot(rule, content.join("\n") + "\n"); + writeSnapshot(rule, content.join('\n') + '\n'); }); } @@ -186,20 +189,20 @@ function checkResults(actual: Results) { const missingLines = lodash.difference(expectedLines, actualLines); if (missingLines.length > 0) { passed = false; - console.log("Missing issues:"); - console.log(" * Rule:", rule); - console.log(" * File:", file); - console.log(" * Lines:", missingLines.join(", ")); + console.log('Missing issues:'); + console.log(' * Rule:', rule); + console.log(' * File:', file); + console.log(' * Lines:', missingLines.join(', ')); console.log(); } const extraLines = lodash.difference(actualLines, expectedLines); if (extraLines.length > 0) { passed = false; - console.log("Extra issues:"); - console.log(" * Rule:", rule); - console.log(" * File:", file); - console.log(" * Lines:", extraLines.join(", ")); + console.log('Extra issues:'); + console.log(' * Rule:', rule); + console.log(' * File:', file); + console.log(' * Lines:', extraLines.join(', ')); console.log(); } }); @@ -209,24 +212,24 @@ function checkResults(actual: Results) { } function writeSnapshot(rule: string, content: string): void { - const fileName = path.join(__dirname, "snapshots", rule); + const fileName = path.join(__dirname, 'snapshots', rule); fs.writeFileSync(fileName, content); } function readSnapshots(rules: string[]): Results { - const snapshotsDir = path.join(__dirname, "snapshots"); + const snapshotsDir = path.join(__dirname, 'snapshots'); const results: Results = {}; rules.forEach(rule => { results[rule] = {}; const content = readSnapshotFile(snapshotsDir, rule); content.forEach(line => { - const colonIndex = line.indexOf(":"); + const colonIndex = line.indexOf(':'); if (colonIndex !== -1) { const file = line.substring(0, colonIndex); const lines = line .substr(colonIndex + 1) - .split(",") + .split(',') .map(s => parseInt(s, 10)); results[rule][file] = lines; } @@ -239,7 +242,7 @@ function readSnapshots(rules: string[]): Results { function readSnapshotFile(snapshotsDir: string, ruleName: string) { const rulePath = path.join(snapshotsDir, ruleName); if (fs.existsSync(rulePath)) { - return fs.readFileSync(rulePath, "utf-8").split("\n"); + return fs.readFileSync(rulePath, 'utf-8').split('\n'); } else { return []; } diff --git a/scripts/generate-rules-sonar-meta.ts b/scripts/generate-rules-sonar-meta.ts index 57d10788..e91480f1 100644 --- a/scripts/generate-rules-sonar-meta.ts +++ b/scripts/generate-rules-sonar-meta.ts @@ -17,36 +17,36 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import * as fs from "fs"; +import * as fs from 'fs'; const outputPath = process.argv[2]; const meta = []; -const readmeContent = fs.readFileSync("README.md", "utf-8"); +const readmeContent = fs.readFileSync('README.md', 'utf-8'); const lines = readmeContent.split(/\n/); -let state: "before-bug" | "bug" | "between" | "code-smell" = "before-bug"; +let state: 'before-bug' | 'bug' | 'between' | 'code-smell' = 'before-bug'; for (const line of lines) { - if (state === "before-bug" && line.startsWith("*")) { - state = "bug"; + if (state === 'before-bug' && line.startsWith('*')) { + state = 'bug'; } - if (state === "bug") { - if (line.startsWith("*")) { - addRule(line, "BUG"); + if (state === 'bug') { + if (line.startsWith('*')) { + addRule(line, 'BUG'); } else { - state = "between"; + state = 'between'; } } - if (state === "between" && line.startsWith("*")) { - state = "code-smell"; + if (state === 'between' && line.startsWith('*')) { + state = 'code-smell'; } - if (state === "code-smell") { - if (line.startsWith("*")) { - addRule(line, "CODE_SMELL"); + if (state === 'code-smell') { + if (line.startsWith('*')) { + addRule(line, 'CODE_SMELL'); } else { break; } @@ -54,11 +54,8 @@ for (const line of lines) { } function addRule(line: string, type: string) { - const name = line - .substr(2) - .split("([")[0] - .trim(); - const key = "sonarjs/" + line.split("`")[1].trim(); + const name = line.substr(2).split('([')[0].trim(); + const key = 'sonarjs/' + line.split('`')[1].trim(); meta.push({ key, From 910f7ba46889dd6fd9ca201a129e1391ed49cc56 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 16 Nov 2023 17:06:41 +0100 Subject: [PATCH 2/8] fix qa --- ruling/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruling/index.ts b/ruling/index.ts index b0a4c70a..db0924c7 100644 --- a/ruling/index.ts +++ b/ruling/index.ts @@ -20,8 +20,8 @@ import * as fs from 'fs'; import * as path from 'path'; import { ESLint } from 'eslint'; -import lodash from 'lodash'; -import minimist from 'minimist'; +import * as lodash from 'lodash'; +import * as minimist from 'minimist'; const rulesPath = path.join(__dirname, '../lib/rules'); From c923bfc9544e442723897c9fdfc42fa927d9ed61 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 21 Nov 2023 16:25:20 +0100 Subject: [PATCH 3/8] remove lint-staged, lint single tsconfig.json fetch base branch for coverage --- .cirrus.yml | 5 +- package-lock.json | 819 ---------------------------------------------- package.json | 15 +- tsconfig-src.json | 9 - tsconfig.json | 6 +- 5 files changed, 8 insertions(+), 846 deletions(-) delete mode 100644 tsconfig-src.json diff --git a/.cirrus.yml b/.cirrus.yml index 5d500ce8..a5b4f887 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -41,20 +41,17 @@ build_task: cpu: 3 memory: 8G env: - CIRRUS_CLONE_DEPTH: 10 SONARSOURCE_QA: true node_version_script: - node --version script: + - if [ -n "${CIRRUS_BASE_BRANCH}" ]; then git fetch origin "${CIRRUS_BASE_BRANCH}"; fi - jfrog config add repox --url $ARTIFACTORY_URL --access-token $ARTIFACTORY_DEPLOY_ACCESS_TOKEN - jfrog rt npm-config --repo-resolve npm --repo-deploy sonarsource-npm-public-qa - git submodule update --init --depth 1 -r - jfrog rt npm-ci - - npm run typecheck - npm run build - ./scripts/test-ci.sh - - npm run check-format - - npm run lint - npm run ruling - ./scripts/analyze_and_publish.sh diff --git a/package-lock.json b/package-lock.json index db19c2b6..c37dc987 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,6 @@ "husky": "8.0.3", "jest": "29.5.0", "jest-sonar-reporter": "2.0.0", - "lint-staged": "15.1.0", "lodash": "4.17.21", "minimist": "1.2.6", "prettier": "2.7.1", @@ -3837,31 +3836,6 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "dev": true, - "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cliui/-/cliui-8.0.1.tgz", @@ -3936,21 +3910,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "node_modules/colorette": { - "version": "2.0.20", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "dev": true, - "engines": { - "node": ">=16" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/concat-map/-/concat-map-0.0.1.tgz", @@ -4178,12 +4137,6 @@ "node": ">=6.0.0" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/electron-to-chromium": { "version": "1.4.569", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/electron-to-chromium/-/electron-to-chromium-1.4.569.tgz", @@ -4199,12 +4152,6 @@ "node": ">=12" } }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, "node_modules/end-of-stream": { "version": "1.4.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -4812,12 +4759,6 @@ "node": ">=0.10.0" } }, - "node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true - }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-5.1.1.tgz", @@ -5551,15 +5492,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/is-generator-fn": { "version": "2.1.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-generator-fn/-/is-generator-fn-2.1.0.tgz", @@ -7750,222 +7682,12 @@ "node": ">= 0.8.0" } }, - "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/lint-staged": { - "version": "15.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-15.1.0.tgz", - "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", - "dev": true, - "dependencies": { - "chalk": "5.3.0", - "commander": "11.1.0", - "debug": "4.3.4", - "execa": "8.0.1", - "lilconfig": "2.1.0", - "listr2": "7.0.2", - "micromatch": "4.0.5", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.3.4" - }, - "bin": { - "lint-staged": "bin/lint-staged.js" - }, - "engines": { - "node": ">=18.12.0" - } - }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - } - }, - "node_modules/lint-staged/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - } - }, - "node_modules/lint-staged/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - } - }, - "node_modules/lint-staged/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/lint-staged/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/lint-staged/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "dependencies": { - "path-key": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/lint-staged/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "dependencies": { - "mimic-fn": "^4.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/lint-staged/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/lint-staged/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/lint-staged/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/listr2": { - "version": "7.0.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", - "dev": true, - "dependencies": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", - "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/listr2/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/listr2/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/listr2/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/listr2/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/locate-path/-/locate-path-5.0.0.tgz", @@ -8002,87 +7724,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", - "dev": true, - "dependencies": { - "ansi-escapes": "^5.0.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/log-update/node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", - "dev": true, - "dependencies": { - "type-fest": "^1.0.2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/log-update/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/log-update/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/log-update/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/log-update/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lru-cache/-/lru-cache-5.1.1.tgz", @@ -8494,18 +8135,6 @@ "node": ">=8.6" } }, - "node_modules/pidtree": { - "version": "0.6.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pidtree/-/pidtree-0.6.0.tgz", - "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", - "dev": true, - "bin": { - "pidtree": "bin/pidtree.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pirates/-/pirates-4.0.6.tgz", @@ -8896,19 +8525,6 @@ "node": ">=10" } }, - "node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/reusify/-/reusify-1.0.4.tgz", @@ -8919,12 +8535,6 @@ "node": ">=0.10.0" } }, - "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true - }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rimraf/-/rimraf-3.0.2.tgz", @@ -9034,28 +8644,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - } - }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/source-map/-/source-map-0.6.1.tgz", @@ -9102,15 +8690,6 @@ "node": ">=8" } }, - "node_modules/string-argv": { - "version": "0.3.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-argv/-/string-argv-0.3.2.tgz", - "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", - "dev": true, - "engines": { - "node": ">=0.6.19" - } - }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-length/-/string-length-4.0.2.tgz", @@ -9124,41 +8703,6 @@ "node": ">=10" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.7", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", @@ -9837,15 +9381,6 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, - "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true, - "engines": { - "node": ">= 14" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yargs/-/yargs-17.7.2.tgz", @@ -12753,25 +12288,6 @@ "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, - "cli-cursor": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, - "requires": { - "restore-cursor": "^4.0.0" - } - }, - "cli-truncate": { - "version": "3.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", - "dev": true, - "requires": { - "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" - } - }, "cliui": { "version": "8.0.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/cliui/-/cliui-8.0.1.tgz", @@ -12835,18 +12351,6 @@ "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, - "colorette": { - "version": "2.0.20", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", - "dev": true - }, - "commander": { - "version": "11.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/concat-map/-/concat-map-0.0.1.tgz", @@ -13019,12 +12523,6 @@ "esutils": "^2.0.2" } }, - "eastasianwidth": { - "version": "0.2.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "electron-to-chromium": { "version": "1.4.569", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/electron-to-chromium/-/electron-to-chromium-1.4.569.tgz", @@ -13037,12 +12535,6 @@ "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", "dev": true }, - "emoji-regex": { - "version": "9.2.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", - "dev": true - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -13528,12 +13020,6 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, - "eventemitter3": { - "version": "5.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true - }, "execa": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-5.1.1.tgz", @@ -14126,12 +13612,6 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, - "is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true - }, "is-generator-fn": { "version": "2.1.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-generator-fn/-/is-generator-fn-2.1.0.tgz", @@ -15852,169 +15332,12 @@ "type-check": "~0.4.0" } }, - "lilconfig": { - "version": "2.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true - }, "lines-and-columns": { "version": "1.2.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lines-and-columns/-/lines-and-columns-1.2.4.tgz", "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "lint-staged": { - "version": "15.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lint-staged/-/lint-staged-15.1.0.tgz", - "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", - "dev": true, - "requires": { - "chalk": "5.3.0", - "commander": "11.1.0", - "debug": "4.3.4", - "execa": "8.0.1", - "lilconfig": "2.1.0", - "listr2": "7.0.2", - "micromatch": "4.0.5", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.3.4" - }, - "dependencies": { - "chalk": { - "version": "5.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true - }, - "execa": { - "version": "8.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - } - }, - "get-stream": { - "version": "8.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true - }, - "human-signals": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true - }, - "is-stream": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true - }, - "mimic-fn": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true - }, - "npm-run-path": { - "version": "5.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, - "requires": { - "path-key": "^4.0.0" - } - }, - "onetime": { - "version": "6.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, - "requires": { - "mimic-fn": "^4.0.0" - } - }, - "path-key": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true - }, - "signal-exit": { - "version": "4.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true - }, - "strip-final-newline": { - "version": "3.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true - } - } - }, - "listr2": { - "version": "7.0.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", - "dev": true, - "requires": { - "cli-truncate": "^3.1.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", - "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - }, - "wrap-ansi": { - "version": "8.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - } - } - } - }, "locate-path": { "version": "5.0.0", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/locate-path/-/locate-path-5.0.0.tgz", @@ -16048,68 +15371,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "log-update": { - "version": "5.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", - "dev": true, - "requires": { - "ansi-escapes": "^5.0.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" - }, - "dependencies": { - "ansi-escapes": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", - "dev": true, - "requires": { - "type-fest": "^1.0.2" - } - }, - "ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - }, - "type-fest": { - "version": "1.4.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", - "dev": true - }, - "wrap-ansi": { - "version": "8.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - } - } - } - }, "lru-cache": { "version": "5.1.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/lru-cache/-/lru-cache-5.1.1.tgz", @@ -16441,12 +15702,6 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, - "pidtree": { - "version": "0.6.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pidtree/-/pidtree-0.6.0.tgz", - "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", - "dev": true - }, "pirates": { "version": "4.0.6", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/pirates/-/pirates-4.0.6.tgz", @@ -16752,28 +16007,12 @@ "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, - "restore-cursor": { - "version": "4.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, "reusify": { "version": "1.0.4", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, - "rfdc": { - "version": "1.3.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true - }, "rimraf": { "version": "3.0.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/rimraf/-/rimraf-3.0.2.tgz", @@ -16865,24 +16104,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "5.0.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "requires": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true - } - } - }, "source-map": { "version": "0.6.1", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/source-map/-/source-map-0.6.1.tgz", @@ -16922,12 +16143,6 @@ } } }, - "string-argv": { - "version": "0.3.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-argv/-/string-argv-0.3.2.tgz", - "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", - "dev": true - }, "string-length": { "version": "4.0.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-length/-/string-length-4.0.2.tgz", @@ -16938,34 +16153,6 @@ "strip-ansi": "^6.0.0" } }, - "string-width": { - "version": "5.1.2", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "6.0.1", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true - }, - "strip-ansi": { - "version": "7.1.0", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "requires": { - "ansi-regex": "^6.0.1" - } - } - } - }, "string.prototype.trim": { "version": "1.2.7", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", @@ -17476,12 +16663,6 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, - "yaml": { - "version": "2.3.4", - "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", - "dev": true - }, "yargs": { "version": "17.7.2", "resolved": "https://repox.jfrog.io/repox/api/npm/npm/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 0e8b4b13..02019827 100644 --- a/package.json +++ b/package.json @@ -19,16 +19,13 @@ "node": ">=14" }, "scripts": { - "build": "rimraf lib && npm run check-format && tsc -d -p tsconfig-src.json", + "build": "rimraf lib && npm run format && tsc -d -p tsconfig.json", "test": "jest", "ruling": "ts-node --files ruling/index.ts", - "typecheck": "tsc -p tsconfig.json", - "lint": "eslint --ext js,ts src tests ruling/index.ts", - "precommit": "lint-staged && npm run typecheck && pretty-quick --staged", + "precommit": "pretty-quick --staged", "prepare": "husky install .husky", "prepack": "npm run build", - "format": "prettier --write .", - "check-format": "prettier --list-different \"{src,tests}/**/*.ts\"" + "format": "prettier --write ." }, "peerDependencies": { "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" @@ -56,7 +53,6 @@ "husky": "8.0.3", "jest": "29.5.0", "jest-sonar-reporter": "2.0.0", - "lint-staged": "15.1.0", "lodash": "4.17.21", "minimist": "1.2.6", "prettier": "2.7.1", @@ -97,10 +93,5 @@ "testMatch": [ "/tests/**/*.test.ts" ] - }, - "lint-staged": { - "*.{ts,tsx,js}": [ - "eslint --fix" - ] } } diff --git a/tsconfig-src.json b/tsconfig-src.json deleted file mode 100644 index 102489ae..00000000 --- a/tsconfig-src.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "noEmit": false, - "outDir": "lib", - "sourceMap": true - }, - "include": ["src/**/*.ts"] -} diff --git a/tsconfig.json b/tsconfig.json index 6982ed9d..b610b988 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,8 +7,10 @@ "noImplicitAny": true, "noUnusedLocals": true, "noUnusedParameters": true, - "noEmit": true, - "allowSyntheticDefaultImports": true + "allowSyntheticDefaultImports": true, + "noEmit": false, + "outDir": "lib", + "sourceMap": true }, "include": ["ruling", "src", "tests", "typings"], "exclude": ["ruling/javascript-test-sources"] From 5907d3f419823ff08ec79ffb92a2a1d4feadd356 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 21 Nov 2023 17:04:07 +0100 Subject: [PATCH 4/8] separate analysis task from ruling add markdown to .prettierignore --- .cirrus.yml | 24 +++++++++++++++++++++--- .prettierignore | 1 + 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index a5b4f887..2a74489e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -25,6 +25,27 @@ container_definition: &CONTAINER_DEFINITION use_in_memory_disk: true build_task: + <<: *ONLY_SONARSOURCE_QA + eks_container: + <<: *CONTAINER_DEFINITION + docker_arguments: + CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT} + cpu: 3 + memory: 8G + env: + SONARSOURCE_QA: true + node_version_script: + - node --version + script: + - if [ -n "${CIRRUS_BASE_BRANCH}" ]; then git fetch origin "${CIRRUS_BASE_BRANCH}"; fi + - jfrog config add repox --url $ARTIFACTORY_URL --access-token $ARTIFACTORY_DEPLOY_ACCESS_TOKEN + - jfrog rt npm-config --repo-resolve npm --repo-deploy sonarsource-npm-public-qa + - jfrog rt npm-ci + - npm run build + - ./scripts/test-ci.sh + - ./scripts/analyze_and_publish.sh + +qa_task: <<: *ONLY_SONARSOURCE_QA eks_container: matrix: @@ -45,15 +66,12 @@ build_task: node_version_script: - node --version script: - - if [ -n "${CIRRUS_BASE_BRANCH}" ]; then git fetch origin "${CIRRUS_BASE_BRANCH}"; fi - jfrog config add repox --url $ARTIFACTORY_URL --access-token $ARTIFACTORY_DEPLOY_ACCESS_TOKEN - jfrog rt npm-config --repo-resolve npm --repo-deploy sonarsource-npm-public-qa - git submodule update --init --depth 1 -r - jfrog rt npm-ci - npm run build - - ./scripts/test-ci.sh - npm run ruling - - ./scripts/analyze_and_publish.sh ws_scan_task: depends_on: diff --git a/.prettierignore b/.prettierignore index 2d4945a5..2afd5118 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ coverage lib javascript-test-sources +docs From 13bbe61cc727ea2da873409ec48a76a1395df638 Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Wed, 22 Nov 2023 11:05:42 +0100 Subject: [PATCH 5/8] fixes --- README.md | 85 ++++++++++++----------- docs/rules/no-all-duplicated-branches.md | 7 +- docs/rules/no-collection-size-mischeck.md | 18 +++-- docs/rules/no-duplicated-branches.md | 3 +- docs/rules/no-empty-collection.md | 6 +- docs/rules/no-gratuitous-expressions.md | 3 +- docs/rules/no-identical-conditions.md | 3 +- docs/rules/no-identical-expressions.md | 9 +-- docs/rules/no-identical-functions.md | 3 +- docs/rules/no-inverted-boolean-check.md | 8 ++- docs/rules/no-nested-switch.md | 16 ++--- docs/rules/no-redundant-boolean.md | 24 ++----- docs/rules/no-same-line-conditional.md | 4 +- docs/rules/no-useless-catch.md | 3 +- docs/rules/prefer-while.md | 8 +-- tsconfig.json | 3 +- 16 files changed, 90 insertions(+), 113 deletions(-) diff --git a/README.md b/README.md index 9c3e748f..a0d589fa 100644 --- a/README.md +++ b/README.md @@ -8,43 +8,43 @@ SonarJS rules for ESLint to help developers produce [Clean Code](https://www.son Rules in this category aim to find places in code that have a high chance of being bugs, i.e. don't work as intended. -* All branches in a conditional structure should not have exactly the same implementation ([`no-all-duplicated-branches`]) -* Collection elements should not be replaced unconditionally ([`no-element-overwrite`]) -* Empty collections should not be accessed or iterated ([`no-empty-collection`]) -* Function calls should not pass extra arguments ([`no-extra-arguments`]) -* Related "if/else if" statements should not have the same condition ([`no-identical-conditions`]) -* Identical expressions should not be used on both sides of a binary operator ([`no-identical-expressions`]) -* Return values from functions without side effects should not be ignored ([`no-ignored-return`]) (*uses-types*) -* Loops with at most one iteration should be refactored ([`no-one-iteration-loop`]) -* The output of functions that don't return anything should not be used ([`no-use-of-empty-return-value`]) -* Non-existent operators '=+', '=-' and '=!' should not be used ([`non-existent-operator`]) (:wrench: *fixable*) +- All branches in a conditional structure should not have exactly the same implementation ([`no-all-duplicated-branches`]) +- Collection elements should not be replaced unconditionally ([`no-element-overwrite`]) +- Empty collections should not be accessed or iterated ([`no-empty-collection`]) +- Function calls should not pass extra arguments ([`no-extra-arguments`]) +- Related "if/else if" statements should not have the same condition ([`no-identical-conditions`]) +- Identical expressions should not be used on both sides of a binary operator ([`no-identical-expressions`]) +- Return values from functions without side effects should not be ignored ([`no-ignored-return`]) (_uses-types_) +- Loops with at most one iteration should be refactored ([`no-one-iteration-loop`]) +- The output of functions that don't return anything should not be used ([`no-use-of-empty-return-value`]) +- Non-existent operators '=+', '=-' and '=!' should not be used ([`non-existent-operator`]) (:wrench: _fixable_) ### Code Smell Detection :pig: Code Smells, or maintainability issues, are raised for places of code which might be costly to change in the future. These rules also help to keep the high code quality and readability. And finally, some rules report issues on different suspicious code patterns. -* Cognitive Complexity of functions should not be too high ([`cognitive-complexity`]) -* "if ... else if" constructs should end with "else" clauses ([`elseif-without-else`]) (*disabled*) -* "switch" statements should not have too many "case" clauses ([`max-switch-cases`]) -* Collapsible "if" statements should be merged ([`no-collapsible-if`]) -* Collection sizes and array length comparisons should make sense ([`no-collection-size-mischeck`]) (:wrench: *fixable*, *uses-types*) -* String literals should not be duplicated ([`no-duplicate-string`]) -* Two branches in a conditional structure should not have exactly the same implementation ([`no-duplicated-branches`]) -* Boolean expressions should not be gratuitous ([`no-gratuitous-expressions`]) -* Functions should not have identical implementations ([`no-identical-functions`]) -* Boolean checks should not be inverted ([`no-inverted-boolean-check`]) (:wrench: *fixable*, *disabled*) -* "switch" statements should not be nested ([`no-nested-switch`]) -* Template literals should not be nested ([`no-nested-template-literals`]) -* Boolean literals should not be redundant ([`no-redundant-boolean`]) -* Jump statements should not be redundant ([`no-redundant-jump`]) (:wrench: *fixable*) -* Conditionals should start on new lines ([`no-same-line-conditional`]) (:wrench: *fixable*) -* "switch" statements should have at least 3 "case" clauses ([`no-small-switch`]) -* Collection and array contents should be used ([`no-unused-collection`]) -* "catch" clauses should do more than rethrow ([`no-useless-catch`]) -* Local variables should not be declared and then immediately returned or thrown ([`prefer-immediate-return`]) (:wrench: *fixable*) -* Object literal syntax should be used ([`prefer-object-literal`]) -* Return of boolean expressions should not be wrapped into an "if-then-else" statement ([`prefer-single-boolean-return`]) (:wrench: *fixable*) -* A "while" loop should be used instead of a "for" loop ([`prefer-while`]) (:wrench: *fixable*) +- Cognitive Complexity of functions should not be too high ([`cognitive-complexity`]) +- "if ... else if" constructs should end with "else" clauses ([`elseif-without-else`]) (_disabled_) +- "switch" statements should not have too many "case" clauses ([`max-switch-cases`]) +- Collapsible "if" statements should be merged ([`no-collapsible-if`]) +- Collection sizes and array length comparisons should make sense ([`no-collection-size-mischeck`]) (:wrench: _fixable_, _uses-types_) +- String literals should not be duplicated ([`no-duplicate-string`]) +- Two branches in a conditional structure should not have exactly the same implementation ([`no-duplicated-branches`]) +- Boolean expressions should not be gratuitous ([`no-gratuitous-expressions`]) +- Functions should not have identical implementations ([`no-identical-functions`]) +- Boolean checks should not be inverted ([`no-inverted-boolean-check`]) (:wrench: _fixable_, _disabled_) +- "switch" statements should not be nested ([`no-nested-switch`]) +- Template literals should not be nested ([`no-nested-template-literals`]) +- Boolean literals should not be redundant ([`no-redundant-boolean`]) +- Jump statements should not be redundant ([`no-redundant-jump`]) (:wrench: _fixable_) +- Conditionals should start on new lines ([`no-same-line-conditional`]) (:wrench: _fixable_) +- "switch" statements should have at least 3 "case" clauses ([`no-small-switch`]) +- Collection and array contents should be used ([`no-unused-collection`]) +- "catch" clauses should do more than rethrow ([`no-useless-catch`]) +- Local variables should not be declared and then immediately returned or thrown ([`prefer-immediate-return`]) (:wrench: _fixable_) +- Object literal syntax should be used ([`prefer-object-literal`]) +- Return of boolean expressions should not be wrapped into an "if-then-else" statement ([`prefer-single-boolean-return`]) (:wrench: _fixable_) +- A "while" loop should be used instead of a "for" loop ([`prefer-while`]) (:wrench: _fixable_) [`cognitive-complexity`]: ./docs/rules/cognitive-complexity.md [`elseif-without-else`]: ./docs/rules/elseif-without-else.md @@ -81,20 +81,20 @@ Code Smells, or maintainability issues, are raised for places of code which migh ## Prerequisites -* Node.js (>=12.x). -* ESLint 5.x, 6.x, 7.x or 8.x (peer dependency for the plugin). +- Node.js (>=12.x). +- ESLint 5.x, 6.x, 7.x or 8.x (peer dependency for the plugin). ## Usage -* If you don't have ESLint yet configured for your project, follow [these instructions](https://github.com/eslint/eslint#installation-and-usage). -* Install `eslint-plugin-sonarjs` using `npm` (or `yarn`) for your project or globally: +- If you don't have ESLint yet configured for your project, follow [these instructions](https://github.com/eslint/eslint#installation-and-usage). +- Install `eslint-plugin-sonarjs` using `npm` (or `yarn`) for your project or globally: ```sh npm install eslint-plugin-sonarjs --save-dev # install for your project npm install eslint-plugin-sonarjs -g # or install globally ``` -* Add `eslint-plugin-sonarjs` to the `plugins` option of your `.eslintrc`: +- Add `eslint-plugin-sonarjs` to the `plugins` option of your `.eslintrc`: ```json { @@ -102,7 +102,7 @@ npm install eslint-plugin-sonarjs -g # or install globally } ``` -* Add `plugin:sonarjs/recommended` to the `extends` option to enable all recommended rules: +- Add `plugin:sonarjs/recommended` to the `extends` option to enable all recommended rules: ```json { @@ -110,7 +110,7 @@ npm install eslint-plugin-sonarjs -g # or install globally } ``` -* or enable only some rules manually: +- or enable only some rules manually: ```javascript { @@ -121,15 +121,16 @@ npm install eslint-plugin-sonarjs -g # or install globally } } ``` -* To enable all rules of this plugin, use `@typescript-eslint/parser` as a parser for ESLint ([like we do](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/6e06d59a233e07b28fbbd6398e08b9b0c63b18f9/.eslintrc.js#L4)) and set the [parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject) option. Thanks to it, type information is available, which is beneficial or even essential for some rules. + +- To enable all rules of this plugin, use `@typescript-eslint/parser` as a parser for ESLint ([like we do](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/6e06d59a233e07b28fbbd6398e08b9b0c63b18f9/.eslintrc.js#L4)) and set the [parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject) option. Thanks to it, type information is available, which is beneficial or even essential for some rules. ## Available Configurations -This plugin provides only a `recommended` configuration. Almost all rules are activated in this profile with a few exceptions (check the `disabled` tag in the rules list). The `recommended` configuration activates rules with `error` severity. +This plugin provides only a `recommended` configuration. Almost all rules are activated in this profile with a few exceptions (check the `disabled` tag in the rules list). The `recommended` configuration activates rules with `error` severity. ## ESLint and Sonar -This plugin exposes to ESLint users a subset of JS/TS rules from Sonar-* products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules that are not available in ESLint core or other ESLint plugins to be beneficial for the ESLint community. +This plugin exposes to ESLint users a subset of JS/TS rules from Sonar-\* products (aka [SonarJS](https://github.com/SonarSource/SonarJS)). We extracted the rules that are not available in ESLint core or other ESLint plugins to be beneficial for the ESLint community. If you are a [SonarQube](https://www.sonarqube.org) or [SonarCloud](https://sonarcloud.io) user, to lint your code locally, we suggest using [SonarLint](https://www.sonarlint.org) IDE extension (available for VSCode, JetBrains IDEs and Eclipse). You can connect SonarLint to your SonarQube/SonarCloud project to synchronize rules configuration, issue statuses, etc. diff --git a/docs/rules/no-all-duplicated-branches.md b/docs/rules/no-all-duplicated-branches.md index 8e691dd5..c11a8328 100644 --- a/docs/rules/no-all-duplicated-branches.md +++ b/docs/rules/no-all-duplicated-branches.md @@ -8,8 +8,7 @@ or there shouldn't be a `switch`/`if` chain at all. Note that this rule does not ## Noncompliant Code Example ```javascript -if (b == 0) { - // Noncompliant +if (b == 0) { // Noncompliant doOneMoreThing(); } else { doOneMoreThing(); @@ -17,9 +16,7 @@ if (b == 0) { let a = b === 0 ? getValue() : getValue(); // Noncompliant -switch ( - i // Noncompliant -) { +switch (i) { // Noncompliant case 1: doSomething(); break; diff --git a/docs/rules/no-collection-size-mischeck.md b/docs/rules/no-collection-size-mischeck.md index e60b63cb..48e0c19a 100644 --- a/docs/rules/no-collection-size-mischeck.md +++ b/docs/rules/no-collection-size-mischeck.md @@ -7,19 +7,27 @@ The size of a collection and the length of an array are always greater than or e ## Noncompliant Code Example ```javascript -if (someSet.size >= 0) {...} // Noncompliant +if (someSet.size >= 0) { // Noncompliant + //... +} -if (someMap.size < 0) {...} // Noncompliant +if (someMap.size < 0) { // Noncompliant + //... +} -const result = someArray.length >= 0; // Noncompliant +const result = someArray.length >= 0; // Noncompliant ``` ## Compliant Solution ```javascript -if (someSet.size > 0) {...} +if (someSet.size > 0) { + //... +} -if (someMap.size == 0) {...} +if (someMap.size == 0) { + //... +} const result = someArray.length > 0; ``` diff --git a/docs/rules/no-duplicated-branches.md b/docs/rules/no-duplicated-branches.md index d55e973e..3d126f62 100644 --- a/docs/rules/no-duplicated-branches.md +++ b/docs/rules/no-duplicated-branches.md @@ -28,8 +28,7 @@ if (a >= 0 && a < 10) { doTheThing(); } else if (a >= 10 && a < 20) { doTheOtherThing(); -} else if (a >= 20 && a < 50) { - // Noncompliant; duplicates first condition +} else if (a >= 20 && a < 50) { // Noncompliant; duplicates first condition doFirstThing(); doTheThing(); } else { diff --git a/docs/rules/no-empty-collection.md b/docs/rules/no-empty-collection.md index f4380c21..584d29a5 100644 --- a/docs/rules/no-empty-collection.md +++ b/docs/rules/no-empty-collection.md @@ -7,11 +7,9 @@ When a collection is empty it makes no sense to access or iterate it. Doing so a ```javascript let strings = []; -if (strings.includes('foo')) { -} // Noncompliant +if (strings.includes('foo')) {} // Noncompliant -for (str of strings) { -} // Noncompliant +for (str of strings) {} // Noncompliant strings.forEach(str => doSomething(str)); // Noncompliant ``` diff --git a/docs/rules/no-gratuitous-expressions.md b/docs/rules/no-gratuitous-expressions.md index 0c2b540f..db8abbd4 100644 --- a/docs/rules/no-gratuitous-expressions.md +++ b/docs/rules/no-gratuitous-expressions.md @@ -7,8 +7,7 @@ because it does not match the programmer’s intent, then it’s a bug and the e ```javascript if (a) { - if (a) { - // Noncompliant + if (a) { // Noncompliant doSomething(); } } diff --git a/docs/rules/no-identical-conditions.md b/docs/rules/no-identical-conditions.md index 8c2f9029..4b1ad036 100644 --- a/docs/rules/no-identical-conditions.md +++ b/docs/rules/no-identical-conditions.md @@ -14,8 +14,7 @@ if (param == 1) { openWindow(); } else if (param == 2) { closeWindow(); -} else if (param == 1) { - // Noncompliant +} else if (param == 1) { // Noncompliant moveWindowToTheBackground(); } diff --git a/docs/rules/no-identical-expressions.md b/docs/rules/no-identical-expressions.md index 05cf9854..78396ad4 100644 --- a/docs/rules/no-identical-expressions.md +++ b/docs/rules/no-identical-expressions.md @@ -11,12 +11,10 @@ This rule ignores `*`, `+`, and `=`. ## Noncompliant Code Example ```javascript -if (a == b && a == b) { - // if the first one is true, the second one is too +if (a == b && a == b) { // Noncompliant: if the first one is true, the second one is too doX(); } -if (a > a) { - // always false +if (a > a) { // Noncompliant: always false doW(); } @@ -33,8 +31,7 @@ Similarly, left-shifting 1 onto 1 is common in the construction of bit masks, an Moreover comma operator , and `instanceof` operator are ignored as there are use-cases when there usage is valid. ```javascript -if (f !== f) { - // test for NaN value +if (f !== f) { // test for NaN value console.log('f is NaN'); } diff --git a/docs/rules/no-identical-functions.md b/docs/rules/no-identical-functions.md index a1287368..a88e628e 100644 --- a/docs/rules/no-identical-functions.md +++ b/docs/rules/no-identical-functions.md @@ -12,8 +12,7 @@ function calculateCode() { return code; } -function getName() { - // Noncompliant +function getName() { // Noncompliant doTheThing(); doOtherThing(); return code; diff --git a/docs/rules/no-inverted-boolean-check.md b/docs/rules/no-inverted-boolean-check.md index 249e8a88..712587ba 100644 --- a/docs/rules/no-inverted-boolean-check.md +++ b/docs/rules/no-inverted-boolean-check.md @@ -7,11 +7,15 @@ It is needlessly complex to invert the result of a boolean comparison. The oppos ## Noncompliant Code Example ```javascript -if (!(a === 2)) { ... } // Noncompliant +if (!(a === 2)) { // Noncompliant + //... +} ``` ## Compliant Solution ```javascript -if (a !== 2) { ... } +if (a !== 2) { + //... +} ``` diff --git a/docs/rules/no-nested-switch.md b/docs/rules/no-nested-switch.md index 7b09f063..4135cc50 100644 --- a/docs/rules/no-nested-switch.md +++ b/docs/rules/no-nested-switch.md @@ -10,15 +10,13 @@ Specifically, you should structure your code to avoid the need for nested `switc function foo(n, m) { switch (n) { case 0: - switch ( - m // Noncompliant; nested switch + switch (m) { // Noncompliant; nested switch // ... - ) { } case 1: - // ... + // ... default: - // ... + // ... } } ``` @@ -31,17 +29,15 @@ function foo(n, m) { case 0: bar(m); case 1: - // ... + // ... default: - // ... + // ... } } function bar(m) { - switch ( - m + switch (m) { // ... - ) { } } ``` diff --git a/docs/rules/no-redundant-boolean.md b/docs/rules/no-redundant-boolean.md index 8c247fe3..94a30113 100644 --- a/docs/rules/no-redundant-boolean.md +++ b/docs/rules/no-redundant-boolean.md @@ -5,15 +5,9 @@ Redundant Boolean literals should be removed from expressions to improve readabi ## Noncompliant Code Example ```javascript -if (booleanMethod() == true) { - /* ... */ -} -if (booleanMethod() == false) { - /* ... */ -} -if (booleanMethod() || false) { - /* ... */ -} +if (booleanMethod() == true) { /* ... */ } +if (booleanMethod() == false) { /* ... */ } +if (booleanMethod() || false) { /* ... */ } doSomething(!false); doSomething(booleanMethod() == true); ``` @@ -21,15 +15,9 @@ doSomething(booleanMethod() == true); ## Compliant Solution ```javascript -if (booleanMethod()) { - /* ... */ -} -if (!booleanMethod()) { - /* ... */ -} -if (booleanMethod()) { - /* ... */ -} +if (booleanMethod()) { /* ... */ } +if (!booleanMethod()) { /* ... */ } +if (booleanMethod()) { /* ... */ } doSomething(true); doSomething(booleanMethod()); ``` diff --git a/docs/rules/no-same-line-conditional.md b/docs/rules/no-same-line-conditional.md index a5f4afad..fdbb1f58 100644 --- a/docs/rules/no-same-line-conditional.md +++ b/docs/rules/no-same-line-conditional.md @@ -9,9 +9,7 @@ Code is clearest when each statement has its own line. Nonetheless, it is a comm ```javascript if (condition1) { // ... -} -if (condition2) { - // Noncompliant +} if (condition2) { // Noncompliant //... } ``` diff --git a/docs/rules/no-useless-catch.md b/docs/rules/no-useless-catch.md index 6deea7ea..00f151b9 100644 --- a/docs/rules/no-useless-catch.md +++ b/docs/rules/no-useless-catch.md @@ -9,8 +9,7 @@ Such clauses should either be eliminated or populated with the appropriate logic ```javascript try { doSomething(); -} catch (ex) { - // Noncompliant +} catch (ex) { // Noncompliant throw ex; } ``` diff --git a/docs/rules/prefer-while.md b/docs/rules/prefer-while.md index 0dc6689e..29ac9439 100644 --- a/docs/rules/prefer-while.md +++ b/docs/rules/prefer-while.md @@ -7,15 +7,11 @@ When only the condition expression is defined in a `for` loop, and the initializ ## Noncompliant Code Example ```javascript -for (; condition; ) { - /*...*/ -} +for (;condition;) { /*...*/ } ``` ## Compliant Solution ```javascript -while (condition) { - /*...*/ -} +while (condition) { /*...*/ } ``` diff --git a/tsconfig.json b/tsconfig.json index b610b988..b36491a7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,5 @@ "outDir": "lib", "sourceMap": true }, - "include": ["ruling", "src", "tests", "typings"], - "exclude": ["ruling/javascript-test-sources"] + "include": ["src/**/*.ts"] } From d0c3f43fbc8b77ecf9d8c1c681b5d007c5b8327d Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Wed, 22 Nov 2023 15:09:31 +0100 Subject: [PATCH 6/8] update .npmignore --- .npmignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index 69aad075..50725cc1 100644 --- a/.npmignore +++ b/.npmignore @@ -9,6 +9,7 @@ .idea/ .vscode/ .github/ +.husky coverage/ docs/ @@ -20,13 +21,13 @@ tests/ .gitattributes .gitmodules .npmignore +.prettierignore .travis.yml .eslintrc.js .editorconfig sonar-project.properties test-report.xml tsconfig.json -tsconfig-src.json .cirrus/ .cirrus.yml .jfrog/ From 11c4a6681fd9fd1280cb4bc1241d9f8551cd24f1 Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Wed, 22 Nov 2023 15:33:28 +0100 Subject: [PATCH 7/8] check format during build do not run qa if build fails --- .cirrus.yml | 4 +++- package.json | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 2a74489e..b2bc1dbe 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -41,12 +41,14 @@ build_task: - jfrog config add repox --url $ARTIFACTORY_URL --access-token $ARTIFACTORY_DEPLOY_ACCESS_TOKEN - jfrog rt npm-config --repo-resolve npm --repo-deploy sonarsource-npm-public-qa - jfrog rt npm-ci + - npm run check-format - npm run build - ./scripts/test-ci.sh - ./scripts/analyze_and_publish.sh qa_task: - <<: *ONLY_SONARSOURCE_QA + depends_on: + - build eks_container: matrix: - docker_arguments: diff --git a/package.json b/package.json index 02019827..26b71e90 100644 --- a/package.json +++ b/package.json @@ -19,13 +19,14 @@ "node": ">=14" }, "scripts": { - "build": "rimraf lib && npm run format && tsc -d -p tsconfig.json", + "build": "rimraf lib && tsc -d -p tsconfig.json", "test": "jest", "ruling": "ts-node --files ruling/index.ts", "precommit": "pretty-quick --staged", "prepare": "husky install .husky", "prepack": "npm run build", - "format": "prettier --write ." + "format": "prettier --write .", + "check-format": "prettier --list-different ." }, "peerDependencies": { "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" From 11fa91995218986138d047b51c19a9655e77a822 Mon Sep 17 00:00:00 2001 From: Victor Diez Date: Wed, 22 Nov 2023 15:47:51 +0100 Subject: [PATCH 8/8] ignore jfrog files --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index 2afd5118..d637bc91 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ .github +.jfrog coverage lib javascript-test-sources