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
1990761ad6
commit
fa80441e36
42 files changed
+628
-580
No files matched your search
@@ -364,7 +364,7 @@ export async function NCoreInitShell () {
|
||||
await initializeLoginService(loginService, basicInfoWrapper, dataPathGlobal, systemVersion, hostname);
|
||||
handleProxy(session, logger);
|
||||
|
||||
let quickLoginUin: string | undefined = undefined;
|
||||
let quickLoginUin: string | undefined;
|
||||
try {
|
||||
const args = process.argv;
|
||||
const qIndex = args.findIndex(arg => arg === '-q' || arg === '--qq');
|
||||
|
||||
@@ -3,15 +3,15 @@ import { defineConfig, PluginOption, UserConfig } from 'vite';
|
||||
import path, { resolve } from 'path';
|
||||
import nodeResolve from '@rollup/plugin-node-resolve';
|
||||
import { builtinModules } from 'module';
|
||||
import napcatVersion from "napcat-vite/vite-plugin-version.js";
|
||||
import { autoIncludeTSPlugin } from "napcat-vite/vite-auto-include.js";
|
||||
import napcatVersion from 'napcat-vite/vite-plugin-version.js';
|
||||
import { autoIncludeTSPlugin } from 'napcat-vite/vite-auto-include.js';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
|
||||
//依赖排除
|
||||
// 依赖排除
|
||||
const external = [
|
||||
'silk-wasm',
|
||||
'ws',
|
||||
'express'
|
||||
'express',
|
||||
];
|
||||
|
||||
const nodeModules = [...builtinModules, builtinModules.map((m) => `node:${m}`)].flat();
|
||||
@@ -20,8 +20,8 @@ const ShellBaseConfigPlugin: PluginOption[] = [
|
||||
autoIncludeTSPlugin({
|
||||
entries: [
|
||||
{ entry: 'napcat.ts', dir: path.resolve(__dirname, '../napcat-core/protocol') },
|
||||
{ entry: 'napcat.ts', dir: path.resolve(__dirname, '../napcat-onebot/action/test') }
|
||||
]
|
||||
{ entry: 'napcat.ts', dir: path.resolve(__dirname, '../napcat-onebot/action/test') },
|
||||
],
|
||||
}),
|
||||
cp({
|
||||
targets: [
|
||||
@@ -29,7 +29,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [
|
||||
{ src: '../napcat-webui-frontend/dist/', dest: 'dist/static/', flatten: false },
|
||||
{ src: '../napcat-core/external/napcat.json', dest: 'dist/config/' },
|
||||
{ src: '../../package.json', dest: 'dist' },
|
||||
{ src: '../napcat-shell-loader', dest: 'dist' }
|
||||
{ src: '../napcat-shell-loader', dest: 'dist' },
|
||||
],
|
||||
}),
|
||||
nodeResolve(),
|
||||
@@ -62,7 +62,7 @@ const ShellBaseConfig = (source_map: boolean = false) =>
|
||||
fileName: (_, entryName) => `${entryName}.mjs`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: [...nodeModules, ...external]
|
||||
external: [...nodeModules, ...external],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user