pankod / next-boilerplate

A well-structured production ready Next.js boilerplate with Typescript, Redux, Jest, Enzyme, Express.js, Sass, Css, EnvConfig, Fetch, Reverse Proxy, Bundle Analyzer and Built-in Project CLI. https://pankod.github.io/next-boilerplate/
MIT License
1.6k stars 279 forks source link

Typescript Linting Errors on VS Code #58

Closed AmitJoki closed 5 years ago

AmitJoki commented 5 years ago

Has this repo been tested on VS Code? I see lots of TypeScript errors via VS Code Problems tab which kinda irks me.

Like _app.tsx results in:

(JSX attribute) store: Store<any, AnyAction>
The single Redux store in your application.

No overload matches this call.
  Overload 1 of 2, '(props: Readonly<ProviderProps<AnyAction>>): Provider<AnyAction>', gave the following error.
    Type 'IStore' is missing the following properties from type 'Store<any, AnyAction>': dispatch, getState, subscribe, replaceReducer, [Symbol.observable]
  Overload 2 of 2, '(props: ProviderProps<AnyAction>, context?: any): Provider<AnyAction>', gave the following error.
    Type 'IStore' is not assignable to type 'Store<any, AnyAction>'.ts(2769)
index.d.ts(397, 5): The expected type comes from property 'store' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Provider<AnyAction>> & Readonly<ProviderProps<AnyAction>> & Readonly<{ children?: ReactNode; }>'
index.d.ts(397, 5): The expected type comes from property 'store' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<Provider<AnyAction>> & Readonly<ProviderProps<AnyAction>> & Readonly<{ children?: ReactNode; }>'

and index.tsx results in

class HomePage
Argument of type 'typeof HomePage' is not assignable to parameter of type 'NextComponentType<{}, {}, NextContext<Record<string, string | string[] | undefined>>>'.
  Type 'typeof HomePage' is not assignable to type 'NextComponentClass<{}, {}, NextContext<Record<string, string | string[] | undefined>>>'.
    Type 'typeof HomePage' is not assignable to type 'ComponentClass<{}, any>'.
      Types of parameters 'props' and 'props' are incompatible.
        Type '{}' is not assignable to type 'IProps'.
          Type '{}' is missing the following properties from type 'IOwnProps': t, i18nts(2345)

The yarn build itself doesn't throw any errors to be clear.

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.67. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

omeraplak commented 5 years ago

Hi @AmitJoki , Thanks for reaching us. We’re gonna investigate it. And we’ll update it soon. Feel free to contact us if you need anything.

BatuhanW commented 5 years ago

Hello @AmitJoki we are working on v2 of this boilerplate, which is nextjs version 9, issues like this are fixed in the new version, stay tuned for updates!