You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building an editor and have a file "initial-code.ts" which I'm importing as text, not as typescript. I want to keep its .ts extension for syntax highlighting when I edit it.
during next build this file causes next to assume my project uses typescript - breaking when an imported dependency in that file doesn't exist in my project.
by adding a config 'usingTypeScript' I can tell next to skip unwanted typescript processes
Non-Goals
No response
Background
I didn't see any discourse when checking github discussions and issues for the initial error I received "Linting and checking validity of types". Also googled for a while to learn what was going on.
I looked at next.js's code and didn't see a sensible way to get around its assumption that my project used typescript. I understand wanting to keep things easy for folk and auto-detecting TS - but believe a config should exist to be explicit.
it adds a new config 'usingTypeScript' which defaults to 'auto' preserving existing behavior. By setting it to true or false, it skips the intent step and responds appropriately.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
I'm building an editor and have a file "initial-code.ts" which I'm importing as text, not as typescript. I want to keep its .ts extension for syntax highlighting when I edit it.
during
next build
this file causes next to assume my project uses typescript - breaking when an imported dependency in that file doesn't exist in my project.by adding a config 'usingTypeScript' I can tell next to skip unwanted typescript processes
Non-Goals
No response
Background
I didn't see any discourse when checking github discussions and issues for the initial error I received "Linting and checking validity of types". Also googled for a while to learn what was going on.
I looked at next.js's code and didn't see a sensible way to get around its assumption that my project used typescript. I understand wanting to keep things easy for folk and auto-detecting TS - but believe a config should exist to be explicit.
Proposal
Here is my initial implementation
olsonpm@43b7121?w=1
it adds a new config 'usingTypeScript' which defaults to 'auto' preserving existing behavior. By setting it to
true
orfalse
, it skips the intent step and responds appropriately.Beta Was this translation helpful? Give feedback.
All reactions