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

TypeScript: Create nuxt.config.ts instead nuxt.config.js #470

Open
munierujp opened this issue Apr 14, 2020 · 5 comments
Open

TypeScript: Create nuxt.config.ts instead nuxt.config.js #470

munierujp opened this issue Apr 14, 2020 · 5 comments

Comments

@munierujp
Copy link
Contributor

@nuxt/types package provides type definition for Nuxt configuration.

Configuration (Runtime) | Nuxt TypeScript

I think that project with TypeScript should use nuxt.config.ts instead nuxt.config.js.

@fabiofdsantos
Copy link

I also have these related errors:

  61:13  error  'config' is defined but never used. Allowed unused args must match /^_/u  @typescript-eslint/no-unused-vars
  61:21  error  'ctx' is defined but never used. Allowed unused args must match /^_/u     @typescript-eslint/no-unused-vars

@climba03003
Copy link

When you are having server like Express or Koa (Others, I am not using). Replacing nuxt.config.js to nuxt.config.ts will cause a lot of inconvenience.

For example, after compiling server/index.ts to server/index.js. It cannot read nuxt.config.ts file.

@fabiofdsantos
Copy link

@climba03003
So, at least .ts should be created by default for SPA mode.

@pi0 pi0 assigned kevinmarrec and unassigned kevinmarrec May 5, 2020
@pi0
Copy link
Member

pi0 commented May 5, 2020

/cc @kevinmarrec

@kevinmarrec
Copy link
Contributor

kevinmarrec commented May 5, 2020

The following PR : #449 will do it and fix lint issues.

FYI : nuxt.config.ts is not mandatory for a Nuxt TypeScript project, as well as @nuxt/typecript-runtime being optional.

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

No branches or pull requests

5 participants