Migrated to ESLint

This commit is contained in:
squidfunk
2021-02-07 17:43:13 +01:00
parent 4744d5f3f0
commit 208c9ac3fd
65 changed files with 1968 additions and 393 deletions

View File

@@ -20,7 +20,7 @@
* IN THE SOFTWARE.
*/
import { Observable, Subject, defer, of, NEVER } from "rxjs"
import { NEVER, Observable, Subject, defer, of } from "rxjs"
import {
catchError,
filter,
@@ -35,10 +35,7 @@ import { renderSourceFacts } from "~/templates"
import { hash } from "~/utilities"
import { Component } from "../../_"
import {
fetchSourceFacts,
SourceFacts
} from "../facts"
import { SourceFacts, fetchSourceFacts } from "../facts"
/* ----------------------------------------------------------------------------
* Types
@@ -69,7 +66,7 @@ let fetch$: Observable<Source>
*
* @param el - Repository information element
*
* @return Repository information observable
* @returns Repository information observable
*/
export function watchSource(
el: HTMLAnchorElement
@@ -108,7 +105,7 @@ export function watchSource(
*
* @param el - Repository information element
*
* @return Repository information component observable
* @returns Repository information component observable
*/
export function mountSource(
el: HTMLAnchorElement

View File

@@ -43,7 +43,7 @@ export type SourceFacts = string[]
*
* @param url - Repository URL
*
* @return Repository facts observable
* @returns Repository facts observable
*/
export function fetchSourceFacts(
url: string
@@ -53,12 +53,12 @@ export function fetchSourceFacts(
/* GitHub repository */
case "github":
const [, user, repo] = url.match(/^.+github\.com\/([^\/]+)\/?([^\/]+)?/i)!
const [, user, repo] = url.match(/^.+github\.com\/([^/]+)\/?([^/]+)?/i)!
return fetchSourceFactsFromGitHub(user, repo)
/* GitLab repository */
case "gitlab":
const [, base, slug] = url.match(/^.+?([^\/]*gitlab[^\/]+)\/(.+?)\/?$/i)!
const [, base, slug] = url.match(/^.+?([^/]*gitlab[^/]+)\/(.+?)\/?$/i)!
return fetchSourceFactsFromGitLab(base, slug)
/* Everything else */

View File

@@ -43,7 +43,7 @@ import { SourceFacts } from "../_"
* @param user - GitHub user
* @param repo - GitHub repository
*
* @return Repository facts observable
* @returns Repository facts observable
*/
export function fetchSourceFactsFromGitHub(
user: string, repo?: string

View File

@@ -43,7 +43,7 @@ import { SourceFacts } from "../_"
* @param base - GitLab base
* @param project - GitLab project
*
* @return Repository facts observable
* @returns Repository facts observable
*/
export function fetchSourceFactsFromGitLab(
base: string, project: string