Skip to content

Large code base: inconsistencies with vue-tsc #6

@BracketJohn

Description

@BracketJohn

Hi @auvred 🧇

Thanks for building this - it looks quite exciting. Our team is working on a huge Nuxt codebase (multiple 10k lines of code) and is suffering from slow TS-check-times, so this could definitely be an awesome improvement.

One problem we encounter when trying out the module is that it outputs a bunch of namespace declaration errors and none of the TS-errors in our codebase.

In my test we setup your module as follows:

pnpm add -D golar @golar/vue

I then introduced a basic TS-error to verify that everything works as expected:

let a = 5
if (a === 'test') { // expected error 1: no overlap
  a = new Date() // expected error 2: re-assignment to a different type
}

TS 5.9 then outputs:

❯ pnpm typecheck

> NODE_OPTIONS="--max_old_space_size=8192" nuxt typecheck

ℹ nuxt-auth setup starting                                                                                                                                         sidebase-auth 10:50:35 AM
[sidebase-auth 10:50:35 AM] ℹ Selected provider: authjs. Auth API location is /api/auth, if you would like to change this, see https://auth.sidebase.io/guide/application-side/configuration#baseurl. Ensure that the NuxtAuthHandler({ ... }) is there, see https://auth.sidebase.io/guide/authjs/nuxt-auth-handler
✔ nuxt-auth setup done                                                                                                                                             sidebase-auth 10:50:35 AM
ℹ Using default Tailwind CSS file                                                                                                                               nuxt:tailwindcss 10:50:35 AM
ℹ Nuxt Icon server bundle mode is set to local                                                                                                                                   10:50:35 AM
✔ Nuxt Icon discovered local-installed 4 collections: carbon, cif, line-md, material-symbols                                                                                     10:50:36 AM
✔ Nuxt Icon loaded local collection machinery-category with 7 icons                                                                                                              10:50:36 AM
✔ Nuxt Icon loaded local collection machinery-rubric with 15 icons                                                                                                               10:50:36 AM
✔ Nuxt Icon loaded local collection accessory with 29 icons                                                                                                                      10:50:36 AM
server/utils/registerPostResponseTask.ts:4:5 - error TS2367: This comparison appears to be unintentional because the types 'number' and 'string' have no overlap.

4 if (a === 'test') {
      ~~~~~~~~~~~~

server/utils/registerPostResponseTask.ts:5:3 - error TS2322: Type 'Date' is not assignable to type 'number'.

5   a = new Date()
    ~


Found 2 errors in the same file, starting at: server/utils/registerPostResponseTask.ts:4

While golar just outputs:

❯ pnpm golar --noEmit
node_modules/.pnpm/apexcharts@4.7.0/node_modules/apexcharts/types/apexcharts.d.ts:60:16 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

60 declare module ApexCharts {
                  ~~~~~~~~~~

node_modules/.pnpm/email-addresses@5.0.0/node_modules/email-addresses/lib/email-addresses.d.ts:1:16 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

1 declare module emailAddresses {
                 ~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:3:15 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

3 export module Protocol {
                ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:4:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

4   export module Accessibility {
                  ~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:343:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

343   export module Animation {
                    ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:669:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

669   export module Audits {
                    ~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:1184:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

1184   export module Extensions {
                     ~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:1303:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

1303   export module Autofill {
                     ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:1464:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

1464   export module BackgroundService {
                     ~~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:1566:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

1566   export module Browser {
                     ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:2019:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

2019   export module CSS {
                     ~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:3564:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

3564   export module CacheStorage {
                     ~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:3761:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

3761   export module Cast {
                     ~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:3850:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

3850   export module DOM {
                     ~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:5255:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

5255   export module DOMDebugger {
                     ~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:5459:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

5459   export module EventBreakpoints {
                     ~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:5496:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

5496   export module DOMSnapshot {
                     ~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6034:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6034   export module DOMStorage {
                     ~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6117:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6117   export module DeviceOrientation {
                     ~~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6151:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6151   export module Emulation {
                     ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6827:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6827   export module HeadlessExperimental {
                     ~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6907:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6907   export module IO {
                     ~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:6975:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

6975   export module FileSystem {
                     ~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:7023:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

7023   export module IndexedDB {
                     ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:7402:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

7402   export module Input {
                     ~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:7925:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

7925   export module Inspector {
                     ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:7961:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

7961   export module LayerTree {
                     ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:8258:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

8258   export module Log {
                     ~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:8371:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

8371   export module Memory {
                     ~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:8551:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

8551   export module Network {
                     ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:11031:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

11031   export module Overlay {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:11854:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

11854   export module Page {
                      ~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:13925:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

13925   export module Performance {
                      ~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:14002:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

14002   export module PerformanceTimeline {
                      ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:14094:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

14094   export module Security {
                      ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:14399:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

14399   export module ServiceWorker {
                      ~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:14526:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

14526   export module Storage {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:15482:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

15482   export module SystemInfo {
                      ~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:15706:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

15706   export module Target {
                      ~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:16171:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

16171   export module Tethering {
                      ~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:16211:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

16211   export module Tracing {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:16428:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

16428   export module Fetch {
                      ~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:16803:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

16803   export module WebAudio {
                      ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17040:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17040   export module WebAuthn {
                      ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17337:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17337   export module Media {
                      ~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17464:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17464   export module DeviceAccess {
                      ~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17526:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17526   export module Preload {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17716:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17716   export module FedCm {
                      ~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17824:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17824   export module PWA {
                      ~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:17980:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

17980   export module BluetoothEmulation {
                      ~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:18177:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

18177   export module Console {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:18246:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

18246   export module Debugger {
                      ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:19273:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

19273   export module HeapProfiler {
                      ~~~~~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:19498:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

19498   export module Profiler {
                      ~~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:19768:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

19768   export module Runtime {
                      ~~~~~~~

node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:20827:17 - error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.

20827   export module Schema {
                      ~~~~~~


Found 56 errors in 3 files.

Errors  Files
     1  node_modules/.pnpm/apexcharts@4.7.0/node_modules/apexcharts/types/apexcharts.d.ts:60
     1  node_modules/.pnpm/email-addresses@5.0.0/node_modules/email-addresses/lib/email-addresses.d.ts:1
    54  node_modules/.pnpm/playwright-core@1.52.0/node_modules/playwright-core/types/protocol.d.ts:3

Is this a configuration error from our side?

Thanks again & have a good one!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions