antfu-collective / vitesse

🏕 Opinionated Vite + Vue Starter Template
https://vitesse.netlify.app/
MIT License
8.79k stars 932 forks source link

Linting issue: Type '_ActionsTree' is missing (pinia store) #490

Closed Borderliner closed 1 year ago

Borderliner commented 1 year ago

Describe the bug

I'm getting this error on the basic user.js store which comes with this project:

Argument of type 'StoreDefinition<"user", _UnwrapAll<Pick<{ setLoggedIn: (flag: boolean) => void; setName: (userName?: string | undefined) => void; setEmail: (userEmail?: string | undefined) => void; setApiKey: (userApiKey?: string | undefined) => any; ... 7 more ...; getUser: ComputedRef<...>; }, never>>, Pick<...>, Pick<...>>' is not assignable to parameter of type 'StoreDefinition<string, StateTree, _GettersTree<StateTree>, _ActionsTree>'.
  Type '_ActionsTree' is missing the following properties from type 'Pick<{ setLoggedIn: (flag: boolean) => void; setName: (userName?: string | undefined) => void; setEmail: (userEmail?: string | undefined) => void; setApiKey: (userApiKey?: string | undefined) => any; ... 7 more ...; getUser: ComputedRef<...>; }, "setLoggedIn" | ... 3 more ... | "setUser">': setLoggedIn, setName, setEmail, setApiKey, setUserts(2345)

AFAIK it's something related to hydration. But how do I get rid of this linting problem so that it doesn't cause problems in the future.

Reproduction

Clone the repo, run eslint

System Info

System:
    OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 3.90 GB / 15.57 GB
    Container: Yes
    Shell: 3.3.1 - /usr/bin/fish
  Binaries:
    Node: 18.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.5.1 - /usr/bin/npm
  Browsers:
    Chrome: 112.0.5615.165

Used Package Manager

pnpm

Validations

antfu commented 1 year ago

I am not able to reproduce it. Please provide more information.

Borderliner commented 1 year ago

Can't reproduce it either since today. Seems to be gone somehow. I'll post updates if anything comes up. Let's close this issue for now.