Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
renxia committed May 14, 2024
1 parent 4687ca9 commit e2952e0
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 21 deletions.
13 changes: 6 additions & 7 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// module.exports = [
// ...require('./preset/eslint'),
// ];
const path = require('path');
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
Expand All @@ -13,8 +10,8 @@ module.exports = [
languageOptions: {
parserOptions: {
tsconfigRootDir: path.resolve(__dirname),
project: path.resolve('./tsconfig.eslint.json'),
projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**'],
project: './tsconfig.eslint.json',
projectFolderIgnoreList: ['**/node_modules/**', '**/dist/**', '**/dist-admin/**'],
warnOnUnsupportedTypeScriptVersion: false,
ecmaFeatures: {
jsx: true,
Expand All @@ -29,6 +26,7 @@ module.exports = [
plugins: {
prettier: require('eslint-plugin-prettier'),
unicorn: require('eslint-plugin-unicorn'),
jest: require('eslint-plugin-jest'),
},
ignores: ['**/node_modules/**', 'dist/**', 'cjs/**', 'esm/**', 'docs/**', 'mock/**', '**/*.js', '**/*.d.ts'],
rules: {
Expand All @@ -39,9 +37,9 @@ module.exports = [
'error',
{
destructuring: 'all',
ignoreReadBeforeAssign: false,
},
],

'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
// TODO
Expand All @@ -56,9 +54,10 @@ module.exports = [
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/await-thenable': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',

'unicorn/no-array-for-each': 'off',
'unicorn/no-await-expression-member': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',
},
files: ['src/**/*.ts'],
},
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
"@types/eslint": "^8.56.10",
"@types/jest": "^29.5.12",
"@types/micromatch": "^4.0.7",
"@types/node": "^20.12.8",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"compressing": "^1.10.0",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^52.0.0",
"eslint-plugin-unicorn": "^53.0.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"json5": "^2.2.3",
Expand All @@ -90,7 +90,7 @@
"ts-node": "^10.9.2",
"typedoc": "^0.25.13",
"typescript": "^5.4.5",
"typescript-eslint": "^7.8.0",
"typescript-eslint": "^7.9.0",
"windows-process-tree": "^0.4.0"
},
"peerDependencies": {
Expand All @@ -109,5 +109,5 @@
"optional": true
}
},
"packageManager": "pnpm@8.9.0"
"packageManager": "pnpm@9.1.1"
}
4 changes: 2 additions & 2 deletions src/node/createFilePathFilter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: lzw
* @Date: 2022-09-07 09:04:38
* @LastEditors: lzw
* @LastEditTime: 2022-09-07 14:58:26
* @LastEditors: renxia
* @LastEditTime: 2024-05-14 16:45:19
* @Description: create filter
* @see https://github.com/rollup/plugins/blob/master/packages/pluginutils/src/createFilter.ts
*/
Expand Down
1 change: 1 addition & 0 deletions src/node/exec.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { execSync, execPromisfy } from './exec';

describe('utils/exec', () => {
beforeAll(() => {
// eslint-disable-next-line no-console
console.error = console.warn = console.log = () => null;
});

Expand Down
3 changes: 2 additions & 1 deletion src/node/lib/WXWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: lzw
* @Date: 2021-12-24 13:01:39
* @LastEditors: renxia
* @LastEditTime: 2024-01-18 10:59:55
* @LastEditTime: 2024-05-14 16:48:11
* @Description: 企业微信机器人通知
*/

Expand Down Expand Up @@ -140,6 +140,7 @@ export function wxWorkNotify(params: string | WxWorkReqParams, webhookUrl: strin
}

return new Request().post<WxWorkResult>(webhookUrl, params, { 'content-type': 'application/json' }).then(d => {
// eslint-disable-next-line no-console
if (debug) console.log(`[wxWorkNotify][${d.data.errcode}]`, JSON.stringify(d.data));
return d.data;
});
Expand Down
7 changes: 4 additions & 3 deletions src/node/lib/worker-threads.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
* @Author: lzw
* @Date: 2021-08-25 10:12:21
* @LastEditors: lzw
* @LastEditTime: 2022-08-31 18:05:08
* @LastEditors: renxia
* @LastEditTime: 2024-05-14 16:49:23
* @Description: worker_threads 实现在 worker 线程中执行
*
* - worker_threads 比 child_process 和 cluster 更为轻量级的并行性,而且 worker_threads 可有效地共享内存
Expand Down Expand Up @@ -52,6 +52,7 @@ export function createWorkerThreads<T>(options: CreateThreadOptions, onMessage?:

if (!isMainThread) {
const config: CreateThreadOptions = workerData;
// eslint-disable-next-line no-console
if (config.debug) console.log('workerData:', config);
// const done = (data: unknown) => {
// if (config.debug) console.log('emit msg from worker thread:', { type: config.type, data, end: true });
Expand All @@ -62,7 +63,7 @@ if (!isMainThread) {
// const resetConfig = { checkOnInit: false, exitOnError: false, mode: 'current' };

// eslint-disable-next-line unicorn/prefer-top-level-await
if (config.workerFile) import(config.workerFile).then(f => (f.default || f)(config));
if (config.workerFile) import(config.workerFile).then(f => (f.default || f)(config)).catch(console.error);

// heartbeat and more...
}
1 change: 1 addition & 0 deletions src/node/path.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fixToshortPath, normalizePath } from './path';

describe('node/path', () => {
// eslint-disable-next-line no-console
console.log = jest.fn();
console.error = jest.fn();

Expand Down
4 changes: 2 additions & 2 deletions src/node/ps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function listProcesses(rootPid: number, formatName?: (cmd: string) => str
return value;
};

import('windows-process-tree').then(windowsProcessTree => {
return import('windows-process-tree').then(windowsProcessTree => {
windowsProcessTree.getProcessList(
rootPid,
processList => {
Expand Down Expand Up @@ -189,7 +189,7 @@ export function listProcesses(rootPid: number, formatName?: (cmd: string) => str
} else {
// OS X & Linux

exec('which ps', {}, (err, stdout, stderr) => {
return exec('which ps', {}, (err, stdout, stderr) => {
if (err || stderr) {
if (process.platform !== 'linux') {
reject(err || new Error(stderr.toString()));
Expand Down

0 comments on commit e2952e0

Please sign in to comment.