# Ignore a particular rule in React TypeScript framework

**URL:** <https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube\
**Created:** [January 26, 2021, 8:26pm UTC](https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638 "2021-01-26T20:26:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SowmyaP](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SowmyaP](https://community.sonarsource.com/u/SowmyaP)\
**Post date:** [January 26, 2021, 8:26pm UTC](https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638/1 "2021-01-26T20:26:10Z")

</div>

Sonar Version:

- Data Center Edition
- Version 7.9.1 (build 27448)
- [LGPL v3](http://www.gnu.org/licenses/lgpl-3.0.txt)

Issue:  
Seeing code smell error - typescript:S4328

Details:  
Dependencies should be explicit

Dependencies should be explicitly listed in the `package.json` file. Importing a module that is not declared as a dependency makes it an implicit one and is bound to create problems.

Need Help:  
Above dependency need to be imported in individual files. Ask is to ignore this rule within code base. We have approx. 150 developers working on multiple projects with the same parent project. So //NoSonar will not work.

We do have a sonar file with some exclusions like  
“sonar.test.inclusions”: `"${relDirname}/ **/ __tests__ /**"`,  
“sonar.exclusions”:  
“\*\*/\*.abc.tsx, \*\*/jest.config.js, **/abc-api/** ”,

Please suggest the format to add a line to ignore `typescript:S4328` or any other way.  
Thanks in advance,  
Sowmya

---

<div class="post-metadata">

**Author:** ![Aaron\_Montana1](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/aaron_montana1/32/18738_2.png) [@Aaron\_Montana1](https://community.sonarsource.com/u/Aaron_Montana1)\
**Post date:** [January 26, 2021, 9:44pm UTC](https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638/2 "2021-01-26T21:44:01Z")

</div>

Howdy Sowmya,

Thanks for the question. It looks like you want to [Ignore an Issue on Multiple Criteria](https://docs.sonarqube.org/7.9/project-administration/narrowing-the-focus/#header-2).

To do that navigate to **Administration \> General Settings \> Analysis Scope \> Issues** and scroll down to the section “Ignore Issues on Multiple Criteria” - you should be able to enter something like the image shown below.

 ![Screen Shot 2021-01-26 at 3.34.24 PM](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/8/e/8e9f57e5cd6dd88dff4ba6e400144971a97c8eff.png)

I believe that this setting can only be set in the UI.

The other approach would be to remove this rule from the Quality Profile, but I think your initial instinct to ignore the issue raised during analysis in a more targeted way is probably better.

I hope that helps, let me know if you have any other questions.

thanks,  
Aaron

---

<div class="post-metadata">

**Author:** ![SowmyaP](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SowmyaP](https://community.sonarsource.com/u/SowmyaP)\
**Post date:** [January 26, 2021, 10:21pm UTC](https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638/3 "2021-01-26T22:21:38Z")

</div>

Thanks Aaron,

Will try and let you know in case of further clarifications. I was wondering if we can do internally within the code base.

Regards,  
Sowmya

---

<div class="post-metadata">

**Author:** ![SowmyaP](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SowmyaP](https://community.sonarsource.com/u/SowmyaP)\
**Post date:** [January 29, 2021, 7:39pm UTC](https://community.sonarsource.com/t/ignore-a-particular-rule-in-react-typescript-framework/37638/4 "2021-01-29T19:39:09Z")

</div>

Hi Aaron,

Turns out that none of us has Admin rights and can’t fix through Sonar UI `Administration > General Settings > Analysis Scope > Issues `

Is there any solution through code that you can suggest?

Thanks,  
Sowmya
