# New rules for JavaScript and TypeScript, improvements for React Redux, SAP UI5, and more!

**URL:** <https://community.sonarsource.com/t/new-rules-for-javascript-and-typescript-improvements-for-react-redux-sap-ui5-and-more/67240>\
**Category:** Sonar Updates\
**Tags:** css, typescript, javascript\
**Created:** [June 30, 2022, 8:32am UTC](https://community.sonarsource.com/t/new-rules-for-javascript-and-typescript-improvements-for-react-redux-sap-ui5-and-more/67240 "2022-06-30T08:32:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gab](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/gab/32/72206_2.png) [@gab](https://community.sonarsource.com/u/gab)\
**Post date:** [June 30, 2022, 8:32am UTC](https://community.sonarsource.com/t/new-rules-for-javascript-and-typescript-improvements-for-react-redux-sap-ui5-and-more/67240/1 "2022-06-30T08:32:33Z")

</div>

**JavaScript and TypeScript**

New rules

- [S5148](https://rules.sonarsource.com/javascript/RSPEC-5148): Detects risky uses of `window.open` without a `noopener` argument. This can be used to create phishing attacks in some circumstances.
- [S4125](https://rules.sonarsource.com/javascript/RSPEC-4125): Detects when `typeof` is used with an invalid value. This helps a lot with small typos that are hard to see otherwise.
- [S6397](https://rules.sonarsource.com/javascript/RSPEC-6397): Detects superfluous character classes in RegExp when you are only matching one character. This makes the regular expression easier to read by removing the unnecessary `[` and `]` characters.

Improvements

- [S1788](https://rules.sonarsource.com/javascript/RSPEC-1788): No longer produces false positives for React Redux projects, where an initial state is commonly used as a default value of the state argument in a reducer. Small change but a big relief for Redux projects.
- [S3616](https://rules.sonarsource.com/javascript/RSPEC-3616): No longer raises warnings on expressions in the `case`’s of a `switch(true)` pattern. Use it wisely though!
- [S2259](https://rules.sonarsource.com/javascript/RSPEC-2259): Is now smarter detecting cases where calling a property of a `null` or `undefined` value would produce an error.
- When using the [SAP UI5](https://blogs.sap.com/2021/08/23/what-is-sapui5/) framework, we no longer raise a warning for the global variable `sap`. We know you’re out there SAP developers.

**CSS**

- [S4666](https://rules.sonarsource.com/css/RSPEC-4666): No longer raises false positives in SCSS when string interpolation is used in selectors.

_Other updates_

- Updated to [TypeScript 4.7](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/)
- Updated to [StyleLint 14.9.1](https://github.com/stylelint/stylelint/releases/tag/14.9.1)

These improvements are available on [SonarCloud](https://sonarcloud.io/), in the SonarQube 9.6 release and in the next SonarLint releases.

Please share any feedback. Enjoy!

Cheers,  
Gabriel
