-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add section in .sonarrc to ignore responses from certain domains #179
Conversation
This feature is for the users to say "I don't want you to run any rules in these domains". This means that it can't be handled at the rule level but rather
|
@molant I've changed how we check if the url is ignored or not. I'm adding the label |
src/lib/sonar.ts
Outdated
import * as browserslist from 'browserslist'; | ||
import { EventEmitter2 as EventEmitter } from 'eventemitter2'; | ||
import * as url from 'url'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built-in packages go on the top.
src/lib/sonar.ts
Outdated
let ignored = false; | ||
|
||
if (urlsIgnored) { | ||
for (const urlIgnored of urlsIgnored) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use 'some()' instead of for of and break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a Set, there is no 'some()' method. Do you want me to change to an Array?
src/lib/sonar.ts
Outdated
const ignoredUrls = this.ignoredUrls.get('all'); | ||
|
||
if (ignoredUrls) { | ||
for (const ignoredUrlGlobal of ignoredUrls) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 'some' and if found then return promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged with some minor modifications.
@@ -7,10 +7,11 @@ | |||
// Requirements | |||
// ------------------------------------------------------------------------------ | |||
|
|||
import { EventEmitter2 as EventEmitter } from 'eventemitter2'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EventEmitter2
should be in the second group.
(I'll fix it).
Fix #108