Add ESLint config and update code style
Introduced a new eslint.config.js using neostandard and added related devDependencies. Updated codebase for consistent formatting, spacing, and function declarations. Minor refactoring and cleanup across multiple files to improve readability and maintain code style compliance.
This commit is contained in:
1 parent
54aef4fe1d
commit
26e84653d6
42 files changed
+628
-580
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { OneBotAction } from './OneBotAction';
|
||||
export const AutoRegisterRouter: Array<new (...args: any[]) => OneBotAction<unknown, unknown>> = [];
|
||||
|
||||
export function ActionHandler(target: new (...args: any[]) => OneBotAction<unknown, unknown>) {
|
||||
AutoRegisterRouter.push(target);
|
||||
export function ActionHandler (target: new (...args: any[]) => OneBotAction<unknown, unknown>) {
|
||||
AutoRegisterRouter.push(target);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ import { TestDownloadStream } from './stream/TestStreamDownload';
|
||||
import { UploadFileStream } from './stream/UploadFileStream';
|
||||
import { AutoRegisterRouter } from './auto-register';
|
||||
|
||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
export function createActionMap (obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||
const actionHandlers = [
|
||||
new CleanStreamTempFile(obContext, core),
|
||||
new DownloadFileStream(obContext, core),
|
||||
@@ -315,7 +315,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
||||
// function get<K extends keyof MapType>(key: K): MapType[K];
|
||||
// function get<K extends keyof MapType>(key: K): null;
|
||||
// function get<K extends keyof MapType>(key: K): HandlerUnion | null | MapType[K]
|
||||
function get<K extends keyof MapType>(key: K): MapType[K] | undefined {
|
||||
function get<K extends keyof MapType> (key: K): MapType[K] | undefined {
|
||||
return _map.get(key as keyof MapType) as MapType[K] | undefined;
|
||||
}
|
||||
return { get };
|
||||
|
||||
Reference in new issue
Block a user