Closed
Description
π Search Terms
filename, noImplicitAny, TS7018, 7018
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about TS7018, line number, filename
β― Playground Link
π» Code
function doSthWithParams(params: unknown) {
if (typeof params !== 'object') {
return {};
}
return {
c: 'foo',
p: 'bar',
s: 'baz',
};
}
const bar = {
p: null,
s: null,
...doSthWithParams({
p: 'hello',
s: 'world',
}),
};
π Actual behavior
We're trying to incrementally get our codebase toward the strict mode. When we've enabled noImplicitAny
flag we got an error that was very hard to track as it didn't give a file and line number where the error happens.
Object literal's property 'p' implicitly has an 'any' type.
Object literal's property 's' implicitly has an 'any' type.
π Expected behavior
The TS compiler error should point to a file and line number where the error occurs
Additional information about the issue
This happens if noImplicitAny
is true and strictNullChecks
is not yet enabled