- Added a warning when trying to use a type in a condition that can never be false in Lua, such as numbers or strings. (Only when strictNullChecks is enabled.)
I refer to the update log to set strictNullChecks to false, but it still triggers this warning.
|
const strictNullChecks = context.options.strict === true || context.options.strictNullChecks === true; |
🤔Is it possible that || should be changed to &&?
my tsconfig:
{
"compilerOptions": {
"rootDir": ".",
"target": "esnext",
"lib": ["esnext"],
"moduleResolution": "node",
"types": [
"lua-types/jit",
"@moddota/dota-lua-types",
"typescript-to-lua/language-extensions"
],
"strict": true,
"strictNullChecks": false,
"experimentalDecorators": true,
"plugins": [
{
"transform": "@moddota/dota-lua-types/transformer"
}
]
},
"include": ["**/*.ts"],
"tstl": {
"luaTarget": "JIT"
}
}
I refer to the update log to set
strictNullChecksto false, but it still triggers this warning.TypeScriptToLua/src/transformation/utils/typescript/types.ts
Line 103 in e1a1fa6
🤔Is it possible that
||should be changed to&&?my tsconfig:
{ "compilerOptions": { "rootDir": ".", "target": "esnext", "lib": ["esnext"], "moduleResolution": "node", "types": [ "lua-types/jit", "@moddota/dota-lua-types", "typescript-to-lua/language-extensions" ], "strict": true, "strictNullChecks": false, "experimentalDecorators": true, "plugins": [ { "transform": "@moddota/dota-lua-types/transformer" } ] }, "include": ["**/*.ts"], "tstl": { "luaTarget": "JIT" } }