sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.75k stars 1.95k forks source link

[@sveltejs/adapter-vercel] pnpm format && pnpm lint shows errors in ./vercel/output dir after test:e2e #13045

Closed shinokada closed 2 hours ago

shinokada commented 5 hours ago

Describe the bug

After installing @sveltejs/adapter-vercel to a new svelte project, I added the following .prettierignore:

.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
/dist
/.vercel

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
playwright-report
.vercel

*.md
*.html

.vercel/output/**

When I run pnpm:e2e, it will create .vercel dir. Them when I run pnpm format && pnpm lint, it shows errors from .vercel/output directory.

As you can see I added vercels to .prettieringnore file.

The following outputs are some of them.


/Users/shinichiokada/Downloads/svelte/svelte-vercel-problem/.vercel/output/static/_app/immutable/nodes/1.gcVpeaF4.js
  1:506   error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:565   error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:584   error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:661   error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:709   error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:1106  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions
  1:1124  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions

/Users/shinichiokada/Downloads/svelte/svelte-vercel-problem/.vercel/output/static/_app/immutable/nodes/2.C9REa21g.js
  1:416  error  Expected an assignment or function call and instead saw an expression  @typescript-eslint/no-unused-expressions

Reproduction

npx sv create svelte-vercel-adapter
pnpm i -D @sveltejs/adapter-vercel

Update svelte.config.js

import adapter from '@sveltejs/adapter-vercel';
...

Run test, format and lint:

cd svelte-vercel-adapter
pnpm test:e2e
pnpm format && pnpm lint

My current solution

I modify the lint scripts:

"lint": "rm -rf .vercel && prettier --check . && eslint .",

Logs

No response

System Info

System:
    OS: macOS 15.1.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 315.75 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node
    npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm
    pnpm: 9.14.2 - /opt/homebrew/bin/pnpm
    bun: 1.1.8 - ~/.bun/bin/bun
  Browsers:
    Chrome: 131.0.6778.86
    Edge: 131.0.2903.63
    Safari: 18.1.1
  npmPackages:
    @sveltejs/adapter-vercel: ^5.4.8 => 5.4.8 
    @sveltejs/kit: ^2.0.0 => 2.8.2 
    @sveltejs/package: ^2.0.0 => 2.3.7 
    @sveltejs/vite-plugin-svelte: ^4.0.0 => 4.0.1 
    svelte: ^5.0.0 => 5.2.7 
    vite: ^5.0.11 => 5.4.11

Severity

annoyance

Additional Information

No response

dummdidumm commented 4 hours ago

The errors are from eslint, not prettier