Skip to content

Releases: SonarSource/SonarJS

10.5.0

23 Aug 13:28
9b387ed

Choose a tag to compare

milestone: https://github.com/SonarSource/SonarJS/milestone/76?closed=1

This release will be part of SonarQube 10.2

10.4.0

04 Aug 14:56
29853cc

Choose a tag to compare

What's Changed

  • Prepare next development iteration by @saberduck in #4023
  • Add rule S6653 (prefer-object-has-own): Use Object.hasOwn static method instead of hasOwnProperty by @alexander-kamushkin-sonarsource in #4018
  • Add rule S6660 (no-lonely-if): If statements should not be the only statement in else blocks by @alexander-kamushkin-sonarsource in #4022
  • Upgrade sonar-lits-plugin to 0.11.0.2659 by @Godin in #4017
  • Add rule S6661 (prefer-object-spread): Object spread syntax should be used instead of Object.assign by @alexander-kamushkin-sonarsource in #4024
  • Update ruling results formatting due to sonar-lits-plugin change by @alexander-kamushkin-sonarsource in #4026
  • Add rule S6666 (prefer-spread): Spread syntax should be used instead of apply() by @alexander-kamushkin-sonarsource in #4029
  • Add rule S6671 (prefer-promise-reject-errors): Literals should not be used for promise rejection by @alexander-kamushkin-sonarsource in #4030
  • Add rule S1199 (no-lone-block): Nested code blocks should not be used by @alexander-kamushkin-sonarsource in #4032
  • Add rule S6676 (no-useless-call): Calls to .call() and .apply() methods should not be redundant by @alexander-kamushkin-sonarsource in #4033
  • Add rule S1068 (no-unused-private-class-members): Unused private class members should be removed by @alexander-kamushkin-sonarsource in #4034
  • Update "submit review" and "request review" actions to work for projectsV2 by @ilia-kebets-sonarsource in #4012
  • Update S1523 (code-eval): merge ESLint no-script-url by @alexander-kamushkin-sonarsource in #4037
  • Add rule S6679 (no-self-compare): Number.isNaN() should be used to check for NaN value by @alexander-kamushkin-sonarsource in #4040
  • Update rule descriptions after migration to LAYC by @victor-diez-sonarsource in #4041
  • Actions point to production branch by @ilia-kebets-sonarsource in #4039
  • Update S1192 (no-duplicate-string): Add ignoreStrings rule property by @yassin-kammoun-sonarsource in #3959
  • Update rule metadata by @yassin-kammoun-sonarsource in #4044

Full Changelog: 10.3.2.22047...10.4.0.22160

Part of SonarQube 10.2

10.3.2

12 Jul 16:13
91aa346

Choose a tag to compare

Bugfix release to fix performance regression on projects with many tsconfig.json files.

10.3.1

13 Jun 13:09
f95f3d1

Choose a tag to compare

10.3.0

12 Jun 10:02
9c62289

Choose a tag to compare

milestone: https://github.com/SonarSource/SonarJS/milestone/72?closed=1

This brings 5 new and 7 improved rules for core JavaScript and TypeScript features.
Also, analysis now works with all TypeScript 5 code and compiler options.

The updates are available in SonarCloud, and will be included in SonarQube 10.1, and in the next release of SonarLint.

New rules

  1. S6643: Prototypes of builtin objects should not be modified
  2. S6638 (no-constant-binary-expression) Binary expressions should not always return the same value
  3. S6637 (no-extra-bind): Unnecessary calls to .bind() should not be used
  4. S6635 (no-constructor-return) Constructors should not return values
  5. S2430 (new-cap) Constructor names should start with an uppercase letter

Improved rules

  1. S3796 (array-callback-without-return): cover new array functions, typed arrays and bracket notation
  2. S1528 (array-constructor): add quickfix
  3. S4043 (no-misleading-array-reverse) to suggest using toReversed or toSorted
  4. S4622 (max-union-size): Ignore unions used with utility types
  5. S1128 (unused-import): Support usage in JSDoc comments
  6. S1128 (unused-import): Ignore imported symbols used as Vue.js directives
  7. S6544 (no-misused-promises): Don't flag Promise-returning function provided to attribute where a void return was expected in JSX attributes. Also do not flag not awaited, resolved or error-handled promises.

Rule descriptions

300+ small fixes to rule descriptions where there were small inconsistencies in casing, titles, etc.

10.2.0

28 Apr 14:04
2007aa0

Choose a tag to compare

https://github.com/SonarSource/SonarJS/milestone/71?closed=1

This will be released in SonarQube 10.1

New rules

  1. Add rule S6606: Nullish coalescing should be preferred
  2. Add rule S6598: Function types should be preferred
  3. Add rule S6594: "RegExp.exec()" should be preferred over "String.match()"
  4. Add rule S6583: Enum members should not mix value types
  5. Add rule S6590: "as const" assertions should be preferred
  6. Add rule S6582: Optional chaining should be preferred
  7. Add rule S6578: Enum values should be unique
  8. Add rule S6572: Enum member values should be either all initialized or none
  9. Add rule S6571 (no-redundant-type-constituents): Redundant types should not be used
  10. Add rule S2094 (no-empty-class-check): Classes should not be empty
  11. Add rule S6565: prefer-return-this-type
  12. Add rule S6569: Unnecessary type constraints should be removed
  13. Add rule S6568 (no-confusing-non-null-assertion)
  14. Add rule S6564: Redundant type aliases should not be used
  15. Add rule S6551 (no-base-to-string): Objects and classes converted or coerced to strings should define a "toString()" method
  16. Add rule S6557: Ends of strings should be checked with "startsWith()" and "endsWith()"
  17. Add rule S6550 (prefer-literal-enum-member): All enum members should be literals

Improved rules

  1. Update S3402 (no-incorrect-string-concat): Consider the addition assignment operator
  2. Update rule S6544: add TypeScript/eslint's no-floating-promises rule
  3. Update rule S6544: add no-misused-promises cases
  4. Update S2871 (no-alphabetical-sort): Cover cases from require-array-sort-compare
  5. Update S4139 (no-for-in-array): Cover cases from TypeScript ESLint implementation
  6. Fix FP S131 (switch-without-default): Ignore exhaustive switches on unions and enums

10.1.0

24 Mar 11:00
5e1c02b

Choose a tag to compare

What's Changed

This release brings more advanced support for JavaScript built-ins with 8 new rules and 14 improved rules.

Milestone: https://github.com/SonarSource/SonarJS/milestone/69?closed=1

Part of SonarQube 10.0

10.0.1

17 Feb 10:54
f58ba51

Choose a tag to compare

10.0.0

10 Feb 14:16
e112541

Choose a tag to compare

What's Changed

Full Changelog: 9.13.0.20537...10.0.0.20728

Part of SonarQube 10.0

9.13.0

13 Jan 16:07
68ff765

Choose a tag to compare

https://github.com/SonarSource/SonarJS/issues?q=is%3Aclosed+milestone%3A9.13

What's Changed

Full Changelog: 9.12.1.20358...9.13.0.20537