Skip to content

Commit

Permalink
Fix: Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sarvaje committed Feb 5, 2018
1 parent 6e59753 commit 7ea02a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ export interface IORA {
text: string;
}

/**
* Represent an user in a npm package.
*/
export type NpmMaintainer = {
email: string;
username: string;
};

/**
* Represent the result of a npm search.
*/
export type NpmPackage = {
date: Date;
description: string;
Expand Down
8 changes: 8 additions & 0 deletions src/lib/utils/resource-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,19 @@ const filterPackages = (packages: Array<NpmPackage>, initTerm: string) => {
export const getExternalRulesFromNpm = async () => {
const rules = await getNpmPackages('sonarwhal-rule');

/*
* We need to filter the results because the search can
* include other packages that doesn't start with `sonarwhal-rule`.
*/
return filterPackages(rules, 'sonarwhal-rule');
};

export const getCoreRulesFromNpm = async () => {
const rules = await getNpmPackages('@sonarwhal/rule');

/*
* We need to filter the results because the search can
* include other packages that doesn't start with `@sonarwhal/rule`.
*/
return filterPackages(rules, '@sonarwhal/rule');
};

0 comments on commit 7ea02a1

Please sign in to comment.