I have https://github.com/gorules/jdm-editor installed in my project. One of its dependencies is immer
. When I run tsc --noEmit
I get this TS6133
error:
npm run type-check
> [email protected] type-check
> tsc --noEmit
node_modules/immer/src/utils/common.ts:207:33 - error TS6133: 'key' is declared but its value is never read.
207 Object.entries(obj).forEach(([key, value]) => freeze(value, true))
~~~
Found 1 error in node_modules/immer/src/utils/common.ts:207
From what I’ve read, this is because it’s a transitive dependency so TypeScript is type-checking it as part of the dependency graph for jdm-editor.
If I install immer
on its own, I have no TS error, which is why I think this has to do with it being a transitive dependency. How can I get TS to ignore this issue?
Here’s my tsconfig.json
:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"declaration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"incremental": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"moduleResolution": "node",
"noEmit": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"strictBindCallApply": false,
"strictNullChecks": true,
"target": "esnext",
"typeRoots": ["./src/@types", "./node_modules/@types"]
},
"exclude": ["./node_modules", "../typings"],
"include": ["./src", "./vite.config.ts", "./jest.config.ts"]
}
Tried skipLibCheck
false and true, with no change. Tried installing immer on its own and verified that it works fine solo. Tried pinning version of immer.
5