Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add linter to all packages and enable vitest #490

Merged

Conversation

snobbee
Copy link
Contributor

@snobbee snobbee commented Nov 21, 2024

Relates to:

Risks

Low

Background

What does this PR do?

  • Enable linter to all packages and add the vitest plugin to the eslint configs to enable linter on test files.
  • Add a global lint script that run all packages lint command all at once.

What kind of change is this?

Linter improvement to improve code quality across the packages.

Documentation changes needed?

No

Testing

Where should a reviewer start?

Detailed testing steps

Run:

pnpm lint

and it will run the linter against all the packages.

$ pnpm lint

> eliza@ lint /tmp/eliza
> bash ./scripts/lint.sh

Linting package: plugin-video-generation
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_17_348Z-debug-0.log
Running lint for package: plugin-video-generation

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-video-generation/src/index.ts
  122:46  error  'message' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

✖ 1 problem (1 error, 0 warnings)

Lint failed for plugin-video-generation
Linting package: client-auto
Running lint for package: client-auto

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-auto/src/index.ts
  55:15  error  'tokenInfos' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  90:18  error  'runtime' is defined but never used. Allowed unused args must match /^_/u              @typescript-eslint/no-unused-vars

✖ 2 problems (2 errors, 0 warnings)

Lint failed for client-auto
Linting package: plugin-node
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_19_343Z-debug-0.log
Running lint for package: plugin-node

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-node/src/services/browser.ts
  265:21  error  Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free  @typescript-eslint/ban-ts-comment
  278:21  error  Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free  @typescript-eslint/ban-ts-comment

/tmp/eliza/packages/plugin-node/src/services/image.ts
  97:38  error  'reject' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-node/src/services/llama.ts
  184:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-node/src/services/pdf.ts
  12:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-node/src/services/speech.ts
    2:25  error  'ISpeechService' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
   79:17  error  Expected an assignment or function call and instead saw an expression             @typescript-eslint/no-unused-expressions
  115:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u         @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-node/src/services/transcription.ts
  30:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars
  71:22  error  'error' is defined but never used                                          @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-node/src/services/video.ts
   28:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars
  138:95  error  Unnecessary escape character: \/                                           no-useless-escape

/tmp/eliza/packages/plugin-node/src/vendor/vits.ts
  1475:36  error    'mean' is assigned a value but never used. Allowed unused vars must match /^_/u                                      @typescript-eslint/no-unused-vars
  1475:42  error    'stdDeviation' is assigned a value but never used. Allowed unused vars must match /^_/u                              @typescript-eslint/no-unused-vars
  1909:9   error    Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free  @typescript-eslint/ban-ts-comment
  2148:14  error    'newValue' is defined but never used. Allowed unused args must match /^_/u                                           @typescript-eslint/no-unused-vars
  2635:38  error    Unnecessary escape character: \,                                                                                     no-useless-escape
  2635:40  error    Unnecessary escape character: \.                                                                                     no-useless-escape
  2641:32  error    Unnecessary escape character: \-                                                                                     no-useless-escape
  2641:34  error    Unnecessary escape character: \–                                                                                     no-useless-escape
  3061:26  error    Do not access Object.prototype method 'hasOwnProperty' from target object                                            no-prototype-builtins
  3110:29  error    Do not access Object.prototype method 'hasOwnProperty' from target object                                            no-prototype-builtins
  4156:9   error    Unexpected aliasing of 'this' to local variable                                                                      @typescript-eslint/no-this-alias
  4416:13  error    'fragments' is assigned a value but never used. Allowed unused vars must match /^_/u                                 @typescript-eslint/no-unused-vars
  4417:13  error    'phonemizedFragmentsSubstitutions' is assigned a value but never used. Allowed unused vars must match /^_/u          @typescript-eslint/no-unused-vars
  4691:5   warning  'detectedLanguageProbabilities' is never reassigned. Use 'const' instead                                             prefer-const
  4747:10  error    'int8ToBuffer_Slow' is defined but never used. Allowed unused vars must match /^_/u                                  @typescript-eslint/no-unused-vars
  4761:10  error    'bufferToInt8_Slow' is defined but never used. Allowed unused vars must match /^_/u                                  @typescript-eslint/no-unused-vars
  4776:10  error    'int16ToBufferLE_Slow' is defined but never used. Allowed unused vars must match /^_/u                               @typescript-eslint/no-unused-vars
  4794:10  error    'bufferLEToInt16_Slow' is defined but never used. Allowed unused vars must match /^_/u                               @typescript-eslint/no-unused-vars
  4840:10  error    'int32ToBufferLE_Slow' is defined but never used. Allowed unused vars must match /^_/u                               @typescript-eslint/no-unused-vars
  4858:10  error    'bufferLEToInt32_Slow' is defined but never used. Allowed unused vars must match /^_/u                               @typescript-eslint/no-unused-vars
  4873:10  error    'float32ToBufferLE_Slow' is defined but never used. Allowed unused vars must match /^_/u                             @typescript-eslint/no-unused-vars
  4891:10  error    'bufferLEToFloat32_Slow' is defined but never used. Allowed unused vars must match /^_/u                             @typescript-eslint/no-unused-vars
  4906:10  error    'float64ToBufferLE_Slow' is defined but never used. Allowed unused vars must match /^_/u                             @typescript-eslint/no-unused-vars
  4924:10  error    'bufferLEToFloat64_Slow' is defined but never used. Allowed unused vars must match /^_/u                             @typescript-eslint/no-unused-vars
  5298:14  error    'e' is defined but never used                                                                                        @typescript-eslint/no-unused-vars
  5298:17  error    Empty block statement                                                                                                no-empty
  5828:11  error    'startTimestamp' is assigned a value but never used. Allowed unused vars must match /^_/u                            @typescript-eslint/no-unused-vars
  5832:11  error    'simplifiedText' is assigned a value but never used. Allowed unused vars must match /^_/u                            @typescript-eslint/no-unused-vars
  5866:11  error    'voiceGender' is assigned a value but never used. Allowed unused vars must match /^_/u                               @typescript-eslint/no-unused-vars
  6477:12  error    Unnecessary escape character: \-                                                                                     no-useless-escape
  6551:15  error    'isLastUpdate' is assigned a value but never used. Allowed unused vars must match /^_/u                              @typescript-eslint/no-unused-vars
  6783:16  error    'commandExists' is already defined                                                                                   no-redeclare
  7173:11  error    'startTimestamp' is assigned a value but never used. Allowed unused vars must match /^_/u                            @typescript-eslint/no-unused-vars
  7298:5   warning  'mappedTimeline' is never reassigned. Use 'const' instead                                                            prefer-const
  7661:5   error    'insertSeparators' is defined but never used. Allowed unused args must match /^_/u                                   @typescript-eslint/no-unused-vars
  7662:5   error    'useKlatt' is defined but never used. Allowed unused args must match /^_/u                                           @typescript-eslint/no-unused-vars
  7678:19  warning  'segmentTimeline' is never reassigned. Use 'const' instead                                                           prefer-const
  7679:16  warning  'espeakVoice' is never reassigned. Use 'const' instead                                                               prefer-const
  7837:10  error    'multiplyTimelineByFactor' is defined but never used. Allowed unused vars must match /^_/u                           @typescript-eslint/no-unused-vars
  8026:14  error    'e' is defined but never used                                                                                        @typescript-eslint/no-unused-vars
  8320:10  error    'getAllLangCodesFromVoiceList' is defined but never used. Allowed unused vars must match /^_/u                       @typescript-eslint/no-unused-vars

✖ 53 problems (49 errors, 4 warnings)

Lint failed for plugin-node
Linting package: core
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_20_683Z-debug-0.log
Running lint for package: core

> @ai16z/[email protected] lint
> eslint . --fix

(node:99234) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)

/tmp/eliza/packages/core/src/tests/token.test.ts
  8:33  error  Describe callback cannot be async  vitest/valid-describe-callback

✖ 1 problem (1 error, 0 warnings)

Lint failed for core
Linting package: plugin-solana
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_21_998Z-debug-0.log
Running lint for package: plugin-solana

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-solana/src/actions/pumpfun.ts
    7:5   error  'DEFAULT_DECIMALS' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  237:5   error  Unreachable code                                                                    no-unreachable
  278:22  error  'runtime' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars
  278:46  error  'message' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-solana/src/actions/swap.ts
  328:22  error  'e' is defined but never used   @typescript-eslint/no-unused-vars
  334:26  error  'e2' is defined but never used  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-solana/src/actions/takeOrder.ts
   6:5   error  'ActionExample' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
   9:13  error  'fs' is defined but never used. Allowed unused vars must match /^_/u             @typescript-eslint/no-unused-vars
  10:10  error  'settings' is defined but never used. Allowed unused vars must match /^_/u       @typescript-eslint/no-unused-vars
  35:15  error  'text' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-solana/src/providers/token.ts
  895:19  error  'ownerPercentage' is assigned a value but never used. Allowed unused vars must match /^_/u    @typescript-eslint/no-unused-vars
  896:19  error  'creatorPercentage' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-solana/src/providers/trustScoreProvider.ts
   32:11  error  'RecommendationGroup' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  608:9   error  'state' is defined but never used. Allowed unused args must match /^_/u                @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-solana/src/providers/wallet.ts
  36:11  error  'BirdEyePriceData' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 15 problems (15 errors, 0 warnings)

Lint failed for plugin-solana
Linting package: adapter-sqlite
Running lint for package: adapter-sqlite

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-sqlite

Linting package: client-github
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_24_593Z-debug-0.log
Running lint for package: client-github

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-github/src/index.ts
   13:5   error  'Content' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  233:18  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

✖ 2 problems (2 errors, 0 warnings)

Lint failed for client-github
Linting package: plugin-trustdb
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_25_922Z-debug-0.log
Running lint for package: plugin-trustdb

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-trustdb

Linting package: create-eliza-app
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_27_079Z-debug-0.log
Running lint for package: create-eliza-app

> [email protected] lint
> eslint . --fix

Successfully linted create-eliza-app

Linting package: plugin-starknet
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_28_305Z-debug-0.log
Running lint for package: plugin-starknet

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-starknet/src/actions/swap.ts
  19:30  error  'validateSettings' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  83:46  error  'message' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/actions/takeOrder.ts
  54:15  error  'text' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/actions/transfer.ts
  19:5   error  'validateSettings' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  61:46  error  'message' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/actions/unruggable.ts
  19:5   error  'validateSettings' is defined but never used. Allowed unused vars must match /^_/u        @typescript-eslint/no-unused-vars
  24:5   error  'EKUBO_TICK_SPACING' is defined but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars
  25:5   error  'LiquidityType' is defined but never used. Allowed unused vars must match /^_/u           @typescript-eslint/no-unused-vars
  27:5   error  'RECOMMENDED_EKUBO_FEES' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  85:46  error  'message' is defined but never used. Allowed unused args must match /^_/u                 @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/providers/token.ts
   12:5   error  'TokenTradeData' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  407:37  error  'tradeData' is defined but never used. Allowed unused args must match /^_/u       @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/providers/trustScoreProvider.ts
   23:10  error  'walletProvider' is defined but never used. Allowed unused vars must match /^_/u       @typescript-eslint/no-unused-vars
   26:7   error  'Wallet' is assigned a value but never used. Allowed unused vars must match /^_/u      @typescript-eslint/no-unused-vars
   35:11  error  'RecommendationGroup' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  608:9   error  'state' is defined but never used. Allowed unused args must match /^_/u                @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/providers/walletProvider.ts
    2:10  error  'Connection' is defined but never used. Allowed unused vars must match /^_/u        @typescript-eslint/no-unused-vars
    2:22  error  'PublicKey' is defined but never used. Allowed unused vars must match /^_/u         @typescript-eslint/no-unused-vars
   37:11  error  'BirdEyePriceData' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  109:31  error  'runtime' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars
  166:23  error  'runtime' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars
  178:19  error  'tokens' is assigned a value but never used. Allowed unused vars must match /^_/u   @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-starknet/src/utils/ERC20Token.ts
  1:19  error  'Call' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 23 problems (23 errors, 0 warnings)

Lint failed for plugin-starknet
Linting package: adapter-sqljs
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_29_686Z-debug-0.log
Running lint for package: adapter-sqljs

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/adapter-sqljs/src/types.ts
  138:5  error  Duplicate name 'each'  no-dupe-class-members

✖ 1 problem (1 error, 0 warnings)

Lint failed for adapter-sqljs
Linting package: plugin-bootstrap
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_30_850Z-debug-0.log
Running lint for package: plugin-bootstrap

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-bootstrap/src/actions/ignore.ts
  17:9  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars
  18:9  error  'message' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-bootstrap/src/actions/none.ts
  24:9  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars
  25:9  error  'message' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/plugin-bootstrap/src/providers/boredom.ts
  340:9  error  Unreachable code  no-unreachable

/tmp/eliza/packages/plugin-bootstrap/src/providers/facts.ts
  16:15  error  'embedding' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 6 problems (6 errors, 0 warnings)

Lint failed for plugin-bootstrap
Linting package: client-telegram
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_31_788Z-debug-0.log
Running lint for package: client-telegram

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-telegram/src/index.ts
  22:18  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

✖ 1 problem (1 error, 0 warnings)

Lint failed for client-telegram
Linting package: client-discord
Running lint for package: client-discord

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-discord/src/actions/chat_with_attachments.ts
  94:63  error  'state' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/actions/download_media.ts
  13:5   error  'Service' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  76:63  error  'state' is defined but never used. Allowed unused args must match /^_/u    @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/actions/joinvoice.ts
    1:1   error  Do not use "@ts-nocheck" because it alters compilation errors                       @typescript-eslint/ban-ts-comment
  170:19  error  'datestr' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/actions/leavevoice.ts
  93:33  error  'channel' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/actions/summarize_conversation.ts
  256:15  error  'datestr' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/actions/transcribe_media.ts
  76:63  error  'state' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/attachments.ts
  11:5  error  'Service' is defined but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/index.ts
  306:18  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-discord/src/voice.ts
  388:15  error  'monitor' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 11 problems (11 errors, 0 warnings)

Lint failed for client-discord
Linting package: client-direct
Running lint for package: client-direct

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-direct/src/index.ts
   14:5   error  'State' is defined but never used. Allowed unused vars must match /^_/u            @typescript-eslint/no-unused-vars
  225:23  error  'result' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars
  288:19  error  'runtime' is defined but never used. Allowed unused args must match /^_/u          @typescript-eslint/no-unused-vars
  295:18  error  'runtime' is defined but never used. Allowed unused args must match /^_/u          @typescript-eslint/no-unused-vars

✖ 4 problems (4 errors, 0 warnings)

Lint failed for client-direct
Linting package: client-twitter
Running lint for package: client-twitter

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/client-twitter/src/index.ts
  40:16  error  'runtime' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars

/tmp/eliza/packages/client-twitter/src/utils.ts
  273:42  error  Unnecessary escape character: \.  no-useless-escape
  273:45  error  Unnecessary escape character: \?  no-useless-escape
  273:50  error  Unnecessary escape character: \.  no-useless-escape
  273:53  error  Unnecessary escape character: \?  no-useless-escape
  273:60  error  Unnecessary escape character: \.  no-useless-escape
  273:63  error  Unnecessary escape character: \?  no-useless-escape

✖ 7 problems (7 errors, 0 warnings)

Lint failed for client-twitter
Linting package: adapter-postgres
Running lint for package: adapter-postgres

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-postgres

Linting package: plugin-image-generation
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_37_908Z-debug-0.log
Running lint for package: plugin-image-generation

> @ai16z/[email protected] lint
> eslint . --fix


/tmp/eliza/packages/plugin-image-generation/src/index.ts
   10:10  error  'generateCaption' is defined but never used. Allowed unused vars must match /^_/u   @typescript-eslint/no-unused-vars
   79:46  error  'message' is defined but never used. Allowed unused args must match /^_/u           @typescript-eslint/no-unused-vars
  151:23  error  'caption' is assigned a value but never used. Allowed unused vars must match /^_/u  @typescript-eslint/no-unused-vars

✖ 3 problems (3 errors, 0 warnings)

Lint failed for plugin-image-generation
Linting package: adapter-supabase
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-21T17_58_38_863Z-debug-0.log
Running lint for package: adapter-supabase

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-supabase

Lint process completed.😎

@monilpat
Copy link
Collaborator

LGTM! Thanks for working on this will be a gamechanger for maintainability :)

@jkbrooks
Copy link
Contributor

@snobbee @monilpat we hav two conflicts in:

packages/plugin-starknet/package.json
packages/plugin-trustdb/package.json

@monilpat
Copy link
Collaborator

Yeah please address merge conflicts. We really need to address #457 let me look into this.

@ponderingdemocritus
Copy link
Contributor

nice work. Can you:

  • make a higher level eslint config file and have packages import relevant settings
  • can you add a precommit function to run linting and prettier and suggest fixes

@snobbee
Copy link
Contributor Author

snobbee commented Nov 22, 2024

nice work. Can you:

  • make a higher level eslint config file and have packages import relevant settings
  • can you add a precommit function to run linting and prettier and suggest fixes

@ponderingdemocritus I pushed a new commit to the PR that resolves the two requests you listed out above, see commit: 79bdabb

and here is the result when running git commit it triggers both prettier-check and lint

$ git commit

> eliza@ prettier-check /tmp/eliza
> npx prettier --check .

(node:23180) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Checking formatting...
All matched files use Prettier code style!

> eliza@ lint /tmp/eliza
> bash ./scripts/lint.sh

Linting package: plugin-video-generation
Running lint for package: plugin-video-generation

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-video-generation

Linting package: client-auto
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_34_652Z-debug-0.log
Running lint for package: client-auto

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-auto

Linting package: plugin-node
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_35_761Z-debug-0.log
Running lint for package: plugin-node

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-node

Linting package: core
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_36_945Z-debug-0.log
Running lint for package: core

> @ai16z/[email protected] lint
> eslint . --fix

(node:23350) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)
Successfully linted core

Linting package: plugin-solana
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_38_246Z-debug-0.log
Running lint for package: plugin-solana

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-solana

Linting package: adapter-sqlite
Running lint for package: adapter-sqlite

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-sqlite

Linting package: client-github
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_40_749Z-debug-0.log
Running lint for package: client-github

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-github

Linting package: plugin-trustdb
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_42_085Z-debug-0.log
Running lint for package: plugin-trustdb

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-trustdb

Linting package: create-eliza-app
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_43_213Z-debug-0.log
Running lint for package: create-eliza-app

> [email protected] lint
> eslint . --fix

Successfully linted create-eliza-app

Linting package: plugin-starknet
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_44_309Z-debug-0.log
Running lint for package: plugin-starknet

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-starknet

Linting package: adapter-sqljs
Running lint for package: adapter-sqljs

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-sqljs

Linting package: plugin-bootstrap
Running lint for package: plugin-bootstrap

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-bootstrap

Linting package: client-telegram
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_47_725Z-debug-0.log
Running lint for package: client-telegram

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-telegram

Linting package: client-discord
Running lint for package: client-discord

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-discord

Linting package: client-direct
Running lint for package: client-direct

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-direct

Linting package: client-twitter
Running lint for package: client-twitter

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted client-twitter

Linting package: adapter-postgres
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_52_612Z-debug-0.log
Running lint for package: adapter-postgres

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-postgres

Linting package: plugin-image-generation
npm error A complete log of this run can be found in: /tmp/.npm/_logs/2024-11-22T16_43_53_758Z-debug-0.log
Running lint for package: plugin-image-generation

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted plugin-image-generation

Linting package: adapter-supabase
Running lint for package: adapter-supabase

> @ai16z/[email protected] lint
> eslint . --fix

Successfully linted adapter-supabase

Lint process completed.😎
┌──────────────────────────────────────────────────────────────┐
│ ℹ️  Commit message must follow the format: 'type: description' │
│    Valid types: feat, fix, docs, style, refactor, test, chore │
│    Example: 'feat: add new login feature'                     │
└──────────────────────────────────────────────────────────────┘

(node:23745) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[test/add-linter-to-all-packages 79bdabba] test: fix linter errors and add linter to pre-commit hook
 Author: Snobbish Bee <[email protected]>
 68 files changed, 269 insertions(+), 1496 deletions(-)
 create mode 100644 eslint.global.mjs

@snobbee
Copy link
Contributor Author

snobbee commented Nov 22, 2024

@ponderingdemocritus this PR also adds the linter to the "ci" CI workflow see: cf06999

@ponderingdemocritus ponderingdemocritus merged commit 6e05c0f into elizaOS:main Nov 22, 2024
2 checks passed
@snobbee snobbee deleted the test/add-linter-to-all-packages branch November 25, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants