Repository navigation
chore(deps): upgrade eslint-plugin-sonarjs to 4.2.2 - #3560
Merged
Merged
Conversation
3.0.5 pins minimatch to exactly 9.0.5, which has known ReDoS advisories and cannot be refreshed in range. 4.x depends on minimatch ^10.2.6. eslint-plugin-sonarjs declares typescript as a regular dependency, so Yarn installs its own copy (6.0.3) next to the 5.8.2 the parser uses. SyntaxKind values differ between the two, and the plugin crashed in sonarjs/assertions-in-tests. A root resolution makes it use 5.8.2. Fix the violations reported by the new rules in @joint/react tests and drop disable directives that no longer suppress anything.
kumilingus
marked this pull request as ready for review
October 25, 2026 16:59
zbynekstara
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades
eslint-plugin-sonarjsfrom3.0.5to4.2.2in@joint/eslint-config.3.0.5depends on exactly[email protected], which has known ReDoS advisories. Because the pin is exact, it can't be refreshed in range.4.xdepends onminimatch ^10.2.6, and[email protected]is no longer in the lockfile.TypeScript resolution
eslint-plugin-sonarjsdeclarestypescript(>=5 <6.1.0) as a regular dependency, not a peer dependency. Yarn resolves that range on its own and installs a nested[email protected]for the plugin. The parser (typescript-eslint) uses the hoisted5.8.2.SyntaxKindvalues differ between the two versions.244isExpressionStatementin 5.8 andVariableStatementin 6.0. So the plugin treated a top-leveldescribe(...)as a variable statement and crashed:A root resolution makes the plugin use the same TypeScript as the parser:
If the exact
5.8.2pins are bumped later, this resolution has to move with them.Lint fixes in
@joint/reacttestsThe new rule versions reported 39 errors, all in
@joint/reacttests:sonarjs/prefer-specific-assertionsexpect(x.length).toBe(n)→expect(x).toHaveLength(n)sonarjs/assertions-in-testsnot.toThrow()around smoke renders,resolves.toBeUndefined(), spies onsetGrid/matrixfor the grid/transform test, atoHaveLength(1)sanity check in benchmarks (as the other benchmarks do)sonarjs/no-trivial-assertionsexpect(true).toBe(true)with real checks. The two compile-only type test files keep it, with a disable comment and the reasonsonarjs/no-floating-point-equalitytoBe(0.x)→toBeCloseTo(0.x)eslint --fixalso removed 5 disable directives that no longer suppress anything.Testing
yarn lintpasses in all workspacesyarn workspace @joint/react run testpasses: typecheck, knip, coverage, and Jest on React 19 (1065 tests) and React 18 (1061 tests)yarn install --immutableis clean