diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 28ad3f608a..b9947abf7b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,9 @@ jobs: - name: Run Prettier run: pnpm run prettier --check . + - name: Run Linter + run: pnpm run lint + - name: Create test env file run: | echo "TEST_DATABASE_CLIENT=sqlite" > packages/core/.env.test diff --git a/.husky/pre-commit b/.husky/pre-commit index 3f926d3405..afb45bee42 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,2 @@ pnpm run prettier-check +pnpm run lint \ No newline at end of file diff --git a/eslint.global.mjs b/eslint.global.mjs new file mode 100644 index 0000000000..282796e2b5 --- /dev/null +++ b/eslint.global.mjs @@ -0,0 +1,71 @@ +import eslint from "@eslint/js"; +import tseslint from "@typescript-eslint/eslint-plugin"; +import typescript from "@typescript-eslint/parser"; +import prettier from "eslint-config-prettier"; +import vitest from "eslint-plugin-vitest"; // Add Vitest plugin + +export default [ + // JavaScript and TypeScript files + { + files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], + languageOptions: { + parser: typescript, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + project: "./tsconfig.json", // Make sure your tsconfig includes @types/node + }, + globals: { + // Add Node.js globals + NodeJS: "readonly", + console: "readonly", + process: "readonly", + Buffer: "readonly", + __dirname: "readonly", + __filename: "readonly", + module: "readonly", + require: "readonly", + }, + }, + plugins: { + "@typescript-eslint": tseslint, + }, + rules: { + ...eslint.configs.recommended.rules, + ...tseslint.configs.recommended.rules, + "prefer-const": "warn", + "no-constant-binary-expression": "error", + + // Disable no-undef as TypeScript handles this better + "no-undef": "off", + "@typescript-eslint/no-unsafe-function-type": "off", + // Customize TypeScript rules + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + ignoreRestSiblings: true, + }, + ], + }, + }, + // Vitest configuration + { + files: [ + "src/**/*.test.js", + "src/**/*.test.ts", + "src/**/*.spec.js", + "src/**/*.spec.ts", + ], + plugins: { + vitest, // Register Vitest plugin + }, + rules: { + ...vitest.configs.recommended.rules, + }, + }, + // Add prettier as the last config to override other formatting rules + prettier, +]; diff --git a/package.json b/package.json index 20bef6415f..372d54db50 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start": "pnpm --filter \"@ai16z/agent\" start --isRoot", "start:client": "pnpm --dir client start --isRoot", "dev": "bash ./scripts/dev.sh", - "lint": "pnpm --dir packages/core lint && pnpm --dir packages/agent lint", + "lint": "bash ./scripts/lint.sh", "prettier-check": "npx prettier --check .", "prettier": "npx prettier --write .", "release": "pnpm build && pnpm prettier && npx lerna publish --no-private --force-publish", diff --git a/packages/adapter-postgres/eslint.config.mjs b/packages/adapter-postgres/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/adapter-postgres/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/adapter-postgres/package.json b/packages/adapter-postgres/package.json index 1133225dc8..248102d369 100644 --- a/packages/adapter-postgres/package.json +++ b/packages/adapter-postgres/package.json @@ -10,10 +10,15 @@ "pg": "^8.13.1" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" + "dev": "tsup --format esm --dts --watch", + "lint": "eslint . --fix" } } diff --git a/packages/adapter-sqlite/eslint.config.mjs b/packages/adapter-sqlite/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/adapter-sqlite/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/adapter-sqlite/package.json b/packages/adapter-sqlite/package.json index 4083cecbb3..303703bcf4 100644 --- a/packages/adapter-sqlite/package.json +++ b/packages/adapter-sqlite/package.json @@ -11,11 +11,16 @@ "sqlite-vec": "0.1.4-alpha.2" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --format esm --dts --watch" + "dev": "tsup --format esm --dts --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/adapter-sqlite/src/index.ts b/packages/adapter-sqlite/src/index.ts index 52f1ac5979..b7a33eb04a 100644 --- a/packages/adapter-sqlite/src/index.ts +++ b/packages/adapter-sqlite/src/index.ts @@ -153,7 +153,7 @@ export class SqliteDatabaseAdapter } const placeholders = params.roomIds.map(() => "?").join(", "); let sql = `SELECT * FROM memories WHERE type = ? AND roomId IN (${placeholders})`; - let queryParams = [params.tableName, ...params.roomIds]; + const queryParams = [params.tableName, ...params.roomIds]; if (params.agentId) { sql += ` AND agentId = ?`; diff --git a/packages/adapter-sqljs/eslint.config.mjs b/packages/adapter-sqljs/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/adapter-sqljs/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/adapter-sqljs/package.json b/packages/adapter-sqljs/package.json index d736d66d6e..1502fabf70 100644 --- a/packages/adapter-sqljs/package.json +++ b/packages/adapter-sqljs/package.json @@ -11,11 +11,16 @@ "uuid": "11.0.2" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/adapter-sqljs/src/types.ts b/packages/adapter-sqljs/src/types.ts index efdf6aaa4e..42dfdf9847 100644 --- a/packages/adapter-sqljs/src/types.ts +++ b/packages/adapter-sqljs/src/types.ts @@ -126,7 +126,6 @@ export declare class Database { close(): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any create_function(name: string, func: (...args: any[]) => any): Database; each( @@ -135,7 +134,7 @@ export declare class Database { callback: ParamsCallback, done: () => void ): Database; - each(sql: string, callback: ParamsCallback, done: () => void): Database; + each(sql: string, callback: ParamsCallback, done: () => void): Database; // eslint-disable-line /** * Execute an SQL query, and returns the result. diff --git a/packages/adapter-supabase/eslint.config.mjs b/packages/adapter-supabase/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/adapter-supabase/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/adapter-supabase/package.json b/packages/adapter-supabase/package.json index acac79e121..9411ec184c 100644 --- a/packages/adapter-supabase/package.json +++ b/packages/adapter-supabase/package.json @@ -9,11 +9,16 @@ "@supabase/supabase-js": "2.46.1" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/client-auto/eslint.config.mjs b/packages/client-auto/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-auto/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-auto/package.json b/packages/client-auto/package.json index 8995da54aa..6ed8381003 100644 --- a/packages/client-auto/package.json +++ b/packages/client-auto/package.json @@ -17,11 +17,16 @@ "multer": "1.4.5-lts.1" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/client-auto/src/index.ts b/packages/client-auto/src/index.ts index fd1a4c0b76..887c550b19 100644 --- a/packages/client-auto/src/index.ts +++ b/packages/client-auto/src/index.ts @@ -52,7 +52,7 @@ export class AutoClient { ); // get information for all tokens which were recommended - const tokenInfos = highTrustRecommendations.map( + const _tokenInfos = highTrustRecommendations.map( async (highTrustRecommendation) => { const tokenProvider = new TokenProvider( highTrustRecommendation.tokenAddress, @@ -87,7 +87,7 @@ export const AutoClientInterface: Client = { const client = new AutoClient(runtime); return client; }, - stop: async (runtime: IAgentRuntime) => { + stop: async (_runtime: IAgentRuntime) => { console.warn("Direct client does not support stopping yet"); }, }; diff --git a/packages/client-direct/eslint.config.mjs b/packages/client-direct/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-direct/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-direct/package.json b/packages/client-direct/package.json index 8e4a9cf525..bf83368aa4 100644 --- a/packages/client-direct/package.json +++ b/packages/client-direct/package.json @@ -16,11 +16,16 @@ "multer": "1.4.5-lts.1" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index 123600bf55..7ddc5fa233 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -11,7 +11,6 @@ import { Content, Memory, ModelClass, - State, Client, IAgentRuntime, } from "@ai16z/eliza"; @@ -222,7 +221,7 @@ export class DirectClient { await runtime.evaluate(memory, state); - const result = await runtime.processActions( + const _result = await runtime.processActions( memory, [responseMessage], state, @@ -285,14 +284,14 @@ export class DirectClient { } export const DirectClientInterface: Client = { - start: async (runtime: IAgentRuntime) => { + start: async (_runtime: IAgentRuntime) => { elizaLogger.log("DirectClientInterface start"); const client = new DirectClient(); const serverPort = parseInt(settings.SERVER_PORT || "3000"); client.start(serverPort); return client; }, - stop: async (runtime: IAgentRuntime) => { + stop: async (_runtime: IAgentRuntime) => { elizaLogger.warn("Direct client does not support stopping yet"); }, }; diff --git a/packages/client-discord/eslint.config.mjs b/packages/client-discord/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-discord/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-discord/package.json b/packages/client-discord/package.json index 91c7efd37a..3ba5fcff33 100644 --- a/packages/client-discord/package.json +++ b/packages/client-discord/package.json @@ -16,11 +16,16 @@ "zod": "3.23.8" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "trustedDependencies": { "@discordjs/opus": "github:discordjs/opus", diff --git a/packages/client-discord/src/actions/chat_with_attachments.ts b/packages/client-discord/src/actions/chat_with_attachments.ts index 5a7480d1b3..c55aca1a93 100644 --- a/packages/client-discord/src/actions/chat_with_attachments.ts +++ b/packages/client-discord/src/actions/chat_with_attachments.ts @@ -91,7 +91,11 @@ const summarizeAction = { ], description: "Answer a user request informed by specific attachments based on their IDs. If a user asks to chat with a PDF, or wants more specific information about a link or video or anything else they've attached, this is the action to use.", - validate: async (runtime: IAgentRuntime, message: Memory, state: State) => { + validate: async ( + _runtime: IAgentRuntime, + message: Memory, + _state: State + ) => { if (message.content.source !== "discord") { return false; } diff --git a/packages/client-discord/src/actions/download_media.ts b/packages/client-discord/src/actions/download_media.ts index 8c68ea4467..28f0b2e931 100644 --- a/packages/client-discord/src/actions/download_media.ts +++ b/packages/client-discord/src/actions/download_media.ts @@ -10,7 +10,6 @@ import { IVideoService, Memory, ModelClass, - Service, ServiceType, State, } from "@ai16z/eliza"; @@ -73,7 +72,11 @@ export default { ], description: "Downloads a video or audio file from a URL and attaches it to the response message.", - validate: async (runtime: IAgentRuntime, message: Memory, state: State) => { + validate: async ( + runtime: IAgentRuntime, + message: Memory, + _state: State + ) => { if (message.content.source !== "discord") { return false; } diff --git a/packages/client-discord/src/actions/joinvoice.ts b/packages/client-discord/src/actions/joinvoice.ts index 32453a158c..d312d58ded 100644 --- a/packages/client-discord/src/actions/joinvoice.ts +++ b/packages/client-discord/src/actions/joinvoice.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line // @ts-nocheck // src/actions/joinVoice import { @@ -167,7 +168,7 @@ You should only respond with the name of the voice channel or none, no commentar state: guessState as unknown as State, }); - const datestr = new Date().toUTCString().replace(/:/g, "-"); + const _datestr = new Date().toUTCString().replace(/:/g, "-"); const responseContent = await generateText({ runtime, diff --git a/packages/client-discord/src/actions/leavevoice.ts b/packages/client-discord/src/actions/leavevoice.ts index 54a1f7a46d..d15a941e24 100644 --- a/packages/client-discord/src/actions/leavevoice.ts +++ b/packages/client-discord/src/actions/leavevoice.ts @@ -90,7 +90,7 @@ export default { (channel: Channel) => channel.type === ChannelType.GuildVoice ); - voiceChannels?.forEach((channel: Channel) => { + voiceChannels?.forEach((_channel: Channel) => { const connection = getVoiceConnection( (discordMessage as DiscordMessage).guild?.id as string ); diff --git a/packages/client-discord/src/actions/summarize_conversation.ts b/packages/client-discord/src/actions/summarize_conversation.ts index 86d3921dc5..ea7f35d683 100644 --- a/packages/client-discord/src/actions/summarize_conversation.ts +++ b/packages/client-discord/src/actions/summarize_conversation.ts @@ -253,7 +253,7 @@ const summarizeAction = { const chunks = await splitChunks(formattedMemories, chunkSize, 0); - const datestr = new Date().toUTCString().replace(/:/g, "-"); + const _datestr = new Date().toUTCString().replace(/:/g, "-"); state.memoriesWithAttachments = formattedMemories; state.objective = objective; diff --git a/packages/client-discord/src/actions/transcribe_media.ts b/packages/client-discord/src/actions/transcribe_media.ts index 52e2efedd5..ab0a70cc70 100644 --- a/packages/client-discord/src/actions/transcribe_media.ts +++ b/packages/client-discord/src/actions/transcribe_media.ts @@ -73,7 +73,11 @@ const transcribeMediaAction = { ], description: "Transcribe the full text of an audio or video file that the user has attached.", - validate: async (runtime: IAgentRuntime, message: Memory, state: State) => { + validate: async ( + _runtime: IAgentRuntime, + message: Memory, + _state: State + ) => { if (message.content.source !== "discord") { return false; } diff --git a/packages/client-discord/src/attachments.ts b/packages/client-discord/src/attachments.ts index 7746beda4e..fe675e29bf 100644 --- a/packages/client-discord/src/attachments.ts +++ b/packages/client-discord/src/attachments.ts @@ -8,7 +8,6 @@ import { IVideoService, Media, ModelClass, - Service, ServiceType, } from "@ai16z/eliza"; import { Attachment, Collection } from "discord.js"; diff --git a/packages/client-discord/src/index.ts b/packages/client-discord/src/index.ts index 061f8e55ce..a23b6cedae 100644 --- a/packages/client-discord/src/index.ts +++ b/packages/client-discord/src/index.ts @@ -303,7 +303,7 @@ export const DiscordClientInterface: ElizaClient = { return new DiscordClient(runtime); }, - stop: async (runtime: IAgentRuntime) => { + stop: async (_runtime: IAgentRuntime) => { console.warn("Discord client does not support stopping yet"); }, }; diff --git a/packages/client-discord/src/voice.ts b/packages/client-discord/src/voice.ts index 61d8224ae0..623f39de4c 100644 --- a/packages/client-discord/src/voice.ts +++ b/packages/client-discord/src/voice.ts @@ -385,7 +385,7 @@ export class VoiceManager extends EventEmitter { let transcriptionStarted = false; let transcriptionText = ""; - const monitor = new AudioMonitor( + const _monitor = new AudioMonitor( audioStream, 10000000, async (buffer) => { diff --git a/packages/client-github/eslint.config.mjs b/packages/client-github/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-github/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-github/package.json b/packages/client-github/package.json index cdc9905f2e..af56dec415 100644 --- a/packages/client-github/package.json +++ b/packages/client-github/package.json @@ -13,10 +13,15 @@ }, "devDependencies": { "@types/glob": "^8.1.0", + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" } } diff --git a/packages/client-github/src/index.ts b/packages/client-github/src/index.ts index ac03a9df36..71d9238943 100644 --- a/packages/client-github/src/index.ts +++ b/packages/client-github/src/index.ts @@ -191,7 +191,7 @@ export const GitHubClientInterface: Client = { return client; }, - stop: async (runtime: IAgentRuntime) => { + stop: async (_runtime: IAgentRuntime) => { elizaLogger.log("GitHubClientInterface stop"); }, }; diff --git a/packages/client-telegram/eslint.config.mjs b/packages/client-telegram/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-telegram/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-telegram/package.json b/packages/client-telegram/package.json index 378149c60c..9362f1f1a5 100644 --- a/packages/client-telegram/package.json +++ b/packages/client-telegram/package.json @@ -12,10 +12,15 @@ "zod": "3.23.8" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" } } diff --git a/packages/client-telegram/src/index.ts b/packages/client-telegram/src/index.ts index 41008057e6..3e3be51e0c 100644 --- a/packages/client-telegram/src/index.ts +++ b/packages/client-telegram/src/index.ts @@ -19,7 +19,7 @@ export const TelegramClientInterface: Client = { ); return tg; }, - stop: async (runtime: IAgentRuntime) => { + stop: async (_runtime: IAgentRuntime) => { console.warn("Telegram client does not support stopping yet"); }, }; diff --git a/packages/client-twitter/eslint.config.mjs b/packages/client-twitter/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/client-twitter/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/client-twitter/package.json b/packages/client-twitter/package.json index e442418c1e..1e541f67f7 100644 --- a/packages/client-twitter/package.json +++ b/packages/client-twitter/package.json @@ -11,11 +11,16 @@ "zod": "3.23.8" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/client-twitter/src/index.ts b/packages/client-twitter/src/index.ts index 2ac9056e3a..dad65d4d32 100644 --- a/packages/client-twitter/src/index.ts +++ b/packages/client-twitter/src/index.ts @@ -37,7 +37,7 @@ export const TwitterClientInterface: Client = { return manager; }, - async stop(runtime: IAgentRuntime) { + async stop(_runtime: IAgentRuntime) { elizaLogger.warn("Twitter client does not support stopping yet"); }, }; diff --git a/packages/client-twitter/src/utils.ts b/packages/client-twitter/src/utils.ts index 6ef63c3087..fe003d1295 100644 --- a/packages/client-twitter/src/utils.ts +++ b/packages/client-twitter/src/utils.ts @@ -270,6 +270,7 @@ function splitTweetContent(content: string): string[] { } function splitParagraph(paragraph: string, maxLength: number): string[] { + // eslint-disable-next-line const sentences = paragraph.match(/[^\.!\?]+[\.!\?]+|[^\.!\?]+$/g) || [ paragraph, ]; diff --git a/packages/core/eslint.config.mjs b/packages/core/eslint.config.mjs index 73de84067f..c6b6b1a9da 100644 --- a/packages/core/eslint.config.mjs +++ b/packages/core/eslint.config.mjs @@ -1,55 +1,3 @@ -import eslint from "@eslint/js"; -import tseslint from "@typescript-eslint/eslint-plugin"; -import typescript from "@typescript-eslint/parser"; -import prettier from "eslint-config-prettier"; +import eslintGlobalConfig from "../../eslint.global.mjs"; -export default [ - // JavaScript and TypeScript files - { - files: ["src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "src/**/*.ts"], - languageOptions: { - parser: typescript, - parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - project: "./tsconfig.json", // Make sure your tsconfig includes @types/node - }, - globals: { - // Add Node.js globals - NodeJS: "readonly", - console: "readonly", - process: "readonly", - Buffer: "readonly", - __dirname: "readonly", - __filename: "readonly", - module: "readonly", - require: "readonly", - }, - }, - plugins: { - "@typescript-eslint": tseslint, - }, - rules: { - ...eslint.configs.recommended.rules, - ...tseslint.configs.recommended.rules, - "prefer-const": "warn", - "no-constant-binary-expression": "error", - - // Disable no-undef as TypeScript handles this better - "no-undef": "off", - "@typescript-eslint/no-unsafe-function-type": "off", - // Customize TypeScript rules - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - ignoreRestSiblings: true, - }, - ], - }, - }, - // Add prettier as the last config to override other formatting rules - prettier, -]; +export default [...eslintGlobalConfig]; diff --git a/packages/core/package.json b/packages/core/package.json index f1ba762e2d..ccd6483c5c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -38,6 +38,7 @@ "eslint": "9.13.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "jest": "29.7.0", "lint-staged": "15.2.10", "nodemon": "3.1.7", diff --git a/packages/core/src/embedding.ts b/packages/core/src/embedding.ts index 2d03d3f4bb..0bb91f136b 100644 --- a/packages/core/src/embedding.ts +++ b/packages/core/src/embedding.ts @@ -158,7 +158,8 @@ async function getLocalEmbedding(input: string): Promise { (async () => { try { return await import("fastembed"); - } catch (error) { + // eslint-disable-next-line + } catch (_error) { elizaLogger.error("Failed to load fastembed."); throw new Error( "fastembed import failed, falling back to remote embedding" @@ -195,7 +196,8 @@ async function getLocalEmbedding(input: string): Promise { const trimmedInput = trimTokens(input, 8000, "gpt-4o-mini"); const embedding = await embeddingModel.queryEmbed(trimmedInput); return embedding; - } catch (error) { + // eslint-disable-next-line + } catch (_error) { elizaLogger.warn( "Local embedding not supported in browser, falling back to remote embedding." ); diff --git a/packages/core/src/tests/cache.test.ts b/packages/core/src/tests/cache.test.ts index 3a7c733937..e9a3bbde6e 100644 --- a/packages/core/src/tests/cache.test.ts +++ b/packages/core/src/tests/cache.test.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-dupe-class-members */ import { CacheManager, MemoryCacheAdapter } from "../cache.ts"; // Adjust the import based on your project structure // Now, let’s fix the test suite. diff --git a/packages/core/src/tests/token.test.ts b/packages/core/src/tests/token.test.ts index e8ffc377c9..76f70509dc 100644 --- a/packages/core/src/tests/token.test.ts +++ b/packages/core/src/tests/token.test.ts @@ -1,77 +1,77 @@ -// // Now import other modules -// import { createRuntime } from "../test_resources/createRuntime"; -// import { TokenProvider, WalletProvider } from "@ai16z/plugin-solana"; -// import { Connection, PublicKey } from "@solana/web3.js"; -// import { describe, test, expect, beforeEach, vi } from "vitest"; -// import NodeCache from "node-cache"; +// Now import other modules +import { createRuntime } from "../test_resources/createRuntime"; +import { TokenProvider, WalletProvider } from "@ai16z/plugin-solana"; +import { Connection, PublicKey } from "@solana/web3.js"; +import { describe, it, expect, beforeEach, vi } from "vitest"; +import NodeCache from "node-cache"; -// describe("TokenProvider Tests", async () => { -// let tokenProvider: TokenProvider; +describe("TokenProvider Tests", () => { + let tokenProvider: TokenProvider; -// beforeEach(async () => { -// // Clear all mocks before each test -// vi.clearAllMocks(); + beforeEach(async () => { + // Clear all mocks before each test + vi.clearAllMocks(); -// const { runtime } = await createRuntime({ -// env: process.env, -// conversationLength: 10, -// }); + const { runtime } = await createRuntime({ + env: process.env, + conversationLength: 10, + }); -// const walletProvider = new WalletProvider( -// new Connection(runtime.getSetting("RPC_URL")), -// new PublicKey(runtime.getSetting("WALLET_PUBLIC_KEY")) -// ); -// // Create new instance of TokenProvider -// tokenProvider = new TokenProvider( -// "2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh", -// walletProvider -// ); + const walletProvider = new WalletProvider( + new Connection(runtime.getSetting("RPC_URL")), + new PublicKey(runtime.getSetting("WALLET_PUBLIC_KEY")) + ); + // Create new instance of TokenProvider + tokenProvider = new TokenProvider( + "2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh", + walletProvider + ); -// // Clear the cache and ensure it's empty -// (tokenProvider as any).cache.flushAll(); -// (tokenProvider as any).cache.close(); -// (tokenProvider as any).cache = new NodeCache(); + // Clear the cache and ensure it's empty + (tokenProvider as any).cache.flushAll(); + (tokenProvider as any).cache.close(); + (tokenProvider as any).cache = new NodeCache(); -// // Mock the getCachedData method instead -// vi.spyOn(tokenProvider as any, "getCachedData").mockReturnValue(null); -// }); + // Mock the getCachedData method instead + vi.spyOn(tokenProvider as any, "getCachedData").mockReturnValue(null); + }); -// test("should fetch token security data", async () => { -// // Mock the response for the fetchTokenSecurity call -// const mockFetchResponse = { -// success: true, -// data: { -// ownerBalance: "100", -// creatorBalance: "50", -// ownerPercentage: 10, -// creatorPercentage: 5, -// top10HolderBalance: "200", -// top10HolderPercent: 20, -// }, -// }; + it.skip("should fetch token security data", async () => { + // Mock the response for the fetchTokenSecurity call + const mockFetchResponse = { + success: true, + data: { + ownerBalance: "100", + creatorBalance: "50", + ownerPercentage: 10, + creatorPercentage: 5, + top10HolderBalance: "200", + top10HolderPercent: 20, + }, + }; -// // Mock fetchWithRetry function -// const fetchSpy = vi -// .spyOn(tokenProvider as any, "fetchWithRetry") -// .mockResolvedValue(mockFetchResponse); + // Mock fetchWithRetry function + const fetchSpy = vi + .spyOn(tokenProvider as any, "fetchWithRetry") + .mockResolvedValue(mockFetchResponse); -// // Run the fetchTokenSecurity method -// const securityData = await tokenProvider.fetchTokenSecurity(); -// // Check if the data returned is correct -// expect(securityData).toEqual({ -// ownerBalance: "100", -// creatorBalance: "50", -// ownerPercentage: 10, -// creatorPercentage: 5, -// top10HolderBalance: "200", -// top10HolderPercent: 20, -// }); + // Run the fetchTokenSecurity method + const securityData = await tokenProvider.fetchTokenSecurity(); + // Check if the data returned is correct + expect(securityData).toEqual({ + ownerBalance: "100", + creatorBalance: "50", + ownerPercentage: 10, + creatorPercentage: 5, + top10HolderBalance: "200", + top10HolderPercent: 20, + }); -// // Ensure the mock was called with correct URL -// expect(fetchSpy).toHaveBeenCalledWith( -// expect.stringContaining( -// "https://public-api.birdeye.so/defi/token_security?address=2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh" -// ) -// ); -// }); -// }); + // Ensure the mock was called with correct URL + expect(fetchSpy).toHaveBeenCalledWith( + expect.stringContaining( + "https://public-api.birdeye.so/defi/token_security?address=2weMjPLLybRMMva1fM3U31goWWrCpF59CHWNhnCJ9Vyh" + ) + ); + }); +}); diff --git a/packages/create-eliza-app/eslint.config.mjs b/packages/create-eliza-app/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/create-eliza-app/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/create-eliza-app/package.json b/packages/create-eliza-app/package.json index 16cede955b..e4bb32aa03 100644 --- a/packages/create-eliza-app/package.json +++ b/packages/create-eliza-app/package.json @@ -13,6 +13,7 @@ "scripts": { "build": "unbuild", "dev": "jiti ./src/index.ts", + "lint": "eslint . --fix", "start": "node ./dist/index.cjs", "automd": "automd" }, @@ -25,6 +26,10 @@ }, "devDependencies": { "automd": "^0.3.12", + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "jiti": "^2.4.0", "unbuild": "^2.0.0" } diff --git a/packages/plugin-bootstrap/eslint.config.mjs b/packages/plugin-bootstrap/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-bootstrap/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-bootstrap/package.json b/packages/plugin-bootstrap/package.json index 569b3b97aa..5fe1c2a3d0 100644 --- a/packages/plugin-bootstrap/package.json +++ b/packages/plugin-bootstrap/package.json @@ -8,9 +8,16 @@ "@ai16z/eliza": "workspace:*", "tsup": "^8.3.5" }, + "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" + }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-bootstrap/src/actions/ignore.ts b/packages/plugin-bootstrap/src/actions/ignore.ts index 5126999f3a..35121ab051 100644 --- a/packages/plugin-bootstrap/src/actions/ignore.ts +++ b/packages/plugin-bootstrap/src/actions/ignore.ts @@ -14,8 +14,8 @@ export const ignoreAction: Action = { description: "Call this action if ignoring the user. If the user is aggressive, creepy or is finished with the conversation, use this action. Or, if both you and the user have already said goodbye, use this action instead of saying bye again. Use IGNORE any time the conversation has naturally ended. Do not use IGNORE if the user has engaged directly, or if something went wrong an you need to tell them. Only ignore if the user should be ignored.", handler: async ( - runtime: IAgentRuntime, - message: Memory + _runtime: IAgentRuntime, + _message: Memory ): Promise => { return true; }, diff --git a/packages/plugin-bootstrap/src/actions/none.ts b/packages/plugin-bootstrap/src/actions/none.ts index e2f7f158b0..cff68a2057 100644 --- a/packages/plugin-bootstrap/src/actions/none.ts +++ b/packages/plugin-bootstrap/src/actions/none.ts @@ -21,8 +21,8 @@ export const noneAction: Action = { description: "Respond but perform no additional action. This is the default if the agent is speaking and not doing anything additional.", handler: async ( - runtime: IAgentRuntime, - message: Memory + _runtime: IAgentRuntime, + _message: Memory ): Promise => { return true; }, diff --git a/packages/plugin-bootstrap/src/evaluators/fact.ts b/packages/plugin-bootstrap/src/evaluators/fact.ts index 15857f3d11..78e87f5455 100644 --- a/packages/plugin-bootstrap/src/evaluators/fact.ts +++ b/packages/plugin-bootstrap/src/evaluators/fact.ts @@ -3,7 +3,6 @@ import { generateObjectArray } from "@ai16z/eliza"; import { MemoryManager } from "@ai16z/eliza"; import { ActionExample, - Content, IAgentRuntime, Memory, ModelClass, diff --git a/packages/plugin-bootstrap/src/providers/boredom.ts b/packages/plugin-bootstrap/src/providers/boredom.ts index 1158cca46e..159c21f3a5 100644 --- a/packages/plugin-bootstrap/src/providers/boredom.ts +++ b/packages/plugin-bootstrap/src/providers/boredom.ts @@ -336,8 +336,6 @@ const boredomProvider: Provider = { ); const selectedMessage = boredomLevel.statusMessages[randomIndex]; return selectedMessage.replace("{{agentName}}", agentName); - - return ""; }, }; diff --git a/packages/plugin-bootstrap/src/providers/facts.ts b/packages/plugin-bootstrap/src/providers/facts.ts index 21ae26b578..9869640bfb 100644 --- a/packages/plugin-bootstrap/src/providers/facts.ts +++ b/packages/plugin-bootstrap/src/providers/facts.ts @@ -16,7 +16,7 @@ const factsProvider: Provider = { actors: state?.actorsData, }); - const embedding = await embed(runtime, recentMessages); + const _embedding = await embed(runtime, recentMessages); const memoryManager = new MemoryManager({ runtime, diff --git a/packages/plugin-image-generation/eslint.config.mjs b/packages/plugin-image-generation/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-image-generation/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-image-generation/package.json b/packages/plugin-image-generation/package.json index 0b0cc29b95..00c7c8b8de 100644 --- a/packages/plugin-image-generation/package.json +++ b/packages/plugin-image-generation/package.json @@ -8,8 +8,15 @@ "@ai16z/eliza": "workspace:*", "tsup": "^8.3.5" }, + "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" + }, "scripts": { - "build": "tsup --format esm --dts" + "build": "tsup --format esm --dts", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-image-generation/src/index.ts b/packages/plugin-image-generation/src/index.ts index 0aac366e1f..ab95d0c3f3 100644 --- a/packages/plugin-image-generation/src/index.ts +++ b/packages/plugin-image-generation/src/index.ts @@ -7,7 +7,7 @@ import { Plugin, State, } from "@ai16z/eliza"; -import { generateCaption, generateImage } from "@ai16z/eliza"; +import { generateImage } from "@ai16z/eliza"; import fs from "fs"; import path from "path"; @@ -76,7 +76,7 @@ const imageGeneration: Action = { "MAKE_A", ], description: "Generate an image to go along with the message.", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateImageGenConfig(runtime); const anthropicApiKeyOk = !!runtime.getSetting("ANTHROPIC_API_KEY"); @@ -148,7 +148,7 @@ const imageGeneration: Action = { elizaLogger.error("Caption generation failed, using default caption:", error); }*/ - const caption = "..."; + const _caption = "..."; /*= await generateCaption( { imageUrl: image, diff --git a/packages/plugin-node/eslint.config.mjs b/packages/plugin-node/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-node/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-node/package.json b/packages/plugin-node/package.json index 7c5e8aa355..14d14b9cc6 100644 --- a/packages/plugin-node/package.json +++ b/packages/plugin-node/package.json @@ -60,11 +60,16 @@ "youtube-dl-exec": "3.0.10" }, "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4", "tsup": "^8.3.5" }, "scripts": { "build": "tsup --format esm --dts", "dev": "tsup --watch", + "lint": "eslint . --fix", "postinstall": "npx playwright install-deps && npx playwright install" }, "peerDependencies": { diff --git a/packages/plugin-node/src/services/browser.ts b/packages/plugin-node/src/services/browser.ts index c7172ce59b..62749f793c 100644 --- a/packages/plugin-node/src/services/browser.ts +++ b/packages/plugin-node/src/services/browser.ts @@ -266,6 +266,7 @@ export class BrowserService extends Service implements IBrowserService { websiteKey: hcaptchaKey, }); await page.evaluate((token) => { + // eslint-disable-next-line // @ts-ignore window.hcaptcha.setResponse(token); }, solution.gRecaptchaResponse); @@ -279,6 +280,7 @@ export class BrowserService extends Service implements IBrowserService { websiteKey: recaptchaKey, }); await page.evaluate((token) => { + // eslint-disable-next-line // @ts-ignore document.getElementById("g-recaptcha-response").innerHTML = token; diff --git a/packages/plugin-node/src/services/image.ts b/packages/plugin-node/src/services/image.ts index aed37cd927..3f60566f66 100644 --- a/packages/plugin-node/src/services/image.ts +++ b/packages/plugin-node/src/services/image.ts @@ -106,7 +106,7 @@ export class ImageDescriptionService this.queue.push(imageUrl); this.processQueue(); - return new Promise((resolve, reject) => { + return new Promise((resolve, _reject) => { const checkQueue = () => { const index = this.queue.indexOf(imageUrl); if (index !== -1) { diff --git a/packages/plugin-node/src/services/llama.ts b/packages/plugin-node/src/services/llama.ts index 720972278f..7a747136c0 100644 --- a/packages/plugin-node/src/services/llama.ts +++ b/packages/plugin-node/src/services/llama.ts @@ -181,7 +181,7 @@ export class LlamaService extends Service { this.modelPath = path.join(__dirname, modelName); } - async initialize(runtime: IAgentRuntime): Promise {} + async initialize(_runtime: IAgentRuntime): Promise {} private async ensureInitialized() { if (!this.modelInitialized) { diff --git a/packages/plugin-node/src/services/pdf.ts b/packages/plugin-node/src/services/pdf.ts index 8ad0ecec37..92b8a2a13d 100644 --- a/packages/plugin-node/src/services/pdf.ts +++ b/packages/plugin-node/src/services/pdf.ts @@ -13,7 +13,7 @@ export class PdfService extends Service implements IPdfService { return PdfService.getInstance(); } - async initialize(runtime: IAgentRuntime): Promise {} + async initialize(_runtime: IAgentRuntime): Promise {} async convertPdfToText(pdfBuffer: Buffer): Promise { // Convert Buffer to Uint8Array diff --git a/packages/plugin-node/src/services/speech.ts b/packages/plugin-node/src/services/speech.ts index a8a81e99a5..58533f804b 100644 --- a/packages/plugin-node/src/services/speech.ts +++ b/packages/plugin-node/src/services/speech.ts @@ -87,7 +87,7 @@ async function textToSpeech(runtime: IAgentRuntime, text: string) { const reader = response.body?.getReader(); const readable = new Readable({ read() { - reader && + reader && // eslint-disable-line reader.read().then(({ done, value }) => { if (done) { this.push(null); @@ -176,7 +176,7 @@ async function textToSpeech(runtime: IAgentRuntime, text: string) { export class SpeechService extends Service implements ISpeechService { static serviceType: ServiceType = ServiceType.SPEECH_GENERATION; - async initialize(runtime: IAgentRuntime): Promise {} + async initialize(_runtime: IAgentRuntime): Promise {} getInstance(): ISpeechService { return SpeechService.getInstance(); diff --git a/packages/plugin-node/src/services/transcription.ts b/packages/plugin-node/src/services/transcription.ts index e2d7839784..763982e4a1 100644 --- a/packages/plugin-node/src/services/transcription.ts +++ b/packages/plugin-node/src/services/transcription.ts @@ -35,7 +35,7 @@ export class TranscriptionService private queue: { audioBuffer: ArrayBuffer; resolve: Function }[] = []; private processing: boolean = false; - async initialize(runtime: IAgentRuntime): Promise {} + async initialize(_runtime: IAgentRuntime): Promise {} constructor() { super(); @@ -76,7 +76,8 @@ export class TranscriptionService console.log( "CUDA detected. Transcription will use CUDA acceleration." ); - } catch (error) { + // eslint-disable-next-line + } catch (_error) { console.log( "CUDA not detected. Transcription will run on CPU." ); diff --git a/packages/plugin-node/src/services/video.ts b/packages/plugin-node/src/services/video.ts index df87d9445a..81554cc7a7 100644 --- a/packages/plugin-node/src/services/video.ts +++ b/packages/plugin-node/src/services/video.ts @@ -30,7 +30,7 @@ export class VideoService extends Service implements IVideoService { return VideoService.getInstance(); } - async initialize(runtime: IAgentRuntime): Promise {} + async initialize(_runtime: IAgentRuntime): Promise {} private ensureDataDirectoryExists() { if (!fs.existsSync(this.dataDir)) { @@ -140,7 +140,7 @@ export class VideoService extends Service implements IVideoService { ): Promise { const videoId = url.match( - /(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([^\/&?]+)/ + /(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([^\/&?]+)/ // eslint-disable-line )?.[1] || ""; const videoUuid = this.getVideoId(videoId); const cacheKey = `${this.cacheKey}/${videoUuid}`; diff --git a/packages/plugin-solana/eslint.config.mjs b/packages/plugin-solana/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-solana/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-solana/package.json b/packages/plugin-solana/package.json index 9fab068e0a..ff8a04a581 100644 --- a/packages/plugin-solana/package.json +++ b/packages/plugin-solana/package.json @@ -17,8 +17,15 @@ "pumpdotfun-sdk": "1.3.2", "tsup": "^8.3.5" }, + "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" + }, "scripts": { - "build": "tsup --format esm --dts" + "build": "tsup --format esm --dts", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-solana/src/actions/pumpfun.ts b/packages/plugin-solana/src/actions/pumpfun.ts index 96fe39d0ec..e81f44dd16 100644 --- a/packages/plugin-solana/src/actions/pumpfun.ts +++ b/packages/plugin-solana/src/actions/pumpfun.ts @@ -2,12 +2,7 @@ import { AnchorProvider } from "@coral-xyz/anchor"; import { Wallet } from "@coral-xyz/anchor"; import { generateImage } from "@ai16z/eliza"; import { Connection, Keypair, PublicKey } from "@solana/web3.js"; -import { - CreateTokenMetadata, - DEFAULT_DECIMALS, - PriorityFee, - PumpFunSDK, -} from "pumpdotfun-sdk"; +import { CreateTokenMetadata, PriorityFee, PumpFunSDK } from "pumpdotfun-sdk"; import { getAssociatedTokenAddressSync } from "@solana/spl-token"; import bs58 from "bs58"; @@ -232,14 +227,15 @@ export const sellToken = async ({ } }; +// previous logic: +// if (typeof window !== "undefined" && typeof window.confirm === "function") { +// return window.confirm( +// "Confirm the creation and purchase of the token?" +// ); +// } +// return true; const promptConfirmation = async (): Promise => { return true; - if (typeof window !== "undefined" && typeof window.confirm === "function") { - return window.confirm( - "Confirm the creation and purchase of the token?" - ); - } - return true; }; // Save the base64 data to a file @@ -275,7 +271,7 @@ Respond with a JSON markdown block containing only the extracted values.`; export default { name: "CREATE_AND_BUY_TOKEN", similes: ["CREATE_AND_PURCHASE_TOKEN", "DEPLOY_AND_BUY_TOKEN"], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (_runtime: IAgentRuntime, _message: Memory) => { return true; //return isCreateAndBuyContent(runtime, message.content); }, description: diff --git a/packages/plugin-solana/src/actions/swap.ts b/packages/plugin-solana/src/actions/swap.ts index c43a3b22da..97bb55a6a9 100644 --- a/packages/plugin-solana/src/actions/swap.ts +++ b/packages/plugin-solana/src/actions/swap.ts @@ -325,12 +325,14 @@ export const executeSwap: Action = { try { // First try to decode as base58 secretKey = bs58.decode(privateKeyString); + // eslint-disable-next-line } catch (e) { try { // If that fails, try base64 secretKey = Uint8Array.from( Buffer.from(privateKeyString, "base64") ); + // eslint-disable-next-line } catch (e2) { throw new Error("Invalid private key format"); } diff --git a/packages/plugin-solana/src/actions/takeOrder.ts b/packages/plugin-solana/src/actions/takeOrder.ts index b4a5a52872..14e7441679 100644 --- a/packages/plugin-solana/src/actions/takeOrder.ts +++ b/packages/plugin-solana/src/actions/takeOrder.ts @@ -3,11 +3,8 @@ import { IAgentRuntime, Memory, Content, - ActionExample, ModelClass, } from "@ai16z/eliza"; -import * as fs from "fs"; -import { settings } from "@ai16z/eliza"; import { composeContext } from "@ai16z/eliza"; import { generateText } from "@ai16z/eliza"; @@ -32,7 +29,7 @@ const take_order: Action = { return tickerRegex.test(text); }, handler: async (runtime: IAgentRuntime, message: Memory) => { - const text = (message.content as Content).text; + const _text = (message.content as Content).text; const userId = message.userId; const template = ` diff --git a/packages/plugin-solana/src/providers/token.ts b/packages/plugin-solana/src/providers/token.ts index 93b96e6a3a..b773d0ceba 100644 --- a/packages/plugin-solana/src/providers/token.ts +++ b/packages/plugin-solana/src/providers/token.ts @@ -88,7 +88,6 @@ export class TokenProvider { private async fetchWithRetry( url: string, options: RequestInit = {} - // eslint-disable-next-line @typescript-eslint/no-explicit-any ): Promise { let lastError: Error; @@ -685,7 +684,6 @@ export class TokenProvider { console.log({ url }); try { - // eslint-disable-next-line no-constant-condition while (true) { const params = { limit: limit, @@ -731,7 +729,6 @@ export class TokenProvider { `Processing ${data.result.token_accounts.length} holders from page ${page}` ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any data.result.token_accounts.forEach((account: any) => { const owner = account.owner; const balance = parseFloat(account.amount); @@ -892,8 +889,8 @@ export class TokenProvider { const liquidityUsd = toBN(liquidity.usd); const marketCapUsd = toBN(marketCap); const totalSupply = toBN(ownerBalance).plus(creatorBalance); - const ownerPercentage = toBN(ownerBalance).dividedBy(totalSupply); - const creatorPercentage = + const _ownerPercentage = toBN(ownerBalance).dividedBy(totalSupply); + const _creatorPercentage = toBN(creatorBalance).dividedBy(totalSupply); const top10HolderPercent = toBN(tradeData.volume_24h_usd).dividedBy( totalSupply @@ -1017,11 +1014,10 @@ export class TokenProvider { } const tokenAddress = PROVIDER_CONFIG.TOKEN_ADDRESSES.Example; -// eslint-disable-next-line @typescript-eslint/no-unused-vars + const connection = new Connection(PROVIDER_CONFIG.DEFAULT_RPC); const tokenProvider: Provider = { get: async ( - // eslint-disable-next-line @typescript-eslint/no-unused-vars runtime: IAgentRuntime, _message: Memory, _state?: State diff --git a/packages/plugin-solana/src/providers/trustScoreProvider.ts b/packages/plugin-solana/src/providers/trustScoreProvider.ts index 88c2b97df0..32f4126720 100644 --- a/packages/plugin-solana/src/providers/trustScoreProvider.ts +++ b/packages/plugin-solana/src/providers/trustScoreProvider.ts @@ -29,7 +29,7 @@ interface sellDetails { sell_amount: number; sell_recommender_id: string | null; } -interface RecommendationGroup { +interface _RecommendationGroup { recommendation: any; trustScore: number; } @@ -605,7 +605,7 @@ export const trustScoreProvider: Provider = { async get( runtime: IAgentRuntime, message: Memory, - state?: State + _state?: State ): Promise { try { const trustScoreDb = new TrustScoreDatabase( diff --git a/packages/plugin-solana/src/providers/wallet.ts b/packages/plugin-solana/src/providers/wallet.ts index c9d406eb46..22d9f050bf 100644 --- a/packages/plugin-solana/src/providers/wallet.ts +++ b/packages/plugin-solana/src/providers/wallet.ts @@ -33,7 +33,7 @@ interface WalletPortfolio { items: Array; } -interface BirdEyePriceData { +interface _BirdEyePriceData { data: { [key: string]: { price: number; diff --git a/packages/plugin-starknet/eslint.config.mjs b/packages/plugin-starknet/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-starknet/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-starknet/package.json b/packages/plugin-starknet/package.json index 16328b6798..cea06216df 100644 --- a/packages/plugin-starknet/package.json +++ b/packages/plugin-starknet/package.json @@ -14,10 +14,17 @@ "tsup": "^8.3.5", "vitest": "^2.1.4" }, + "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" + }, "scripts": { "build": "tsup --format esm --dts", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-starknet/src/actions/swap.ts b/packages/plugin-starknet/src/actions/swap.ts index b5e2313334..3c135b5f75 100644 --- a/packages/plugin-starknet/src/actions/swap.ts +++ b/packages/plugin-starknet/src/actions/swap.ts @@ -16,7 +16,7 @@ import { QuoteRequest, } from "@avnu/avnu-sdk"; -import { getStarknetAccount, validateSettings } from "../utils/index.ts"; +import { getStarknetAccount } from "../utils/index.ts"; import { validateStarknetConfig } from "../enviroment.ts"; interface SwapContent { @@ -80,7 +80,7 @@ export const executeSwap: Action = { "STARKNET_TRADE_TOKENS", "STARKNET_EXCHANGE_TOKENS", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateStarknetConfig(runtime); return true; }, diff --git a/packages/plugin-starknet/src/actions/takeOrder.ts b/packages/plugin-starknet/src/actions/takeOrder.ts index a18dab230a..39df5073f6 100644 --- a/packages/plugin-starknet/src/actions/takeOrder.ts +++ b/packages/plugin-starknet/src/actions/takeOrder.ts @@ -51,7 +51,7 @@ const take_order: Action = { return tickerRegex.test(text); }, handler: async (runtime: IAgentRuntime, message: Memory) => { - const text = (message.content as Content).text; + const _text = (message.content as Content).text; const userId = message.userId; let ticker, contractAddress; diff --git a/packages/plugin-starknet/src/actions/transfer.ts b/packages/plugin-starknet/src/actions/transfer.ts index 76baba1c38..6fd851ca93 100644 --- a/packages/plugin-starknet/src/actions/transfer.ts +++ b/packages/plugin-starknet/src/actions/transfer.ts @@ -13,11 +13,7 @@ import { generateObject, elizaLogger, } from "@ai16z/eliza"; -import { - getStarknetAccount, - isTransferContent, - validateSettings, -} from "../utils"; +import { getStarknetAccount, isTransferContent } from "../utils"; import { ERC20Token } from "../utils/ERC20Token"; import { validateStarknetConfig } from "../enviroment"; @@ -58,7 +54,7 @@ export default { "SEND_ETH_ON_STARKNET", "PAY_ON_STARKNET", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateStarknetConfig(runtime); return true; }, diff --git a/packages/plugin-starknet/src/actions/unruggable.ts b/packages/plugin-starknet/src/actions/unruggable.ts index 9dcde7e8e0..9d052415f9 100644 --- a/packages/plugin-starknet/src/actions/unruggable.ts +++ b/packages/plugin-starknet/src/actions/unruggable.ts @@ -16,16 +16,9 @@ import { getStarknetProvider, parseFormatedAmount, parseFormatedPercentage, - validateSettings, } from "../utils/index.ts"; import { DeployData, Factory } from "@unruggable_starknet/core"; -import { - AMM, - EKUBO_TICK_SPACING, - LiquidityType, - QUOTE_TOKEN_SYMBOL, - RECOMMENDED_EKUBO_FEES, -} from "@unruggable_starknet/core/constants"; +import { AMM, QUOTE_TOKEN_SYMBOL } from "@unruggable_starknet/core/constants"; import { ACCOUNTS, TOKENS } from "../utils/constants.ts"; import { validateStarknetConfig } from "../enviroment.ts"; @@ -82,7 +75,7 @@ export const deployToken: Action = { "STARKNET_DEPLOY_MEMECOIN", "STARKNET_CREATE_MEMECOIN", ], - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { await validateStarknetConfig(runtime); return true; }, diff --git a/packages/plugin-starknet/src/providers/token.ts b/packages/plugin-starknet/src/providers/token.ts index d37d1047a9..c6677d4dfb 100644 --- a/packages/plugin-starknet/src/providers/token.ts +++ b/packages/plugin-starknet/src/providers/token.ts @@ -9,7 +9,6 @@ import { HolderData, ProcessedTokenData, TokenSecurityData, - TokenTradeData, CalculatedBuyAmounts, Prices, } from "../types/trustDB.ts"; @@ -404,7 +403,7 @@ export class TokenProvider { } // TODO: - async analyzeHolderDistribution(tradeData: TokenInfo): Promise { + async analyzeHolderDistribution(_tradeData: TokenInfo): Promise { // Define the time intervals to consider (e.g., 30m, 1h, 2h) // TODO: Update to Starknet @@ -468,7 +467,6 @@ export class TokenProvider { console.log({ url }); try { - // eslint-disable-next-line no-constant-condition while (true) { const params = { limit: limit, @@ -514,7 +512,6 @@ export class TokenProvider { `Processing ${data.result.token_accounts.length} holders from page ${page}` ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any data.result.token_accounts.forEach((account: any) => { const owner = account.owner; const balance = parseFloat(account.amount); diff --git a/packages/plugin-starknet/src/providers/trustScoreProvider.ts b/packages/plugin-starknet/src/providers/trustScoreProvider.ts index 809d8e9212..5913946f1d 100644 --- a/packages/plugin-starknet/src/providers/trustScoreProvider.ts +++ b/packages/plugin-starknet/src/providers/trustScoreProvider.ts @@ -20,10 +20,9 @@ import { import { settings } from "@ai16z/eliza"; import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; import { getTokenBalance } from "../utils/index.ts"; -import { walletProvider } from "./walletProvider.ts"; import { TokenProvider } from "./token.ts"; -const Wallet = settings.MAIN_WALLET_ADDRESS; +const _Wallet = settings.MAIN_WALLET_ADDRESS; interface TradeData { buy_amount: number; is_simulation: boolean; @@ -32,7 +31,7 @@ interface sellDetails { sell_amount: number; sell_recommender_id: string | null; } -interface RecommendationGroup { +interface _RecommendationGroup { recommendation: any; trustScore: number; } @@ -605,7 +604,7 @@ export const trustScoreProvider: Provider = { async get( runtime: IAgentRuntime, message: Memory, - state?: State + _state?: State ): Promise { try { const trustScoreDb = new TrustScoreDatabase( diff --git a/packages/plugin-starknet/src/providers/walletProvider.ts b/packages/plugin-starknet/src/providers/walletProvider.ts index 91d90b35fa..2ab45b0f05 100644 --- a/packages/plugin-starknet/src/providers/walletProvider.ts +++ b/packages/plugin-starknet/src/providers/walletProvider.ts @@ -1,5 +1,4 @@ import { IAgentRuntime, Memory, Provider, State } from "@ai16z/eliza"; -import { Connection, PublicKey } from "@solana/web3.js"; import BigNumber from "bignumber.js"; import NodeCache from "node-cache"; import { validateSettings } from "../utils"; @@ -34,7 +33,7 @@ interface WalletPortfolio { items: Array; } -interface BirdEyePriceData { +interface _BirdEyePriceData { data: { [key: string]: { price: number; @@ -106,7 +105,7 @@ export class WalletProvider { throw lastError; } - async fetchPortfolioValue(runtime): Promise { + async fetchPortfolioValue(_runtime): Promise { try { const cacheKey = `portfolio-${this.runtime.getSetting("STARKNET_WALLET_ADDRESS")}`; const cachedValue = this.cache.get(cacheKey); @@ -163,7 +162,7 @@ export class WalletProvider { } } - async fetchPrices(runtime): Promise { + async fetchPrices(_runtime): Promise { try { const cacheKey = "prices"; const cachedValue = this.cache.get(cacheKey); @@ -175,7 +174,7 @@ export class WalletProvider { console.log("Cache miss for fetchPrices"); const { SOL, BTC, ETH } = PROVIDER_CONFIG.TOKEN_ADDRESSES; - const tokens = [SOL, BTC, ETH]; + const _tokens = [SOL, BTC, ETH]; const prices: Prices = { solana: { usd: "0" }, bitcoin: { usd: "0" }, diff --git a/packages/plugin-starknet/src/utils/ERC20Token.ts b/packages/plugin-starknet/src/utils/ERC20Token.ts index 10721486dc..0d4c54e1f0 100644 --- a/packages/plugin-starknet/src/utils/ERC20Token.ts +++ b/packages/plugin-starknet/src/utils/ERC20Token.ts @@ -1,4 +1,4 @@ -import { Account, Call, CallData, Calldata, Contract, cairo } from "starknet"; +import { Account, CallData, Calldata, Contract, cairo } from "starknet"; import erc20Abi from "./erc20.json"; export type ApproveCall = { diff --git a/packages/plugin-trustdb/eslint.config.mjs b/packages/plugin-trustdb/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-trustdb/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-trustdb/package.json b/packages/plugin-trustdb/package.json index 99ec654742..ec51200b49 100644 --- a/packages/plugin-trustdb/package.json +++ b/packages/plugin-trustdb/package.json @@ -14,10 +14,15 @@ "scripts": { "build": "tsup --format esm --dts", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "lint": "eslint . --fix" }, "devDependencies": { - "@types/dompurify": "^3.2.0" + "@types/dompurify": "^3.2.0", + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-video-generation/eslint.config.mjs b/packages/plugin-video-generation/eslint.config.mjs new file mode 100644 index 0000000000..c6b6b1a9da --- /dev/null +++ b/packages/plugin-video-generation/eslint.config.mjs @@ -0,0 +1,3 @@ +import eslintGlobalConfig from "../../eslint.global.mjs"; + +export default [...eslintGlobalConfig]; diff --git a/packages/plugin-video-generation/package.json b/packages/plugin-video-generation/package.json index 4b402cbb5f..ad57534139 100644 --- a/packages/plugin-video-generation/package.json +++ b/packages/plugin-video-generation/package.json @@ -8,9 +8,16 @@ "@ai16z/eliza": "workspace:*", "tsup": "^8.3.5" }, + "devDependencies": { + "eslint": "9.13.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "eslint-plugin-vitest": "0.5.4" + }, "scripts": { "build": "tsup --format esm --dts", - "dev": "tsup --watch" + "dev": "tsup --watch", + "lint": "eslint . --fix" }, "peerDependencies": { "whatwg-url": "7.1.0" diff --git a/packages/plugin-video-generation/src/index.ts b/packages/plugin-video-generation/src/index.ts index e447a66fe1..08f158dc3c 100644 --- a/packages/plugin-video-generation/src/index.ts +++ b/packages/plugin-video-generation/src/index.ts @@ -119,7 +119,7 @@ const videoGeneration: Action = { "VIDEO_MAKE", ], description: "Generate a video based on a text prompt", - validate: async (runtime: IAgentRuntime, message: Memory) => { + validate: async (runtime: IAgentRuntime, _message: Memory) => { elizaLogger.log("Validating video generation action"); const lumaApiKey = runtime.getSetting("LUMA_API_KEY"); elizaLogger.log("LUMA_API_KEY present:", !!lumaApiKey); @@ -128,14 +128,14 @@ const videoGeneration: Action = { handler: async ( runtime: IAgentRuntime, message: Memory, - state: State, - options: any, + _state: State, + _options: any, callback: HandlerCallback ) => { elizaLogger.log("Video generation request:", message); // Clean up the prompt by removing mentions and commands - let videoPrompt = message.content.text + const videoPrompt = message.content.text .replace(/<@\d+>/g, "") // Remove mentions .replace( /generate video|create video|make video|render video/gi, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9994e7715d..6257152cd2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -265,6 +265,18 @@ importers: specifier: ^8.13.1 version: 8.13.1 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -287,6 +299,18 @@ importers: specifier: 7.1.0 version: 7.1.0 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -309,6 +333,18 @@ importers: specifier: 7.1.0 version: 7.1.0 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -325,6 +361,18 @@ importers: specifier: 7.1.0 version: 7.1.0 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -365,6 +413,18 @@ importers: specifier: 7.1.0 version: 7.1.0 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -402,6 +462,18 @@ importers: specifier: 7.1.0 version: 7.1.0 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -439,6 +511,18 @@ importers: specifier: 3.23.8 version: 3.23.8 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -464,6 +548,18 @@ importers: '@types/glob': specifier: ^8.1.0 version: 8.1.0 + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -486,6 +582,18 @@ importers: specifier: 3.23.8 version: 3.23.8 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -508,6 +616,18 @@ importers: specifier: 3.23.8 version: 3.23.8 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -656,6 +776,9 @@ importers: eslint-plugin-prettier: specifier: 5.2.1 version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) jest: specifier: 29.7.0 version: 29.7.0(@types/node@22.8.4)(ts-node@10.9.2(@swc/core@1.9.2(@swc/helpers@0.5.15))(@types/node@22.8.4)(typescript@5.6.3)) @@ -705,6 +828,18 @@ importers: automd: specifier: ^0.3.12 version: 0.3.12 + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) jiti: specifier: ^2.4.0 version: 2.4.0 @@ -723,6 +858,19 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages/plugin-image-generation: dependencies: @@ -735,6 +883,19 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages/plugin-node: dependencies: @@ -901,6 +1062,18 @@ importers: specifier: 3.0.10 version: 3.0.10 devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) tsup: specifier: ^8.3.5 version: 8.3.5(@swc/core@1.9.2(@swc/helpers@0.5.15))(jiti@2.4.0)(postcss@8.4.49)(typescript@5.6.3)(yaml@2.6.1) @@ -943,6 +1116,19 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages/plugin-starknet: dependencies: @@ -973,6 +1159,19 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages/plugin-trustdb: dependencies: @@ -998,6 +1197,18 @@ importers: '@types/dompurify': specifier: ^3.2.0 version: 3.2.0 + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages/plugin-video-generation: dependencies: @@ -1010,6 +1221,19 @@ importers: whatwg-url: specifier: 7.1.0 version: 7.1.0 + devDependencies: + eslint: + specifier: 9.13.0 + version: 9.13.0(jiti@2.4.0) + eslint-config-prettier: + specifier: 9.1.0 + version: 9.1.0(eslint@9.13.0(jiti@2.4.0)) + eslint-plugin-prettier: + specifier: 5.2.1 + version: 5.2.1(@types/eslint@9.6.1)(eslint-config-prettier@9.1.0(eslint@9.13.0(jiti@2.4.0)))(eslint@9.13.0(jiti@2.4.0))(prettier@3.3.3) + eslint-plugin-vitest: + specifier: 0.5.4 + version: 0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)) packages: @@ -2528,6 +2752,7 @@ packages: resolution: {integrity: sha512-hArn9FF5ZYi1IkxdJEVnJi+OxlwLV0NJYWpKXsmNOojtGtAZHxmsELA+MZlu2KW1F/K1/nt7lFOfcMXNYweq9w==} version: 0.17.0 engines: {node: '>=16.11.0'} + deprecated: This version uses deprecated encryption modes. Please use a newer version. '@discordjs/ws@1.1.1': resolution: {integrity: sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA==} @@ -5546,6 +5771,10 @@ packages: typescript: optional: true + '@typescript-eslint/scope-manager@7.18.0': + resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.12.2': resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5573,6 +5802,10 @@ packages: typescript: optional: true + '@typescript-eslint/types@7.18.0': + resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.12.2': resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5581,6 +5814,15 @@ packages: resolution: {integrity: sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@7.18.0': + resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/typescript-estree@8.12.2': resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5599,6 +5841,12 @@ packages: typescript: optional: true + '@typescript-eslint/utils@7.18.0': + resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} + engines: {node: ^18.18.0 || >=20.0.0} + peerDependencies: + eslint: ^8.56.0 + '@typescript-eslint/utils@8.12.2': resolution: {integrity: sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5615,6 +5863,10 @@ packages: typescript: optional: true + '@typescript-eslint/visitor-keys@7.18.0': + resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} + engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@8.12.2': resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -7871,6 +8123,19 @@ packages: peerDependencies: eslint: '>=7' + eslint-plugin-vitest@0.5.4: + resolution: {integrity: sha512-um+odCkccAHU53WdKAw39MY61+1x990uXjSPguUCq3VcEHdqJrOb8OTMrbYlY6f9jAKx7x98kLVlIe3RJeJqoQ==} + engines: {node: ^18.0.0 || >= 20.0.0} + peerDependencies: + '@typescript-eslint/eslint-plugin': '*' + eslint: ^8.57.0 || ^9.0.0 + vitest: '*' + peerDependenciesMeta: + '@typescript-eslint/eslint-plugin': + optional: true + vitest: + optional: true + eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} engines: {node: '>=8.0.0'} @@ -20824,6 +21089,11 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/scope-manager@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager@8.12.2': dependencies: '@typescript-eslint/types': 8.12.2 @@ -20858,10 +21128,27 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/types@7.18.0': {} + '@typescript-eslint/types@8.12.2': {} '@typescript-eslint/types@8.15.0': {} + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.3)': + dependencies: + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/visitor-keys': 7.18.0 + debug: 4.3.7(supports-color@5.5.0) + globby: 11.1.0 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.4.0(typescript@5.6.3) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/typescript-estree@8.12.2(typescript@5.6.3)': dependencies: '@typescript-eslint/types': 8.12.2 @@ -20892,6 +21179,17 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/utils@7.18.0(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)': + dependencies: + '@eslint-community/eslint-utils': 4.4.1(eslint@9.13.0(jiti@2.4.0)) + '@typescript-eslint/scope-manager': 7.18.0 + '@typescript-eslint/types': 7.18.0 + '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) + eslint: 9.13.0(jiti@2.4.0) + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/utils@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)': dependencies: '@eslint-community/eslint-utils': 4.4.1(eslint@9.13.0(jiti@2.4.0)) @@ -20915,6 +21213,11 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/visitor-keys@7.18.0': + dependencies: + '@typescript-eslint/types': 7.18.0 + eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@8.12.2': dependencies: '@typescript-eslint/types': 8.12.2 @@ -23551,6 +23854,17 @@ snapshots: dependencies: eslint: 9.13.0(jiti@2.4.0) + eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0)): + dependencies: + '@typescript-eslint/utils': 7.18.0(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3) + eslint: 9.13.0(jiti@2.4.0) + optionalDependencies: + '@typescript-eslint/eslint-plugin': 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3))(eslint@9.13.0(jiti@2.4.0))(typescript@5.6.3) + vitest: 2.1.5(@types/node@22.8.4)(jsdom@25.0.1(bufferutil@4.0.8)(canvas@2.11.2(encoding@0.1.13))(utf-8-validate@5.0.10))(terser@5.36.0) + transitivePeerDependencies: + - supports-color + - typescript + eslint-scope@5.1.1: dependencies: esrecurse: 4.3.0 diff --git a/scripts/lint.sh b/scripts/lint.sh new file mode 100644 index 0000000000..98e28991fa --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Check Node.js version +REQUIRED_NODE_VERSION=22 +CURRENT_NODE_VERSION=$(node -v | cut -d'.' -f1 | sed 's/v//') + +if (( CURRENT_NODE_VERSION < REQUIRED_NODE_VERSION )); then + echo "Error: Node.js version must be $REQUIRED_NODE_VERSION or higher. Current version is $CURRENT_NODE_VERSION." + exit 1 +fi + +# Navigate to the script's directory +cd "$(dirname "$0")"/.. + +# Check if the packages directory exists +if [ ! -d "packages" ]; then + echo "Error: 'packages' directory not found." + exit 1 +fi + +# Find all packages under the packages directory +PACKAGES=( $(find packages -mindepth 1 -maxdepth 1 -type d -exec basename {} \;) ) + +# lint packages in specified order +for package in "${PACKAGES[@]}"; do + package_path="packages/$package" + + if [ ! -d "$package_path" ]; then + echo -e "\033[1mPackage directory '$package' not found, skipping...\033[0m" + continue + fi + + echo -e "\033[1mLinting package: $package\033[0m" + cd "$package_path" || continue + + if [ -f "package.json" ]; then + # Run lint if available + if npm run | grep -q " lint"; then + echo -e "\033[1mRunning lint for package: $package\033[0m" + if npm run lint; then + echo -e "\033[1;32mSuccessfully linted $package\033[0m\n" + else + echo -e "\033[1;31mLint failed for $package\033[0m" + exit 1 # Exit immediately if lint fails + fi + else + echo "No lint script found in $package, skipping lint..." + fi + else + echo "No package.json found in $package, skipping..." + fi + + cd - > /dev/null || exit +done + +echo -e "\033[1mLint process completed.😎\033[0m"