🚀 Feature request
This is not really a Feature Request, I spent hours to figure out the issue, but I don't think it is a bug too.
Current Behavior
No where mentioned about the "strictNullChecks": true must be set in tsconfig.json in order to let spectacles-ts to work correctly.
When I try spectacles-ts on experimental site, it works well: https://codesandbox.io/s/spectacles-ts-experiments-krc1x9?file=/tsconfig.json
But I created my own simple project with npm init and copy an tsconfig.json from my existing project, with following index.ts:
import { pipe } from "fp-ts/lib/function";
import { get } from "spectacles-ts";
export type DbAddress = {
address?: string;
city?: string;
state?: string;
country?: string;
lat?: number;
lng?: number;
postCode?: string;
};
export type DbUserAddress = {
record: DbAddress;
streetAddress: string;
};
const got = (uaddr: DbUserAddress) => pipe(uaddr, get("record"));
// IDE show: const got: (uaddr: DbUserAddress) => DbUserAddress
I use the same code in experimental site, it infer correctly: const got: (uaddr: DbUserAddress) => DbAddress
I tried to change the version of dependencies but not works
Then I diff my tsconfig, and experimental tsconfig, remove/change this and that config.
After all, when I add strictNullChecks: true, it works like a charm.
Desired Behavior
Short description in the Installation about this.
Suggested Solution
Short description in the Installation about this.
Who does this impact? Who is this for?
Who have configure the tsconfig.json without strictNullChecks or set to false
Describe alternatives you've considered
Additional context
Your environment
| Software |
Version(s) |
| spectacles-ts |
1.0.6 |
| fp-ts |
2.11.9 |
| TypeScript |
^4.6.4 |
🚀 Feature request
This is not really a Feature Request, I spent hours to figure out the issue, but I don't think it is a bug too.
Current Behavior
No where mentioned about the
"strictNullChecks": truemust be set intsconfig.jsonin order to let spectacles-ts to work correctly.When I try spectacles-ts on experimental site, it works well: https://codesandbox.io/s/spectacles-ts-experiments-krc1x9?file=/tsconfig.json
But I created my own simple project with
npm initand copy antsconfig.jsonfrom my existing project, with following index.ts:I use the same code in experimental site, it infer correctly:
const got: (uaddr: DbUserAddress) => DbAddressI tried to change the version of dependencies but not works
Then I diff my tsconfig, and experimental tsconfig, remove/change this and that config.
After all, when I add strictNullChecks: true, it works like a charm.
Desired Behavior
Short description in the Installation about this.
Suggested Solution
Short description in the Installation about this.
Who does this impact? Who is this for?
Who have configure the
tsconfig.jsonwithoutstrictNullChecksor set tofalseDescribe alternatives you've considered
Additional context
Your environment