Skip to content

Commit 705a99b

Browse files
committed
Cleanup with new eslint rules
1 parent 83d76ed commit 705a99b

File tree

7 files changed

+46
-43
lines changed

7 files changed

+46
-43
lines changed

client/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Koa from 'koa';
2-
import path from 'node:path';
32
import serve from 'koa-static';
3+
import path from 'node:path';
44

55
const port = 3004;
66

client/routes/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import allNames from './helpers/names.js';
2-
import auth from './requests/token.js';
2+
import getSize from './helpers/size.js';
33
import getLanguages from './requests/languages.js';
44
import getRepos from './requests/repos.js';
5-
import getSize from './helpers/size.js';
5+
import auth from './requests/token.js';
66

77
const langs = async (owner) => {
88
try {

client/routes/requests/token.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios';
2+
23
import environment from '../../environment.js';
34

45
let token;

client/src/components/App.svelte

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script>
22
import { onMount } from 'svelte';
3-
import Styles from './Styles.svelte';
4-
import Progress from './Progress.svelte';
3+
4+
import langs from '../../routes/index.js';
5+
56
import Card from './Card.svelte';
7+
import Progress from './Progress.svelte';
68
import ScrollTop from './ScrollTop.svelte';
7-
import langs from '../../routes/index.js';
9+
import Styles from './Styles.svelte';
810
911
let owner = '';
1012
let currentOwner = '';
@@ -55,7 +57,7 @@
5557
if (allData.names) {
5658
repoCount = allData.names.length;
5759
}
58-
// eslint-disable-next-line unicorn/explicit-length-check
60+
5961
if (allData.space) {
6062
const keys = Object.keys(allData.space);
6163
langCount = keys.length;
@@ -112,8 +114,8 @@
112114
<table>
113115
<tbody id="tbody">
114116
{#if data.length > 0}
115-
{#each data as d, i}
116-
<Progress {d} {i} {langCount} {isDone} />
117+
{#each data as dat, index}
118+
<Progress {dat} {index} {langCount} {isDone} />
117119
{/each}
118120
{:else}
119121
<h4>User Not Found</h4>

client/src/components/Progress.svelte

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
import { cubicInOut } from 'svelte/easing';
33
import { tweened } from 'svelte/motion';
44
5-
export let d;
6-
export let i;
5+
export let dat;
6+
export let index;
77
export let langCount;
88
export let isDone;
99
10-
const finalPercent = Number((d.percent * 100).toFixed(2));
11-
const speed = (i / 8) * 1000 + 222;
10+
const finalPercent = Number((dat.percent * 100).toFixed(2));
11+
const speed = (index / 8) * 1000 + 222;
1212
1313
const progress = tweened(0, {
1414
duration: 1400,
@@ -27,44 +27,44 @@
2727
return perc;
2828
};
2929
30-
setTimeout(() => ($progress = setProgress(d.percent)), speed);
30+
setTimeout(() => ($progress = setProgress(dat.percent)), speed);
3131
setTimeout(() => {
3232
$progress2 = finalPercent;
33-
if (i === langCount - 1) {
33+
if (index === langCount - 1) {
3434
isDone();
3535
}
3636
}, speed);
3737
setTimeout(() => {
38-
const prog = document.getElementById(`bar${i}`);
39-
const info = document.getElementsByClassName(`info${i}`);
38+
const prog = document.querySelector(`#bar${index}`);
39+
const info = document.querySelector(`.info${index}`);
4040
prog.style.setProperty(
4141
'--c',
42-
`rgb(${255 - (255 / langCount) * i}, ${
43-
160 - (160 / langCount) * i
42+
`rgb(${255 - (255 / langCount) * index}, ${
43+
160 - (160 / langCount) * index
4444
}, ${203})`,
4545
);
4646
47-
info[0].style.color = `rgb(${275 - (225 / langCount) * i}, ${
48-
275 - (225 / langCount) * i
49-
}, ${275 - (225 / langCount) * i})`;
47+
info[0].style.color = `rgb(${275 - (225 / langCount) * index}, ${
48+
275 - (225 / langCount) * index
49+
}, ${275 - (225 / langCount) * index})`;
5050
}, 0);
5151
</script>
5252

5353
<template>
5454
<tr
55-
id="row{i}"
56-
style="animation: fadeInHeight .5s ease-out {i / 8}s forwards;"
55+
id="row{index}"
56+
style="animation: fadeInHeight .5s ease-out {index / 8}s forwards;"
5757
>
58-
<div class="info info{i}">
58+
<div class="info info{index}">
5959
<td class="name">
60-
<span>{d.name}</span>
60+
<span>{dat.name}</span>
6161
</td>
6262
<td class="percent">
6363
<span>{$progress2.toFixed(2)}%</span>
6464
</td>
6565
</div>
6666
<td class="bar">
67-
<progress id="bar{i}" value={$progress} />
67+
<progress id="bar{index}" value={$progress} />
6868
</td>
6969
</tr>
7070
</template>

package-lock.json

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"svelte": "^3.44.2"
3131
},
3232
"devDependencies": {
33-
"@mikey-pro/style-guide": "^2.5.2",
33+
"@mikey-pro/style-guide": "^2.5.3",
3434
"css-loader": "^6.5.1",
3535
"eslint": "^8.3.0",
3636
"mini-css-extract-plugin": "^2.4.5",

0 commit comments

Comments
 (0)