Skip to content

Releases: SonarSource/SonarJS

9.2.0

19 Apr 10:02
e917f25
Compare
Choose a tag to compare

In this release, we now explicitly require Node.js 12.22.0 as a minimum for CSS, JavaScript, and TypeScript analysis. Previously, we only considered the major version of Node.js. We also upgraded Stylelint dependency and updated the configuration of a few rules on the same occasion. A consequence of this upgrade is introducing a custom implementation of S5362 and the activation of S4650 in the default profile, which used to overlap with one another. Finally, we improved the behavior of a few JavaScript and TypeScript rules.

CSS

  • Update Stylelint to 14.6.1 (#3089)
  • Update S4649 ('font-family-no-missing-generic-family-keyword'): support 'ignoreFontFamilies' option (#3095)
  • Update S4653 ('unit-no-unknown'): Drop obsolete hardcoded configuration (#3108)
  • Update S4662 ('at-rule-no-unknown'): Ignore TailwindCSS main directives by default (#3107)
  • Fix FP S4660 ('selector-pseudo-element-no-unknown'): Ignore Blazor '::deep' combinator (#3096)
  • Fix FP S4662 ('at-rule-no-unknown'): Ignore Sass forward rule (#3094)
  • Activate S4650 ('function-calc-no-unspaced-operator') in default profile (#3106)

JavaScript / TypeScript

  • Improve S100 ('function-name'): Ignore React Functional Components (#3109)
  • Improve S138 ('sonar-max-lines-per-function'): Ignore React Functional Components (#3104)
  • Improve S4328 ('no-implicit-dependencies'): Consider 'baseUrl' (#3087)
  • Improve S4328 ('no-implicit-dependencies'): Check package.json files in all levels up (#3102)

Miscellaneous

  • Require Node.js 12.22.0 (#3111)

Part of SonarQube 9.5

9.1.1

07 Apr 10:45
9e47916
Compare
Choose a tag to compare

Bug fix for the documentation at docs.sonarsource.com

9.1.0

29 Mar 13:03
e9a6665
Compare
Choose a tag to compare

In this release, and as promised previously, we extend our offering of rules providing quick fixes with a new pack of 30 more rules. This now makes a total of 53 rules that will propose solutions to fix your code flaws as you write code in your IDEs. Finally, this release introduces the support of TypeScript 4.6, and it also enables S1172 ('no-unused-function-argument') in the default profile.

Quick fixes

  • Add quick fix for S108 ('no-empty') (#3057)
  • Add quick fix for S125 ('no-commented-code') (#3037)
  • Add quick fix for S1110 ('no-redundant-parentheses') (#3039)
  • Add quick fix for S1126 ('prefer-single-boolean-return') (#3064)
  • Add quick fix for S1128 ('unused-import') (#3059)
  • Add quick fix for S1172 ('no-unused-function-argument') (#3038)
  • Add quick fix for S1186 ('no-empty-function') (#3056)
  • Add quick fix for S1533 ('no-primitive-wrappers') (#3042)
  • Add quick fix for S1534 (no-dupe-keys) (#3036)
  • Add quick fix for S1763 ('no-unreachable') (#3051)
  • Add quick fix for S2688 ('use-isnan') (#3058)
  • Add quick fix for S2757 ('non-existent-operator') (#3063)
  • Add quick fix for S2871 ('no-alphabetical-sort') (#3043)
  • Add quick fix for S2990 ('no-global-this') (#3044)
  • Add quick fix for S3403 ('different-types-comparison') (#3045)
  • Add quick fix for S3415 ('inverted-assertion-arguments') (#3046)
  • Add quick fix for S3626 ('no-redundant-jump') (#3065)
  • Add quick fix for S3696 ('no-throw-literal') (#3050)
  • Add quick fix for S3863 ('no-duplicate-imports-decorator') (#3070)
  • Add quick fix for S3972 ('no-same-line-conditional') (#3066)
  • Add quick fix for S3981 ('no-collection-size-mischeck') (#3067)
  • Add quick fix for S3984 ('no-unthrown-error') (#3041)
  • Add quick fix for S4138 ('prefer-for-of') (#3062)
  • Add quick fix for S4322 ('prefer-type-guard') (#3052)
  • Add quick fix for S4619 ('no-in-misuse') (#3053)
  • Add quick fix for S4621 ('no-duplicate-in-composite') (#3061)
  • Add quick fix for S4623 ('no-undefined-argument') (#3040)
  • Add quick fix for S4634 ('prefer-promise-shorthand') (#3049)
  • Add quick fix for S4782 ('no-redundant-optional') (#3060)
  • Add quick fix for S6325 ('prefer-regex-literals') (#3048)

Miscellaneous

  • Activate S1172 ('no-unused-function-argument') in default profile (#3035)
  • Support TypeScript 4.6 (#3068)

Part of SonarQube 9.4

9.0.0.17505

08 Mar 15:09
45f671f
Compare
Choose a tag to compare
  • support TypeScript 4.5
  • drop support for Node.js 10
  • upgrade to ESLint 8.x (technical dependency)

P.S. We bumped the major version so that major version is with sync with major version of SonarQube it's gonna be part of.

Part of SonarQube 9.4

8.9.0

21 Feb 16:32
5d05b42
Compare
Choose a tag to compare

In this release, we introduce the support of Quick Fixes for JavaScript/TypeScript analysis in IDEs. We provide a total of 23 rules with quick fixes for now, and there will be more to come soon.

Here are the 23 rules that currently support quick fixes:

Last but not least, this release also includes fixes for a few FPs tickets as well as some enhancements:

  • Exclude import statements from duplication computation (#2954)
  • Introduce back sonar.typescript.lcov.reportPaths as alias for sonar.javascript.lcov.reportPaths (#2958)
  • Improve warning messages for Node.js deprecation (#2959
  • Update message for S2819 ('post-message') (#2956)
  • Match S1172 ('no-unused-function-argument') behaviour to TypeScript compiler (#2964)
  • Enable S1172 ('no-unused-function-argument') for TypeScript (#2964)
  • Fix FP S1135 ('todo-tag'): surrounding accented characters should be considered (#2960)
  • Fix FP S3317 ('file-name-differ-from-class'): consider dot notation in filenames (#2963)
  • Fix FP S4822 ('no-try-promise'): consider yield as an alternative to await (#2962))
  • Upgrade eslint-plugin-sonarjs to 0.12.0 (#2967)

Part of SonarQube 9.4

8.8.0

21 Jan 15:08
a381593
Compare
Choose a tag to compare

In this release, we deprecated Node.js 12 support for JavaScript, TypeScript, and CSS analyses. It will still be possible to run analyses on Node.js 12 until complete end of support which is planned for August 2022. In the meantime, users are highly encouraged to upgrade their setup to Node.js 16 LTS. Last but not least, this release also includes fixes for a few FPs tickets.

  • Deprecating Node.js 12 support for JS/TS/CSS analyses (#2927)
  • S3735: Promises should be ignored (#2928)
  • S2259: Optional chaining should be ignored (#2930)

Part of SonarQube 9.3

8.7.0

13 Dec 15:20
22771f9
Compare
Choose a tag to compare

In this release we change the approach to the analysis of TypeScript files. Before we were relying on tsconfig files to get the list of concerned files, which was not always reliable (due to dependencies in those files). Now we build the program, which provides us with the list of files. Due to this change more files could be analyzed now. Also since this release if you want to analyze TS files, at least one tsconfig.json should be present in the project directory.

This new approach is not applied if there is at least one .vue file with TypeScript script.

  • Program-based analysis of TypeScript (fixed #2073)

  • Fixes to support Aura Lightning Components (#2885)

  • Support directories in references in tsconfig (#2815)

  • Rely on Java 11

Full Changelog: 8.6.0.16913...8.7.0.17094
Full issue list: https://github.com/SonarSource/SonarJS/milestone/47?closed=1

8.6.0

16 Nov 09:44
701a9ce
Compare
Choose a tag to compare

In this release, we merged CSS analysis, which was previously provided by the sonar-css plugin into the single plugin together with JS and TS analysis.

As usual it contains a bunch of bugfixes. See milestone for details https://github.com/SonarSource/SonarJS/issues?q=is%3Aclosed+milestone%3A8.6

8.5.0

01 Nov 09:42
c558025
Compare
Choose a tag to compare

This release contains 8 new rules covering common pitfalls when writing JS unit tests

  • S2699 Tests should include assertions
  • S2970 Assertions should be complete
  • S3415 Assertion arguments should be passed in the correct order
  • S5863 Assertions should not be given twice the same argument
  • S5958 Tests should check which exception is thrown
  • S6079 Tests should not execute any code after "done()" is called
  • S6080 Mocha timeout should be disabled by setting it to "0".
  • S6092 Chai assertions should have only one reason to succeed

We now also support TypeScript 4.4

As usual, we also include minor improvements and bugfixes.
Full list of fixed issues: https://github.com/SonarSource/SonarJS/milestone/45?closed=1

8.4.0

10 Sep 08:54
a11eb10
Compare
Choose a tag to compare

One more bunch of rules targeting regular expressions (MMF-2480):

  • S5869 Character classes in regular expressions should not contain the same character twice
  • S6019 Reluctant quantifiers in regular expressions should be followed by an expression that can't match the empty string
  • S6351 Regular expressions with the global flag should be used with caution
  • S5843 Regular expressions should not be too complicated
  • S5867 Regular expressions with Unicode property escapes should set Unicode flag
  • S5842 Repeated patterns in regular expressions should not match the empty string
  • S6353 Regular expression quantifiers and character classes should be used concisely
  • S5852 Using slow regular expressions is security-sensitive