Skip to content

Commit 08f57c7

Browse files
committed
style(eslint): fix eslint errors and configuration
eslint typescript prettier configuration has been simplified. see https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
1 parent 266504d commit 08f57c7

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.eslintrc.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ module.exports = {
88
extends: [
99
'plugin:@typescript-eslint/eslint-recommended',
1010
'plugin:@typescript-eslint/recommended',
11-
'prettier',
12-
'prettier/@typescript-eslint',
11+
'prettier'
1312
],
1413
root: true,
1514
env: {

lib/utils/project-utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function moveDefaultProjectToStart(
8383
defaultProjectName: string,
8484
defaultLabel: string,
8585
) {
86-
let projects: string[] = Object.keys(configuration.projects as {});
86+
let projects: string[] = configuration.projects != null ? Object.keys(configuration.projects) : [];
8787
if (configuration.sourceRoot !== 'src') {
8888
projects = projects.filter(
8989
(p) => p !== defaultProjectName.replace(defaultLabel, ''),

lib/utils/tree-kill.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function getAllPid(): {
2727

2828
return rows
2929
.map(function (row) {
30-
var parts = row.match(/\s*(\d+)\s*(\d+)/);
30+
const parts = row.match(/\s*(\d+)\s*(\d+)/);
3131

3232
if (parts === null) {
3333
return null;
@@ -38,19 +38,19 @@ function getAllPid(): {
3838
ppid: Number(parts[2]),
3939
};
4040
})
41-
.filter(<T extends Object>(input: null | undefined | T): input is T => {
41+
.filter(<T>(input: null | undefined | T): input is T => {
4242
return input != null;
4343
});
4444
}
4545

4646
function getAllChilds(pid: number) {
4747
const allpid = getAllPid();
4848

49-
let ppidHash: {
49+
const ppidHash: {
5050
[key: number]: number[];
5151
} = {};
5252

53-
let result: number[] = [];
53+
const result: number[] = [];
5454

5555
allpid.forEach(function (item) {
5656
ppidHash[item.ppid] = ppidHash[item.ppid] || [];

0 commit comments

Comments
 (0)