Skip to content

Commit 81d5e89

Browse files
committed
fix(ts): fix TS linter issues
1 parent fb48a2f commit 81d5e89

File tree

11 files changed

+16
-17
lines changed

11 files changed

+16
-17
lines changed

src/db/file/repo.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import fs from 'fs';
22
import Datastore from '@seald-io/nedb'
3-
import { Action } from '../../proxy/actions/Action';
43
import { Repo } from '../types';
54

65
if (!fs.existsSync('./.data')) fs.mkdirSync('./.data');
76
if (!fs.existsSync('./.data/db')) fs.mkdirSync('./.data/db');
87

98
const db = new Datastore({ filename: './.data/db/repos.db', autoload: true });
109

11-
export const getRepos = async (query = {}) => {
10+
export const getRepos = async () => {
1211
return new Promise<Repo[]>((resolve, reject) => {
1312
db.find({}, (err: Error, docs: Repo[]) => {
1413
if (err) {
@@ -157,7 +156,7 @@ export const deleteRepo = async (name: string) => {
157156

158157
export const isUserPushAllowed = async (name: string, user: string) => {
159158
name = name.toLowerCase();
160-
return new Promise<boolean>(async (resolve, reject) => {
159+
return new Promise<boolean>(async (resolve) => {
161160
const repo = await exports.getRepo(name);
162161
console.log(repo.users.canPush);
163162
console.log(repo.users.canAuthorise);
@@ -173,7 +172,7 @@ export const isUserPushAllowed = async (name: string, user: string) => {
173172
export const canUserApproveRejectPushRepo = async (name: string, user: string) => {
174173
name = name.toLowerCase();
175174
console.log(`checking if user ${user} can approve/reject for ${name}`);
176-
return new Promise<boolean>(async (resolve, reject) => {
175+
return new Promise<boolean>(async (resolve) => {
177176
const repo = await exports.getRepo(name);
178177
if (repo.users.canAuthorise.includes(user)) {
179178
console.log(`user ${user} can approve/reject to repo ${name}`);

src/db/mongo/repo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const isBlank = (str: string) => {
77
return !str || /^\s*$/.test(str);
88
};
99

10-
export const getRepos = async (query = {}) => {
10+
export const getRepos = async () => {
1111
const collection = await connect(collectionName);
1212
return collection.find().toArray();
1313
};
@@ -71,7 +71,7 @@ export const deleteRepo = async (name: string) => {
7171

7272
export const isUserPushAllowed = async (name: string, user: string) => {
7373
name = name.toLowerCase();
74-
return new Promise(async (resolve, reject) => {
74+
return new Promise(async (resolve) => {
7575
const repo = await exports.getRepo(name);
7676
console.log(repo.users.canPush);
7777
console.log(repo.users.canAuthorise);
@@ -87,7 +87,7 @@ export const isUserPushAllowed = async (name: string, user: string) => {
8787
export const canUserApproveRejectPushRepo = async (name: string, user: string) => {
8888
name = name.toLowerCase();
8989
console.log(`checking if user ${user} can approve/reject for ${name}`);
90-
return new Promise(async (resolve, reject) => {
90+
return new Promise(async (resolve) => {
9191
const repo = await exports.getRepo(name);
9292
if (repo.users.canAuthorise.includes(user)) {
9393
console.log(`user ${user} can approve/reject to repo ${name}`);

src/plugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const lpModule = import('load-plugin');
2+
/* eslint-disable @typescript-eslint/no-unused-expressions */
23
('use strict');
34

45
/**

src/proxy/actions/Action.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ class Action {
6262

6363
/**
6464
*
65-
* @param {*} step
6665
* @return {Step}
6766
*/
68-
getLastStep(step) {
67+
getLastStep() {
6968
return this.lastStep;
7069
}
7170

src/proxy/routes/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ router.use(
106106
console.log('Sending request to ' + url);
107107
return url;
108108
},
109-
proxyReqOptDecorator: function (proxyReqOpts, srcReq) {
109+
proxyReqOptDecorator: function (proxyReqOpts) {
110110
return proxyReqOpts;
111111
},
112112

src/service/routes/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ router.post('/gitAccount', async (req, res) => {
9898
user.gitAccount = req.body.gitAccount;
9999
db.updateUser(user);
100100
res.status(200).end();
101-
} catch (e) {
101+
} catch {
102102
res
103103
.status(500)
104104
.send({

src/ui/components/Footer/Footer.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { MarkGithubIcon } from '@primer/octicons-react';
77

88
const useStyles = makeStyles(styles);
99

10-
export default function Footer(props) {
10+
export default function Footer() {
1111
const classes = useStyles();
1212
return (
1313
<footer className={classes.footer}>

src/ui/layouts/Admin.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export default function Admin({ ...rest }) {
7676

7777
// Specify how to clean up after this effect:
7878
return function cleanup() {
79-
if (navigator.platform.indexOf('Win') > -1) {
80-
ps && ps.destroy();
79+
if (navigator.platform.indexOf('Win') > -1 && ps) {
80+
ps.destroy();
8181
}
8282
window.removeEventListener('resize', resizeFunction);
8383
};

src/ui/views/RepoList/Components/NewRepo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function AddRepositoryDialog(props) {
6565

6666
try {
6767
new URL(data.url);
68-
} catch (e) {
68+
} catch {
6969
setError('Invalid URL');
7070
return;
7171
}

src/ui/views/RepoList/RepoList.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import GridItem from '../../components/Grid/GridItem';
33
import GridContainer from '../../components/Grid/GridContainer';
44
import TabList from './Components/TabList';
55

6-
export default function RepoList(props) {
6+
export default function RepoList() {
77
return (
88
<GridContainer>
99
<GridItem xs={12} sm={12} md={12}>

0 commit comments

Comments
 (0)