Closed GollyJer closed 3 years ago
Thanks for reporting!
This setting is new in TS 4.0.1
so far, we've only used with TS 4.0.0
- so probably that explains why this setting not recognised.
related: is there any way to allow for such unexpected settings (since this could easily re-occur...)
hi @GollyJer am having some trouble reproducing this issue.
This PR has a test tsconfig.json:
The results are PASS for TypeScript 4 (and FAIL for TypeScript 3, as you'd expect):
https://github.com/pzavolinsky/ts-unused-exports/pull/190/checks?check_run_id=1953760178
@GollyJer a couple of questions:
ts-unused-exports
are you using?Previously, ts-unused-exports
was bundling its own version of TypeScript, but we stopped doing that since version 7.0.0
Can you confirm which version of TypeScript you are using?
Finally, can you post your tsconfig.json
(or at least, the relevant part)
Thank you Sean
ts-unused-exports 7.0.1
typescript 4.0.7
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": true,
"baseUrl": ".",
"checkJs": true,
"jsx": "react-native",
"lib": ["dom", "esnext"],
"moduleResolution": "node",
"noEmit": true,
"noErrorTruncation": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"paths": {
"~/*": ["./*"]
},
"plugins": [
{
"NOTE": "https://github.com/microsoft/typescript-styled-plugin/issues/58",
"lint": {
"validProperties": [
"aspect-ratio",
"box-shadow",
"elevation",
"margin-vertical",
"margin-horizontal",
"padding-horizontal",
"padding-vertical",
"resize-mode",
"shadow-color",
"shadow-opacity",
"shadow-offset",
"shadow-radius",
"text-align-vertical",
"tint-color"
]
},
"name": "typescript-styled-plugin"
}
],
"resolveJsonModule": true,
"skipLibCheck": true,
"target": "ESNext",
"types": ["jest", "webpack-env"]
}
}
Here is the error when noUncheckedIndexedAccess
is included in tsconfig.
@GollyJer I found the problem.
That setting was introduced in TypeScript version 4.1
But you are using an earlier version 4.0.7
If you want to use that TypeScript setting (noUncheckedIndexedAccess
) then you need to use at least TypeScript
4.1
or higher.
That is super embarrassing. Sorry to waste your time and thanks for the help.
@GollyJer no problem!
Hi, I was new to it and it took me a while to realize I'm using an unsupported setting in tsconfig.json. https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
This is a really cool package. Thanks!