Git Product home page Git Product logo

safeql-recursive-type-bug's Introduction

ts-safeql recursive json type bug

Reproduction repo for ts-safeql/safeql#218

How to reproduce

  1. Start database:
docker compose up -d
  1. Run eslint with --fix
npx eslint --fix .
  1. See output:
  21:5  error  Query has incorrect type annotation.
        Expected: { id: number; value: ({ type: 'entry'; name: string } | { type: 'group'; entries: Entry[] })[] }[]
          Actual: { id: number; value: Entry[] }[]  @ts-safeql/check-sql
  1. Note that it does not fix the issue.

  2. Change the 'test.value': 'Entry[]' line in .eslintrc.js to 'test.value': 'Entries' (no need to define Entries anywhere).

  3. Run eslint

  4. Note the maximum call stack size exceeded error

Oops! Something went wrong! :(

ESLint: 8.57.0

RangeError: Maximum call stack size exceeded
Occurred while linting /home/kalu/bw/safeql-recursive-type-bug/src/main.ts:21
Rule: "@ts-safeql/check-sql"
    at getSourceTextOfNodeFromSourceFile (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:13387:45)
    at getTextOfNode (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:13407:12)
    at declarationNameToString (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:13680:62)
    at getNameOfSymbolAsWritten (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:54415:18)
    at createAccessFromSymbolChain (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:52297:27)
    at symbolToTypeNode (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:52274:28)
    at typeToTypeNodeWorker (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:50900:18)
    at typeToTypeNodeHelper (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:50749:26)
    at typeReferenceToTypeNode (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:51326:33)
    at typeToTypeNodeWorker (/home/kalu/bw/safeql-recursive-type-bug/node_modules/typescript/lib/typescript.js:50905:85)

safeql-recursive-type-bug's People

Contributors

lunedis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.