Skip to content

Commit

Permalink
style(eslint): fix eslint errors and configuration
Browse files Browse the repository at this point in the history
eslint typescript prettier configuration has been simplified.

see https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
  • Loading branch information
Toilal committed Dec 10, 2021
1 parent 266504d commit 08f57c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Expand Up @@ -8,8 +8,7 @@ module.exports = {
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier'
],
root: true,
env: {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/project-utils.ts
Expand Up @@ -83,7 +83,7 @@ export function moveDefaultProjectToStart(
defaultProjectName: string,
defaultLabel: string,
) {
let projects: string[] = Object.keys(configuration.projects as {});
let projects: string[] = configuration.projects != null ? Object.keys(configuration.projects) : [];
if (configuration.sourceRoot !== 'src') {
projects = projects.filter(
(p) => p !== defaultProjectName.replace(defaultLabel, ''),
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/tree-kill.ts
Expand Up @@ -27,7 +27,7 @@ function getAllPid(): {

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

if (parts === null) {
return null;
Expand All @@ -38,19 +38,19 @@ function getAllPid(): {
ppid: Number(parts[2]),
};
})
.filter(<T extends Object>(input: null | undefined | T): input is T => {
.filter(<T>(input: null | undefined | T): input is T => {
return input != null;
});
}

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

let ppidHash: {
const ppidHash: {
[key: number]: number[];
} = {};

let result: number[] = [];
const result: number[] = [];

allpid.forEach(function (item) {
ppidHash[item.ppid] = ppidHash[item.ppid] || [];
Expand Down

0 comments on commit 08f57c7

Please sign in to comment.