|
|
/apps/mc-api/src/@apis/index.ts
|
0 problems
|
|
|
/apps/mc-api/src/@apis/response.ts
|
0 problems
|
|
|
/apps/mc-api/src/app.controller.ts
|
0 problems
|
|
|
/apps/mc-api/src/app.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/app.service.ts
|
0 problems
|
|
|
/apps/mc-api/src/database.config.ts
|
0 problems
|
|
|
/apps/mc-api/src/main.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/deck.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/encounter.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/enums.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/hero.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/index.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/modular-set.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/pack.ts
|
0 problems
|
|
|
/apps/mc-api/src/models/scenario.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/decks/deck.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/decks/decks.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/decks/decks.service.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/encounters/encounter.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/encounters/encounters.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/heroes/hero.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/heroes/heroes.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/heroes/heroes.service.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/modular-sets/modular-set.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/modular-sets/modular-sets.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/modular-sets/modular-sets.service.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/packs/pack.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/packs/packs.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/packs/packs.service.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/scenarios/scenario.entity.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/scenarios/scenarios.module.ts
|
0 problems
|
|
|
/apps/mc-api/src/modules/scenarios/scenarios.service.ts
|
0 problems
|
|
|
/apps/mc/src/@apis/index.ts
|
0 problems
|
|
|
/apps/mc/src/@apis/response.ts
|
0 problems
|
|
|
/apps/mc/src/app.d.ts
|
0 problems
|
|
|
/apps/mc/src/lib/data.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/interface.ts
|
0 problems
|
|
|
/apps/mc/src/lib/progression.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/section.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/select.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/stats-table.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/stats.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/subtitle.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/suggested.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/title.svelte
|
0 problems
|
|
|
/apps/mc/src/lib/upcoming.svelte
|
0 problems
|
|
|
/apps/mc/src/routes/+layout.ts
|
0 problems
|
|
|
/apps/mc/src/routes/+page.svelte
|
1 problem (0 errors, 1 warning)
|
| Severity |
Rule |
| Warning |
Row 43, Column 24: "'__APP_VERSION__' is not defined"
missing-declaration
|
| Line |
Source |
| 1 |
<svelte:options tag="mc-routes" /> |
| 2 |
|
| 3 |
<style global lang="scss"> |
| 4 |
@import "../app"; |
| 5 |
</style> |
| 6 |
|
| 7 |
<script lang="ts"> |
| 8 |
import { onMount } from "svelte"; |
| 9 |
import type { Encounter, Hero, ModularSet, Pack, Scenario } from "$models"; |
| 10 |
import { load, loadUpcoming } from "$services"; |
| 11 |
|
| 12 |
import Data from "$lib/data.svelte"; |
| 13 |
import Encounters from "$lib/encounters.svelte"; |
| 14 |
import Progression from "$lib/progression.svelte"; |
| 15 |
import Stats from "$lib/stats.svelte"; |
| 16 |
import Suggested from "$lib/suggested.svelte"; |
| 17 |
import Upcoming from "$lib/upcoming.svelte"; |
| 18 |
|
| 19 |
let data: [Encounter[], Hero[], ModularSet[], Scenario[]]; |
| 20 |
let upcomingData: [Pack[]]; |
| 21 |
|
| 22 |
let encounters: Encounter[]; |
| 23 |
let heroes: Hero[]; |
| 24 |
let modules: ModularSet[]; |
| 25 |
let scenarios: Scenario[]; |
| 26 |
let upcomingPacks: Pack[]; |
| 27 |
|
| 28 |
onMount(async () => { |
| 29 |
data = await load(); |
| 30 |
upcomingData = await loadUpcoming(); |
| 31 |
|
| 32 |
[encounters, heroes, modules, scenarios] = data; |
| 33 |
[upcomingPacks] = upcomingData; |
| 34 |
}); |
| 35 |
</script> |
| 36 |
|
| 37 |
<svelte:head> |
| 38 |
<title>Marvel Champions</title> |
| 39 |
<html lang="en-GB"></html> |
| 40 |
</svelte:head> |
| 41 |
|
| 42 |
// eslint-disable-next-line missing-declaration |
| Warning |
Row 43, Column 24: "'__APP_VERSION__' is not defined"
missing-declaration
|
| 43 |
<h1>Marvel Champions ({__APP_VERSION__})</h1> |
| 44 |
|
| 45 |
<Suggested encounters="{encounters}" heroes="{heroes}" modules="{modules}" scenarios="{scenarios}" /> |
| 46 |
<Encounters encounters="{encounters}" /> |
| 47 |
<Stats encounters="{encounters}" heroes="{heroes}" modules="{modules}" scenarios="{scenarios}" /> |
| 48 |
<Progression encounters="{encounters}" heroes="{heroes}" scenarios="{scenarios}" /> |
| 49 |
<Data heroes="{heroes}" modules="{modules}" scenarios="{scenarios}" /> |
| 50 |
<Upcoming packs="{upcomingPacks}" /> |
| 51 |
|
|
|
|
/apps/mc/src/services/encounters.ts
|
2 problems (2 errors, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 32, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Error |
Row 39, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import type { ApiResponse } from "$apis"; |
| 2 |
import type { EncounterInterface } from "$models"; |
| 3 |
|
| 4 |
import { ApiResponseStatus } from "$apis"; |
| 5 |
import { Encounter } from "$models"; |
| 6 |
|
| 7 |
import { Service } from "./service"; |
| 8 |
|
| 9 |
export class EncountersService extends Service { |
| 10 |
// eslint-disable-next-line class-methods-use-this |
| 11 |
public loadJson(data: EncounterInterface[]): Encounter[] { |
| 12 |
const encounters: Encounter[] = []; |
| 13 |
|
| 14 |
data.forEach((encounter) => { |
| 15 |
encounters.push( |
| 16 |
new Encounter({ |
| 17 |
id: encounter.id, |
| 18 |
scenario: encounter.scenario, |
| 19 |
modularSets: encounter.modularSets, |
| 20 |
heroes: encounter.heroes, |
| 21 |
difficulty: encounter.difficulty, |
| 22 |
result: encounter.result, |
| 23 |
date: encounter.date != null ? new Date(encounter.date) : undefined, |
| 24 |
}), |
| 25 |
); |
| 26 |
}); |
| 27 |
|
| 28 |
return encounters; |
| 29 |
} |
| 30 |
|
| 31 |
public load(): Promise<Encounter[]> { |
| Error |
Row 32, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 32 |
// eslint-disable-next-line compat/compat |
| 33 |
return fetch(`${this.apiEndpoint}/encounters?sort=DESC`) |
| 34 |
.then((response) => response.json()) |
| 35 |
.then((result: ApiResponse<string, Encounter[]>) => this.extractResponse(result)); |
| 36 |
} |
| 37 |
|
| 38 |
public async save(encounter: Partial<Encounter>): Promise<null | Encounter> { |
| Error |
Row 39, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 39 |
// eslint-disable-next-line compat/compat |
| 40 |
return fetch(`${this.apiEndpoint}/encounters`, { |
| 41 |
method: "POST", |
| 42 |
mode: "cors", |
| 43 |
headers: { |
| 44 |
"Content-Type": "application/json", |
| 45 |
}, |
| 46 |
body: JSON.stringify(encounter), |
| 47 |
}) |
| 48 |
.then((response) => response.json()) |
| 49 |
.then((result: ApiResponse<string, Encounter>) => { |
| 50 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 51 |
return result.data; |
| 52 |
} |
| 53 |
// eslint-disable-next-line no-console |
| 54 |
console.error(result.error); |
| 55 |
return null; |
| 56 |
}); |
| 57 |
} |
| 58 |
|
| 59 |
protected extractResponse(result: ApiResponse<string, Encounter[]>): Encounter[] { |
| 60 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 61 |
return this.loadJson(result.data); |
| 62 |
} |
| 63 |
// eslint-disable-next-line no-console |
| 64 |
console.error(result.error); |
| 65 |
return []; |
| 66 |
} |
| 67 |
} |
| 68 |
|
|
|
|
/apps/mc/src/services/heroes.ts
|
2 problems (2 errors, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import type { ApiResponse } from "$apis"; |
| 2 |
import type { HeroInterface } from "$models"; |
| 3 |
|
| 4 |
import { ApiResponseStatus } from "$apis"; |
| 5 |
import { Hero } from "$models"; |
| 6 |
|
| 7 |
import { Service } from "./service"; |
| 8 |
|
| 9 |
export class HeroesService extends Service { |
| 10 |
// eslint-disable-next-line class-methods-use-this |
| 11 |
public loadJson(data: HeroInterface[]): Hero[] { |
| 12 |
const heroes: Hero[] = []; |
| 13 |
|
| 14 |
data.forEach((hero) => { |
| 15 |
heroes.push(new Hero(hero)); |
| 16 |
}); |
| 17 |
|
| 18 |
return heroes; |
| 19 |
} |
| 20 |
|
| 21 |
public load(): Promise<Hero[]> { |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 22 |
// eslint-disable-next-line compat/compat |
| 23 |
return fetch(`${this.apiEndpoint}/heroes`) |
| 24 |
.then((response) => response.json()) |
| 25 |
.then((result: ApiResponse<string, Hero[]>) => { |
| 26 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 27 |
return this.loadJson(result.data); |
| 28 |
} |
| 29 |
// eslint-disable-next-line no-console |
| 30 |
console.error(result.error); |
| 31 |
return []; |
| 32 |
}); |
| 33 |
} |
| 34 |
|
| 35 |
public find(name: string): Promise<null | Hero> { |
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 36 |
// eslint-disable-next-line compat/compat |
| 37 |
return fetch(`${this.apiEndpoint}/heroes?name=${name}`) |
| 38 |
.then((response) => response.json()) |
| 39 |
.then((result: ApiResponse<string, Hero[]>) => { |
| 40 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 41 |
return new Hero(result.data[0]); |
| 42 |
} |
| 43 |
// eslint-disable-next-line no-console |
| 44 |
console.error(result.error); |
| 45 |
return null; |
| 46 |
}); |
| 47 |
} |
| 48 |
} |
| 49 |
|
|
|
|
/apps/mc/src/services/index.ts
|
0 problems
|
|
|
/apps/mc/src/services/load.ts
|
0 problems
|
|
|
/apps/mc/src/services/modular-sets.ts
|
2 problems (2 errors, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import type { ApiResponse } from "$apis"; |
| 2 |
import type { ModularSetInterface } from "$models"; |
| 3 |
|
| 4 |
import { ApiResponseStatus } from "$apis"; |
| 5 |
import { ModularSet } from "$models"; |
| 6 |
|
| 7 |
import { Service } from "./service"; |
| 8 |
|
| 9 |
export class ModularSetsService extends Service { |
| 10 |
// eslint-disable-next-line class-methods-use-this |
| 11 |
public loadJson(data: ModularSetInterface[]): ModularSet[] { |
| 12 |
const heroes: ModularSet[] = []; |
| 13 |
|
| 14 |
data.forEach((hero) => { |
| 15 |
heroes.push(new ModularSet(hero)); |
| 16 |
}); |
| 17 |
|
| 18 |
return heroes; |
| 19 |
} |
| 20 |
|
| 21 |
public load(): Promise<ModularSet[]> { |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 22 |
// eslint-disable-next-line compat/compat |
| 23 |
return fetch(`${this.apiEndpoint}/modularsets`) |
| 24 |
.then((response) => response.json()) |
| 25 |
.then((result: ApiResponse<string, ModularSet[]>) => { |
| 26 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 27 |
return this.loadJson(result.data); |
| 28 |
} |
| 29 |
// eslint-disable-next-line no-console |
| 30 |
console.error(result.error); |
| 31 |
return []; |
| 32 |
}); |
| 33 |
} |
| 34 |
|
| 35 |
public find(name: string): Promise<null | ModularSet> { |
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 36 |
// eslint-disable-next-line compat/compat |
| 37 |
return fetch(`${this.apiEndpoint}/modularSets?name=${name}`) |
| 38 |
.then((response) => response.json()) |
| 39 |
.then((result: ApiResponse<string, ModularSet[]>) => { |
| 40 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 41 |
return new ModularSet(result.data[0]); |
| 42 |
} |
| 43 |
// eslint-disable-next-line no-console |
| 44 |
console.error(result.error); |
| 45 |
return null; |
| 46 |
}); |
| 47 |
} |
| 48 |
} |
| 49 |
|
|
|
|
/apps/mc/src/services/packs.ts
|
1 problem (1 error, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import type { ApiResponse } from "$apis"; |
| 2 |
import type { PackInterface } from "$models"; |
| 3 |
|
| 4 |
import { ApiResponseStatus } from "$apis"; |
| 5 |
import { Pack } from "$models"; |
| 6 |
|
| 7 |
import { Service } from "./service"; |
| 8 |
|
| 9 |
export class PacksService extends Service { |
| 10 |
// eslint-disable-next-line class-methods-use-this |
| 11 |
public loadJson(data: PackInterface[]): Pack[] { |
| 12 |
const packs: Pack[] = []; |
| 13 |
|
| 14 |
data.forEach((pack) => { |
| 15 |
packs.push(new Pack(pack)); |
| 16 |
}); |
| 17 |
|
| 18 |
return packs; |
| 19 |
} |
| 20 |
|
| 21 |
public load(unreleased = false): Promise<Pack[]> { |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 22 |
// eslint-disable-next-line compat/compat |
| 23 |
return fetch(`${this.apiEndpoint}/packs${unreleased === true ? "?owned=false&unreleased=true" : ""}`) |
| 24 |
.then((response) => response.json()) |
| 25 |
.then((result: ApiResponse<string, Pack[]>) => { |
| 26 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 27 |
return this.loadJson(result.data); |
| 28 |
} |
| 29 |
// eslint-disable-next-line no-console |
| 30 |
console.error(result.error); |
| 31 |
return []; |
| 32 |
}); |
| 33 |
} |
| 34 |
} |
| 35 |
|
|
|
|
/apps/mc/src/services/scenarios.ts
|
2 problems (2 errors, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import type { ApiResponse } from "$apis"; |
| 2 |
import type { ScenarioInterface } from "$models"; |
| 3 |
|
| 4 |
import { ApiResponseStatus } from "$apis"; |
| 5 |
import { Scenario } from "$models"; |
| 6 |
|
| 7 |
import { Service } from "./service"; |
| 8 |
|
| 9 |
export class ScenariosService extends Service { |
| 10 |
// eslint-disable-next-line class-methods-use-this |
| 11 |
public loadJson(data: ScenarioInterface[]): Scenario[] { |
| 12 |
const scenarios: Scenario[] = []; |
| 13 |
|
| 14 |
data.forEach((scenario) => { |
| 15 |
scenarios.push(new Scenario(scenario)); |
| 16 |
}); |
| 17 |
|
| 18 |
return scenarios; |
| 19 |
} |
| 20 |
|
| 21 |
public load(): Promise<Scenario[]> { |
| Error |
Row 22, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 22 |
// eslint-disable-next-line compat/compat |
| 23 |
return fetch(`${this.apiEndpoint}/scenarios`) |
| 24 |
.then((response) => response.json()) |
| 25 |
.then((result: ApiResponse<string, Scenario[]>) => { |
| 26 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 27 |
return this.loadJson(result.data); |
| 28 |
} |
| 29 |
// eslint-disable-next-line no-console |
| 30 |
console.error(result.error); |
| 31 |
return []; |
| 32 |
}); |
| 33 |
} |
| 34 |
|
| 35 |
public find(name: string): Promise<null | Scenario> { |
| Error |
Row 36, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 36 |
// eslint-disable-next-line compat/compat |
| 37 |
return fetch(`${this.apiEndpoint}/scenarios?name=${name}`) |
| 38 |
.then((response) => response.json()) |
| 39 |
.then((result: ApiResponse<string, Scenario[]>) => { |
| 40 |
if (ApiResponseStatus.SUCCESS === result.status) { |
| 41 |
return new Scenario(result.data[0]); |
| 42 |
} |
| 43 |
// eslint-disable-next-line no-console |
| 44 |
console.error(result.error); |
| 45 |
return null; |
| 46 |
}); |
| 47 |
} |
| 48 |
} |
| 49 |
|
|
|
|
/apps/mc/src/services/service.ts
|
0 problems
|
|
|
/apps/resume/src/app.d.ts
|
0 problems
|
|
|
/apps/resume/src/lib/contact.svelte
|
1 problem (0 errors, 1 warning)
|
| Severity |
Rule |
| Warning |
Row 19, Column 45: "Security: Anchor with "target=_blank" should have rel attribute containing the value "noreferrer""
security-anchor-rel-noreferrer
|
| Line |
Source |
| 1 |
<svelte:options tag="resume-contact" /> |
| 2 |
|
| 3 |
<script lang="ts"> |
| 4 |
export let email: string; |
| 5 |
export let linkedin: string; |
| 6 |
export let name: string; |
| 7 |
export let phone: string; |
| 8 |
</script> |
| 9 |
|
| 10 |
<div class="contact-container container-block"> |
| 11 |
<ul class="list-unstyled contact-list"> |
| 12 |
<li class="email"> |
| 13 |
<em class="fa fa-envelope"></em><a href="mailto:%20{email}">{email}</a> |
| 14 |
</li> |
| 15 |
<li class="phone"> |
| 16 |
<em class="fa fa-phone"></em><a href="tel:{phone.replaceAll(' ', '')}">{phone}</a> |
| 17 |
</li> |
| 18 |
<li class="linkedin"> |
| Warning |
Row 19, Column 45: "Security: Anchor with "target=_blank" should have rel attribute containing the value "noreferrer""
security-anchor-rel-noreferrer
|
| 19 |
<em class="fa fa-linkedin"></em><a href="{linkedin}" target="_blank">{name}</a> |
| 20 |
</li> |
| 21 |
</ul> |
| 22 |
</div> |
| 23 |
|
|
|
|
/apps/resume/src/lib/education.svelte
|
0 problems
|
|
|
/apps/resume/src/lib/experience.svelte
|
0 problems
|
|
|
/apps/resume/src/lib/language.svelte
|
0 problems
|
|
|
/apps/resume/src/lib/profile.svelte
|
0 problems
|
|
|
/apps/resume/src/routes/+layout.ts
|
0 problems
|
|
|
/apps/resume/src/routes/+page.svelte
|
0 problems
|
|
|
/apps/roguelike/src/app.d.ts
|
0 problems
|
|
|
/apps/roguelike/src/lib/console.svelte
|
0 problems
|
|
|
/apps/roguelike/src/lib/game.svelte
|
0 problems
|
|
|
/apps/roguelike/src/lib/links.svelte
|
0 problems
|
|
|
/apps/roguelike/src/routes/+layout.ts
|
0 problems
|
|
|
/apps/roguelike/src/routes/+page.svelte
|
1 problem (0 errors, 1 warning)
|
| Severity |
Rule |
| Warning |
Row 18, Column 28: "'__APP_VERSION__' is not defined"
missing-declaration
|
| Line |
Source |
| 1 |
<svelte:options tag="roguelike-routes" /> |
| 2 |
|
| 3 |
<style global lang="scss"> |
| 4 |
@import "../app"; |
| 5 |
</style> |
| 6 |
|
| 7 |
<script lang="ts"> |
| 8 |
import Console from "$lib/console.svelte"; |
| 9 |
import Game from "$lib/game.svelte"; |
| 10 |
import Links from "$lib/links.svelte"; |
| 11 |
</script> |
| 12 |
|
| 13 |
<svelte:head> |
| 14 |
<title>Space Roguelike</title> |
| 15 |
<html lang="en-GB"></html> |
| 16 |
</svelte:head> |
| 17 |
|
| Warning |
Row 18, Column 28: "'__APP_VERSION__' is not defined"
missing-declaration
|
| 18 |
<h1>Welcome to Roguelike ({__APP_VERSION__})</h1> |
| 19 |
|
| 20 |
<Game /> |
| 21 |
<Console /> |
| 22 |
<Links /> |
| 23 |
|
|
|
|
/apps/roguelike/src/stores/index.ts
|
0 problems
|
|
|
/apps/roguelike/src/stores/messages.ts
|
0 problems
|
|
|
/apps/storybook/stories/Art/Pixel.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Base/Buttons.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Base/Shapes.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Collapse.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Data.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Leaderboard.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/PlaceholderLoader.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Progress.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Table.stories.ts
|
0 problems
|
|
|
/apps/storybook/stories/Components/Tabs.stories.ts
|
0 problems
|
|
|
/libs/algorithms/src/coalesce.ts
|
0 problems
|
|
|
/libs/algorithms/src/index.ts
|
0 problems
|
|
|
/libs/algorithms/src/random.ts
|
1 problem (1 error, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 16, Column 5: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
/** |
| 2 |
* @src https://basarat.gitbook.io/algorithms/basics/tips#random-numbers |
| 3 |
* "Generate a random number between min and max." |
| 4 |
* |
| 5 |
* The function uses the `Math.random()` function to generate a random number between 0 and 1. It then multiplies that |
| 6 |
* number by the difference between `max` and `min` and adds `min` to it |
| 7 |
* @param {number} min - The minimum value to return. |
| 8 |
* @param {number} max - The maximum value of the random number. |
| 9 |
* @returns A random number between the min and max values. |
| 10 |
*/ |
| 11 |
export const random = (min: number, max: number): number => { |
| 12 |
if (!window.crypto) { |
| 13 |
// eslint-disable-next-line no-bitwise |
| 14 |
return ~~(Math.random() * (max - min) + min); |
| 15 |
} |
| Error |
Row 16, Column 5: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 16 |
// eslint-disable-next-line compat/compat |
| 17 |
const randomBuffer = new Uint32Array(1); |
| 18 |
|
| 19 |
window.crypto.getRandomValues(randomBuffer); |
| 20 |
|
| 21 |
const randomNumber = randomBuffer[0] / (0xffffffff + 1); |
| 22 |
const minimum = Math.ceil(min); |
| 23 |
const maximum = Math.floor(max); |
| 24 |
|
| 25 |
return Math.floor(randomNumber * (maximum - minimum + 1)) + minimum; |
| 26 |
}; |
| 27 |
|
| 28 |
/** |
| 29 |
* @src https://github.com/trekhleb/javascript-algorithms/blob/master/src/algorithms/statistics/weighted-random/weightedRandom.js |
| 30 |
* "Given an array of items and an array of weights, pick one item randomly based on the weights." |
| 31 |
* |
| 32 |
* The function is generic, so it can be used with any type of items |
| 33 |
* @param {Item[]} items - The array of items to pick from. |
| 34 |
* @param {number[]} weights - An array of numbers that represent the weight of each item. |
| 35 |
* @returns Nothing. |
| 36 |
*/ |
| 37 |
export const weightedRandom = <Item>(items: Item[], weights: number[]): Item | undefined => { |
| 38 |
if (items.length !== weights.length) { |
| 39 |
throw new Error("Items and weights must be of the same size"); |
| 40 |
} |
| 41 |
|
| 42 |
if (!items.length) { |
| 43 |
throw new Error("Items must not be empty"); |
| 44 |
} |
| 45 |
|
| 46 |
// Preparing the cumulative weights array. |
| 47 |
// For example: |
| 48 |
// - weights = [1, 4, 3] |
| 49 |
// - cumulativeWeights = [1, 5, 8] |
| 50 |
const cumulativeWeights: number[] = []; |
| 51 |
weights.forEach((weight, index) => { |
| 52 |
// eslint-disable-next-line security/detect-object-injection |
| 53 |
cumulativeWeights[index] = weight + (cumulativeWeights[index - 1] || 0); |
| 54 |
}); |
| 55 |
|
| 56 |
// Getting the random number in a range of [0...sum(weights)] |
| 57 |
// For example: |
| 58 |
// - weights = [1, 4, 3] |
| 59 |
// - maxCumulativeWeight = 8 |
| 60 |
// - range for the random number is [0...8] |
| 61 |
const maxCumulativeWeight = cumulativeWeights[cumulativeWeights.length - 1]; |
| 62 |
const randomNumber = random(0, maxCumulativeWeight); |
| 63 |
|
| 64 |
// Picking the random item based on its weight. |
| 65 |
// The items with higher weight will be picked more often. |
| 66 |
return items |
| 67 |
.filter((_item, index) => { |
| 68 |
// console.log(item); |
| 69 |
// eslint-disable-next-line security/detect-object-injection |
| 70 |
return cumulativeWeights[index] >= randomNumber; |
| 71 |
}) |
| 72 |
.shift(); |
| 73 |
}; |
| 74 |
|
|
|
|
/libs/algorithms/src/shuffle.ts
|
0 problems
|
|
|
/libs/algorithms/src/sort.ts
|
0 problems
|
|
|
/libs/algorithms/tests/coalesce.spec.ts
|
0 problems
|
|
|
/libs/algorithms/tests/random.spec.ts
|
2 problems (2 errors, 0 warnings)
|
| Severity |
Rule |
| Error |
Row 19, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Error |
Row 27, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| Line |
Source |
| 1 |
import { random } from "@jga/algorithms/index"; |
| 2 |
|
| 3 |
describe("random", () => { |
| 4 |
beforeEach(() => { |
| 5 |
jest.spyOn(global.Math, "random").mockReturnValue(0.5); |
| 6 |
}); |
| 7 |
|
| 8 |
afterEach(() => { |
| 9 |
jest.spyOn(global.Math, "random").mockRestore(); |
| 10 |
}); |
| 11 |
|
| 12 |
it("should return 3", (): void => { |
| 13 |
const result = random(1, 6); |
| 14 |
|
| 15 |
expect(result).toBe(3); |
| 16 |
}); |
| 17 |
|
| 18 |
it("should use `crypto.getRandomValues` if `crypto` is defined", (): void => { |
| Error |
Row 19, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 19 |
// eslint-disable-next-line compat/compat |
| 20 |
const mGetRandomValues = jest.fn().mockReturnValueOnce(new Uint32Array(1)); |
| 21 |
Object.defineProperty(window, "crypto", { |
| 22 |
value: { getRandomValues: mGetRandomValues }, |
| 23 |
}); |
| 24 |
|
| 25 |
const result = random(1, 6); |
| 26 |
|
| Error |
Row 27, Column 9: "Definition for rule 'compat/compat' was not found."
compat/compat
|
| 27 |
// eslint-disable-next-line compat/compat |
| 28 |
expect(mGetRandomValues).toHaveBeenCalledWith(new Uint32Array(1)); |
| 29 |
expect(result).toBeGreaterThanOrEqual(1); |
| 30 |
expect(result).toBeLessThanOrEqual(6); |
| 31 |
}); |
| 32 |
}); |
| 33 |
|
|
|
|
/libs/algorithms/tests/shuffle.spec.ts
|
0 problems
|
|
|
/libs/algorithms/tests/sort.spec.ts
|
0 problems
|
|
|
/libs/algorithms/tests/weighted-random.spec.ts
|
0 problems
|
|
|
/libs/apis/src/index.ts
|
0 problems
|
|
|
/libs/apis/src/response.ts
|
0 problems
|
|
|
/libs/apis/tests/response.spec.ts
|
0 problems
|
|
|
/libs/arrays/src/average.ts
|
0 problems
|
|
|
/libs/arrays/src/count.ts
|
0 problems
|
|
|
/libs/arrays/src/getby.ts
|
0 problems
|
|
|
/libs/arrays/src/index.ts
|
0 problems
|
|
|
/libs/arrays/src/isempty.ts
|
0 problems
|
|
|
/libs/arrays/src/unique.ts
|
0 problems
|
|
|
/libs/arrays/tests/average.spec.ts
|
0 problems
|
|
|
/libs/arrays/tests/count.spec.ts
|
0 problems
|
|
|
/libs/arrays/tests/getby.spec.ts
|
0 problems
|
|
|
/libs/arrays/tests/isempty.spec.ts
|
0 problems
|
|
|
/libs/arrays/tests/unique.spec.ts
|
0 problems
|
|
|
/libs/converters/tests/array-to-csv.spec.ts
|
0 problems
|
|
|
/libs/converters/tests/celsiustofahrenheit.spec.ts
|
0 problems
|
|
|
/libs/converters/tests/csv-to-json.spec.ts
|
0 problems
|
|
|
/libs/converters/tests/json-to-csv.spec.ts
|
0 problems
|
|
|
/libs/converters/tests/mapfromobject.spec.ts
|
0 problems
|
|
|
/libs/data/src/index.ts
|
0 problems
|
|
|
/libs/data/src/queue.ts
|
0 problems
|
|
|
/libs/data/src/stack.ts
|
0 problems
|
|
|
/libs/data/tests/queue.spec.ts
|
0 problems
|
|
|
/libs/data/tests/stack.spec.ts
|
0 problems
|
|
|
/libs/dates/src/add.ts
|
0 problems
|
|
|
/libs/dates/src/current-time.ts
|
0 problems
|
|
|
/libs/dates/src/diff.ts
|
0 problems
|
|
|
/libs/dates/src/index.ts
|
0 problems
|
|
|
/libs/dates/src/substract.ts
|
0 problems
|
|
|
/libs/dates/tests/add.spec.ts
|
0 problems
|
|
|
/libs/dates/tests/currenttime.spec.ts
|
0 problems
|
|
|
/libs/dates/tests/diff.spec.ts
|
0 problems
|
|
|
/libs/dates/tests/substract.spec.ts
|
0 problems
|
|
|
/libs/games/src/colors/colors.ts
|
0 problems
|
|
|
/libs/games/src/colors/hsbToRgb.ts
|
0 problems
|
|
|
/libs/games/src/colors/index.ts
|
0 problems
|
|
|
/libs/games/src/colors/random.ts
|
0 problems
|
|
|
/libs/games/src/colors/rgbToHex.ts
|
0 problems
|
|
|
/libs/games/src/commands/index.ts
|
0 problems
|
|
|
/libs/games/src/commands/keys.ts
|
0 problems
|
|
|
/libs/games/src/commands/move.ts
|
0 problems
|
|
|
/libs/games/src/commands/roll.ts
|
0 problems
|
|
|
/libs/games/src/console/console.ts
|
0 problems
|
|
|
/libs/games/src/console/index.ts
|
0 problems
|
|
|
/libs/games/src/console/interface.ts
|
0 problems
|
|
|
/libs/games/src/console/renderer.ts
|
0 problems
|
|
|
/libs/games/src/dices/dice6.ts
|
0 problems
|
|
|
/libs/games/src/dices/diceBase.ts
|
0 problems
|
|
|
/libs/games/src/dices/diceInterface.ts
|
0 problems
|
|
|
/libs/games/src/dices/index.ts
|
0 problems
|
|
|
/libs/games/src/display/display.ts
|
0 problems
|
|
|
/libs/games/src/display/index.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/appearance.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/attack.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/damageable.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/enum.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/index.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/moveable.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/position.ts
|
0 problems
|
|
|
/libs/games/src/engine/components/spread.ts
|
0 problems
|
|
|
/libs/games/src/engine/entities/actor.ts
|
0 problems
|
|
|
/libs/games/src/engine/entities/entity.ts
|
0 problems
|
|
|
/libs/games/src/engine/entities/factory.ts
|
0 problems
|
|
|
/libs/games/src/engine/entities/index.ts
|
0 problems
|
|
|
/libs/games/src/engine/entities/player.ts
|
0 problems
|
|
|
/libs/games/src/engine/index.ts
|
0 problems
|
|
|
/libs/games/src/engine/loop.ts
|
0 problems
|
|
|
/libs/games/src/engine/scheduler.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/damage.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/draw.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/index.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/movement.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/position.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/spread.ts
|
0 problems
|
|
|
/libs/games/src/engine/systems/system.ts
|
0 problems
|
|
|
/libs/games/src/engine/world.ts
|
0 problems
|
|
|
/libs/games/src/glyphs/character.ts
|
0 problems
|
|
|
/libs/games/src/glyphs/floor.ts
|
0 problems
|
|
|
/libs/games/src/glyphs/glyph.ts
|
0 problems
|
|
|
/libs/games/src/glyphs/index.ts
|
0 problems
|
|
|
/libs/games/src/glyphs/wall.ts
|
0 problems
|
|
|
/libs/games/src/index.ts
|
0 problems
|
|
|
/libs/games/src/maps/enums.ts
|
0 problems
|
|
|
/libs/games/src/maps/generator-cellular.ts
|
0 problems
|
|
|
/libs/games/src/maps/index.ts
|
0 problems
|
|
|
/libs/games/src/maps/interfaces.ts
|
0 problems
|
|
|
/libs/games/src/maps/map.ts
|
0 problems
|
|
|
/libs/games/src/opend6/difficulty.ts
|
0 problems
|
|
|
/libs/games/src/opend6/index.ts
|
0 problems
|
|
|
/libs/games/src/opend6/roll.ts
|
0 problems
|
|
|
/libs/games/src/screens/index.ts
|
0 problems
|
|
|
/libs/games/src/screens/interface.ts
|
0 problems
|
|
|
/libs/games/src/screens/observer.ts
|
0 problems
|
|
|
/libs/games/src/screens/screen.ts
|
0 problems
|
|
|
/libs/games/src/tiles/factory.ts
|
0 problems
|
|
|
/libs/games/src/tiles/floor.ts
|
0 problems
|
|
|
/libs/games/src/tiles/index.ts
|
0 problems
|
|
|
/libs/games/src/tiles/null.ts
|
0 problems
|
|
|
/libs/games/src/tiles/tile.ts
|
0 problems
|
|
|
/libs/games/src/tiles/wall.ts
|
0 problems
|
|
|
/libs/games/tests/colors/color.spec.ts
|
0 problems
|
|
|
/libs/games/tests/colors/hsbToRgb.spec.ts
|
0 problems
|
|
|
/libs/games/tests/colors/random.spec.ts
|
0 problems
|
|
|
/libs/games/tests/colors/rgbToHex.spec.ts
|
0 problems
|
|
|
/libs/games/tests/commands/keys.spec.ts
|
0 problems
|
|
|
/libs/games/tests/commands/move.spec.ts
|
0 problems
|
|
|
/libs/games/tests/commands/roll.spec.ts
|
0 problems
|
|
|
/libs/games/tests/console/console.spec.ts
|
0 problems
|
|
|
/libs/games/tests/console/renderer.spec.ts
|
0 problems
|
|
|
/libs/games/tests/dices/dice.spec.ts
|
0 problems
|
|
|
/libs/games/tests/dices/dice6.spec.ts
|
0 problems
|
|
|
/libs/games/tests/display/display.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/components/appearance.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/components/attack.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/components/damageable.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/components/position.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/components/spread.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/entities/actor.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/entities/entity.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/entities/player.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/loop.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/scheduler.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/systems/damage.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/systems/draw.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/systems/movement.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/systems/position.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/systems/spread.spec.ts
|
0 problems
|
|
|
/libs/games/tests/engine/world.spec.ts
|
0 problems
|
|
|
/libs/games/tests/glyphs/character.spec.ts
|
0 problems
|
|
|
/libs/games/tests/glyphs/floor.spec.ts
|
0 problems
|
|
|
/libs/games/tests/glyphs/glyph.spec.ts
|
0 problems
|
|
|
/libs/games/tests/glyphs/wall.spec.ts
|
0 problems
|
|
|
/libs/games/tests/maps/directions.spec.ts
|
0 problems
|
|
|
/libs/games/tests/maps/generator-cellular.spec.ts
|
0 problems
|
|
|
/libs/games/tests/maps/map.spec.ts
|
0 problems
|
|
|
/libs/games/tests/opend6/difficulty.spec.ts
|
0 problems
|
|
|
/libs/games/tests/opend6/roll.spec.ts
|
0 problems
|
|
|
/libs/games/tests/screens/observer.spec.ts
|
0 problems
|
|
|
/libs/games/tests/screens/screen.spec.ts
|
0 problems
|
|
|
/libs/games/tests/tiles/factory.spec.ts
|
0 problems
|
|
|
/libs/games/tests/tiles/floor.spec.ts
|
0 problems
|
|
|
/libs/games/tests/tiles/null.spec.ts
|
0 problems
|
|
|
/libs/games/tests/tiles/tile.spec.ts
|
0 problems
|
|
|
/libs/games/tests/tiles/wall.spec.ts
|
0 problems
|
|
|
/libs/generators/tests/boolean.spec.ts
|
0 problems
|
|
|
/libs/generators/tests/uuid.spec.ts
|
0 problems
|
|
|
/libs/models/src/index.ts
|
0 problems
|
|
|
/libs/models/src/interfaces/index.ts
|
0 problems
|
|
|
/libs/models/src/interfaces/person.ts
|
0 problems
|
|
|
/libs/models/src/models/index.ts
|
0 problems
|
|
|
/libs/models/src/models/person.ts
|
0 problems
|
|
|
/libs/models/tests/models/person.spec.ts
|
0 problems
|
|
|
/libs/patterns/src/command/command.ts
|
0 problems
|
|
|
/libs/patterns/src/command/index.ts
|
0 problems
|
|
|
/libs/patterns/src/command/manager.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/component.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/entity.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/index.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/system.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/world.interface.ts
|
0 problems
|
|
|
/libs/patterns/src/ecs/world.ts
|
0 problems
|
|
|
/libs/patterns/src/factory.ts
|
0 problems
|
|
|
/libs/patterns/src/index.ts
|
0 problems
|
|
|
/libs/patterns/src/iterable.ts
|
0 problems
|
|
|
/libs/patterns/src/iterator.ts
|
0 problems
|
|
|
/libs/patterns/src/money/account.ts
|
0 problems
|
|
|
/libs/patterns/src/money/currency.ts
|
0 problems
|
|
|
/libs/patterns/src/money/index.ts
|
0 problems
|
|
|
/libs/patterns/src/money/money.ts
|
0 problems
|
|
|
/libs/patterns/src/observer.ts
|
0 problems
|
|
|
/libs/patterns/src/singleton.ts
|
0 problems
|
|
|
/libs/patterns/tests/command.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/ecs/component.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/ecs/entity.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/ecs/world.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/factory.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/iterable.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/iterator.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/money/account.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/money/currency.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/money/money.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/observer.spec.ts
|
0 problems
|
|
|
/libs/patterns/tests/singleton.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/entities/factory.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/entities/fungus.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/entities/index.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/game.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/index.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/factory.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/index.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/lose.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/play.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/start.ts
|
0 problems
|
|
|
/libs/roguelike-engine/src/screens/win.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/entities/factory.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/entities/fungus.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/game.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/screens/factory.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/screens/lose.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/screens/play.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/screens/start.spec.ts
|
0 problems
|
|
|
/libs/roguelike-engine/tests/screens/win.spec.ts
|
0 problems
|
|
|
/libs/strings/src/capitalize.ts
|
0 problems
|
|
|
/libs/strings/src/index.ts
|
0 problems
|
|
|
/libs/strings/src/leftpad.ts
|
0 problems
|
|
|
/libs/strings/tests/capitalize-every-word.spec.ts
|
0 problems
|
|
|
/libs/strings/tests/capitalize.spec.ts
|
0 problems
|
|
|
/libs/strings/tests/leftpad.spec.ts
|
0 problems
|
|
|
/libs/ui/button/src/button.svelte
|
0 problems
|
|
|
/libs/ui/button/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/button/src/main.ts
|
0 problems
|
|
|
/libs/ui/button/tests/button.spec.ts
|
0 problems
|
|
|
/libs/ui/collapse/src/collapse.svelte
|
0 problems
|
|
|
/libs/ui/collapse/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/collapse/src/main.ts
|
0 problems
|
|
|
/libs/ui/collapse/tests/collapse.spec.ts
|
0 problems
|
|
|
/libs/ui/leaderboard/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/leaderboard/src/leaderboard.svelte
|
0 problems
|
|
|
/libs/ui/leaderboard/src/main.ts
|
0 problems
|
|
|
/libs/ui/leaderboard/tests/leaderboard.spec.ts
|
0 problems
|
|
|
/libs/ui/placeholder-loader/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/placeholder-loader/src/main.ts
|
0 problems
|
|
|
/libs/ui/placeholder-loader/src/placeholder-loader.svelte
|
0 problems
|
|
|
/libs/ui/placeholder-loader/tests/placeholder-loader.spec.ts
|
0 problems
|
|
|
/libs/ui/progress/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/progress/src/main.ts
|
0 problems
|
|
|
/libs/ui/progress/src/progress.svelte
|
0 problems
|
|
|
/libs/ui/progress/tests/progress.spec.ts
|
0 problems
|
|
|
/libs/ui/table/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/table/src/main.ts
|
0 problems
|
|
|
/libs/ui/table/src/table.svelte
|
0 problems
|
|
|
/libs/ui/table/tests/table.spec.ts
|
0 problems
|
|
|
/libs/ui/tabs/src/global.d.ts
|
0 problems
|
|
|
/libs/ui/tabs/src/main.ts
|
0 problems
|
|
|
/libs/ui/tabs/src/tabs.svelte
|
1 problem (0 errors, 1 warning)
|
| Severity |
Rule |
| Warning |
Row 60, Column 13: "A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event."
a11y-click-events-have-key-events
|
| Line |
Source |
| 1 |
<svelte:options tag="jga-ui-tabs" /> |
| 2 |
|
| 3 |
<style> |
| 4 |
.box { |
| 5 |
margin-bottom: 10px; |
| 6 |
padding: 40px; |
| 7 |
border: 1px solid #dee2e6; |
| 8 |
border-radius: 0 0 0.5rem 0.5rem; |
| 9 |
border-top: 0; |
| 10 |
} |
| 11 |
ul { |
| 12 |
display: flex; |
| 13 |
flex-wrap: wrap; |
| 14 |
padding-left: 0; |
| 15 |
margin-bottom: 0; |
| 16 |
list-style: none; |
| 17 |
border-bottom: 1px solid #dee2e6; |
| 18 |
} |
| 19 |
li { |
| 20 |
margin-bottom: -1px; |
| 21 |
} |
| 22 |
|
| 23 |
span { |
| 24 |
border: 1px solid transparent; |
| 25 |
border-top-left-radius: 0.25rem; |
| 26 |
border-top-right-radius: 0.25rem; |
| 27 |
display: block; |
| 28 |
padding: 0.5rem 1rem; |
| 29 |
cursor: pointer; |
| 30 |
} |
| 31 |
|
| 32 |
span:hover { |
| 33 |
border-color: #e9ecef #e9ecef #dee2e6; |
| 34 |
} |
| 35 |
|
| 36 |
li.active > span { |
| 37 |
color: #495057; |
| 38 |
background-color: #fff; |
| 39 |
border-color: #dee2e6 #dee2e6 #fff; |
| 40 |
} |
| 41 |
</style> |
| 42 |
|
| 43 |
<script> |
| 44 |
import { onMount } from "svelte"; |
| 45 |
|
| 46 |
export let items = []; |
| 47 |
export let activeTabValue = 0; |
| 48 |
export let _items = []; |
| 49 |
|
| 50 |
const handleClick = (tabValue) => () => (activeTabValue = tabValue); |
| 51 |
|
| 52 |
onMount(() => { |
| 53 |
_items = typeof items === "string" ? JSON.parse(items) : items; |
| 54 |
}); |
| 55 |
</script> |
| 56 |
|
| 57 |
<ul> |
| 58 |
{#each _items as item, i} |
| 59 |
<li class="{activeTabValue === i ? 'active' : ''}"> |
| Warning |
Row 60, Column 13: "A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event."
a11y-click-events-have-key-events
|
| 60 |
<span on:click="{handleClick(i)}">{item.title}</span> |
| 61 |
</li> |
| 62 |
{/each} |
| 63 |
</ul> |
| 64 |
{#each _items as item, i} |
| 65 |
{#if activeTabValue == i} |
| 66 |
<div class="box"> |
| 67 |
{item.content} |
| 68 |
</div> |
| 69 |
{/if} |
| 70 |
{/each} |
| 71 |
|
|
|
|
/libs/ui/tabs/tests/tabs.spec.ts
|
0 problems
|