question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to pass a custom tsconfig for `next dev`

See original GitHub issue

Feature request

Is your feature request related to a problem? Please describe.

I’m bored of seeing someVar is declared but its value is never read:

I’m actively write and delete code, exploring some libraries’ features - I don’t want my dev server to stuck me into an error. Of course it’s bad to leave them. Of course my IDE should highlight that - and for that reason, I want to have noUnusedLocals or noUnusedParameters, strict in overall. Of course there should be some pre-commit hook that will prevent me from committing this clutter into the repository. But I don’t want my dev server to throw noUnusedLocals and noUnusedParameters - I don’t want it to prevent me playing with the code.

UPD. That’s okay for the default behavior, but there should be an option that these keys should be enabled by VSCode, and by linter, but not used by dev server so it won’t throw error that prevents you to do anything.

Describe the solution you’d like

I’d like an ability of passing a tsconfig path for next dev command.

Something like:

next dev --tsconfig=tsconfig.devserver.json

While I can use the original tsconfig.json for my IDE.

Describe alternatives you’ve considered

Well, I could make an issue for IDE (vscode doesn’t support anything other than tsconfig.json too), but anyway - both sides should support that.

UPD. There’s one: https://github.com/Microsoft/vscode/issues/12463. Still, both sides should support that.

Additional context

Idk maybe it’s possible. But I don’t see it from next dev --help:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

9reactions
fabbcommented, Feb 28, 2020

i’d like to exclude test.tsx? files from next compilation, but need to include the files in tsconfig.json so i get proper autocomplete in VSCode. any ideas how to solve this?

8reactions
Timercommented, Jul 22, 2019

I agree right now overly strict TypeScript configurations can cause a bit of headache during development. Typically, this is solved by a separate tsconfig.prod.json you run over your code base using tsc w/ noEmit.

As for now, we’re going to start working to make TypeScript errors as unobtrusive as possible before we hand out the knobs to completely disable this integration.

Please bear with us! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to pass a custom tsconfig for next dev #8060 - GitHub
I'd like an ability of passing a tsconfig path for next dev command. Something like: next dev --tsconfig=tsconfig.devserver.json.
Read more >
Configuring: TypeScript - Next.js beta docs
Run next dev and next build to automatically install the necessary dependencies and add a tsconfig.json file with the recommended config options. Using...
Read more >
How to build next.js app with custom server for production in ...
1 Answer 1 · Delete any .next and dist folders · In the project root, create an additional tsconfig file called tsconfig.server.json which...
Read more >
Using Next.js with TypeScript - LogRocket Blog
In this tutorial, learn how to use Next.js with TypeScript to build a modern stack for high-quality, search-optimized apps.
Read more >
Configuring Jest
To read TypeScript configuration files Jest requires ts-node . ... A custom time delta may be provided by passing a number.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found