Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with new version of TS #11

Open
baomastr opened this issue Aug 21, 2018 · 4 comments
Open

Trouble with new version of TS #11

baomastr opened this issue Aug 21, 2018 · 4 comments

Comments

@baomastr
Copy link

new flag in tsconfig need for new version of TS

microsoft/TypeScript#25260 (comment)

@moodysalem
Copy link
Owner

@baomastr is this flag supposed to be set in the dependencies, or in the project including them? the comment says...

Fixing the packages by hand is senseless.

@baomastr
Copy link
Author

@moodysalem the flag is supposed to be in tsconfig.json files for dev and prod in order to fix the errors with new version of TS like this:

Type 'keyof T' does not satisfy the constraint 'string'.
  Type 'string | number | symbol' is not assignable to type 'string'.
    Type 'number' is not assignable to type 'string'.

fixing TS package version by hand can also help but it is not right solution if you want to use new version of TS.

@baomastr
Copy link
Author

baomastr commented Aug 21, 2018

here is the link to changelist of TS :
https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#keyof-now-includes-string-number-and-symbol-keys

and line in code, that causes error in new version is:

export type Diff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [ x: string ]: never })[T];

you can also see last comments about that trick
http://ideasintosoftware.com/typescript-advanced-tricks/

@davwheat
Copy link

You can just remove the export type Omit // ... line now as normal TS has this type built-in.

You'll need to ignore the 2nd error about {} not being part of the types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants