piotr-oles/rsql

option to run this package with "skipLibCheck=false" not possible

Closed this issue · 2 comments

Hey :)

When trying to build my application with your package I ended up with this error:

node_modules/@rsql/ast/dist/index.d.ts:3:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

3 const EQ: "==";
  ~~~~~


node_modules/@rsql/parser/dist/index.d.ts:7:1 - error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.

7 function parse(source: string): ExpressionNode;
  ~~~~~~~~

It surely works when flagging skipLibCheck=true, but is this really wanted?

I now ended up with creating 2 custom typings in my application:

rsql_ast.d.ts:

declare module '@rsql/ast' {...}

rsql_parser.d.ts:

import { ExpressionNode } from '@rsql/ast';
declare module '@rsql/parser' {
    function parse(source: string): ExpressionNode;
}

i then was able to remove the skipLibCheck flag from my tsconfig and added the following option to it:

"paths": {
      "*": ["node_modules/*"],
      "@rsql/ast": ["custom_typings/rsql_ast.d.ts"],
      "@rsql/parser": ["custom_typings/rsql_parser.d.ts"]
    }

Looking forward to hear from you :)

Thanks for reporting this issue, I will take a look at this in a few days. PR's are welcome, so if you have an idea how to fix, go ahead :)

I've published a canary version - could you test if it solves your issues?

npm install @rsql/ast@1.0.2-canary.10.71f98a5.0
npm install @rsql/builder@1.0.2-canary.10.71f98a5.0
npm install @rsql/emitter@1.0.2-canary.10.71f98a5.0
npm install @rsql/parser@1.0.2-canary.10.71f98a5.0
# or 
yarn add @rsql/ast@1.0.2-canary.10.71f98a5.0
yarn add @rsql/builder@1.0.2-canary.10.71f98a5.0
yarn add @rsql/emitter@1.0.2-canary.10.71f98a5.0
yarn add @rsql/parser@1.0.2-canary.10.71f98a5.0